Closed fweimer closed 4 years ago
All of PSM2's internal symbols are .hidden with very few exceptions via the control linker script provided in the main directory,
See: https://github.com/intel/opa-psm2/blob/master/psm2_linker_script.map .... / Make all other symbols local / local: *; ....
Makefile inclusion and use of said file:: ... LINKER_SCRIPT_FILE = ${OUTDIR}/psm2_linker_script.map ... $(OUTDIR)/${TARGLIB}.so.${MAJOR}.${MINOR}: ${${TARGLIB}-objs} $(LINKER_SCRIPT_FILE) ... $(CC) $(LINKER_SCRIPT) $(LDFLAGS) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} -shared \ ${${TARGLIB}-objs} $(OUTDIR)/_revision.o -Lopa $(LDLIBS) ..
Still this requires that there is never an indirect call. Presumably all binutils versions which support GNU Property note merging will always perform relocation relaxation for hidden symbols, and no one will compile the code with the large code model, so the PLT indirection is removed by the linker and there will not be an indirect call in the background.
I can update the pull request to drop the _CET_ENDBR
if you prefer that.
@rwmcguir Any further comments? Could we please move this forward? Thanks.
Reviewing all pull requests. This looks like one that was never acted on. @fweimer, if you're still available - what tools provide cnet.h? It doesn't seem to be provided by gcc as of 8.2.1.
@mwheinz GCC with -mcet
support provides <cet.h>
, which is why there is an #ifdef
guard for __CET__
.
@mwheinz GCC with
-mcet
support provides<cet.h>
, which is why there is an#ifdef
guard for__CET__
.
Okay - found it. But then doesn't the patch require a change to buildflags.mak?
But then doesn't the patch require a change to buildflags.mak?
My expectation is that distributions who need CET markup with build with -fcf-protection
, so this should come from the environment CFLAGS
setting, not from the project build system.
But then doesn't the patch require a change to buildflags.mak?
My expectation is that distributions who need CET markup with build with
-fcf-protection
, so this should come from the environmentCFLAGS
setting, not from the project build system.
Okay. We're evaluating this now. Thanks for being patient.
Will be included in the next PSM2 release.
Note that the
_CET_ENDBR
instruction is only needed if the function is ever called from a different shared object. I did not see any.hidden
or visibility attribute, so I assumed that this might be the case, and added the instruction just in case.