Page MenuHomeFreeBSD

[PPC64] Add ifunc support in libcsu

Authored by luporl on Jul 25 2019, 7:53 PM.



When ifuncs are used in statically linked binaries, the C runtime
must perform the needed dynamic relocations, to make calls to ifuncs
work correctly.

The plan is to land this together with ifunc support in rtld, right after
the switch to ELFv2 ABI.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

1223 ↗(On Diff #60147)

As an aside -- This line is needed for pretty much everything ifunc related kernel and user, I think it should be a priority to get this oneliner in just so it doesn't have to get duplicated between diffs doing different parts of the ifunc work.

1223 ↗(On Diff #60147)

jhibbits pointed out in IRC that there should also be #define R_PPC_IRELATIVE 248 in the previous block.

1223 ↗(On Diff #60147)

Correction, it should be named R_PPC_IRELATIVE in the first place instead of being duplicated. as per the convention in this file of using the R_PPC prefix for relocations that aren't unique to PPC64.

1223 ↗(On Diff #60147)

Ok, so you suggest moving this change to a separate revision, right? And also change R_PPC64_IRELATIVE to R_PPC_IRELATIVE, correct?

1223 ↗(On Diff #60147)

Yep, precisely.

  • Separate elf_common.h change
  • Change R_PPC64_IRELATIVE to R_PPC_IRELATIVE in code

This should be able to go in before flag day, there's nothing preventing it from working (we don't need linker support just for this, it's all in code).

This revision is now accepted and ready to land.Sep 12 2019, 3:03 PM
This revision was automatically updated to reflect the committed changes.