Page MenuHomeFreeBSD

rtld: Add support for arm64 variant pcs
ClosedPublic

Authored by andrew on Apr 19 2024, 3:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 17, 10:30 AM
Unknown Object (File)
Sat, May 4, 3:09 PM
Unknown Object (File)
Sat, Apr 27, 6:53 AM
Unknown Object (File)
Thu, Apr 25, 1:50 PM
Unknown Object (File)
Thu, Apr 25, 1:50 PM
Unknown Object (File)
Thu, Apr 25, 1:50 PM
Unknown Object (File)
Thu, Apr 25, 7:14 AM
Unknown Object (File)
Sat, Apr 20, 7:14 PM
Subscribers

Details

Summary

The aarch64 ELF spec has support for a variant of the normal procedure
call standard that doesn't follow the normal register convention, e.g.
using more registers as arguments, or different register state is
preserved.

Add support to rtld to handle this. As we don't know which registers
need to be preserved disable lazy binding for these functions.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

libexec/rtld-elf/aarch64/reloc.c
263

we can't be what?

The code likely is good, but the why for some of it isn't obvious to me and needs some clarification I think.

libexec/rtld-elf/aarch64/reloc.c
263

this sentence just trails off...

275

this effectively short-circuits the PLT relocations and winding up in rtld_die() with an error message of Fatal Error. How will that be tracked down?

279

How is this related? We didn't do this before and gnu_ifunc behavior is changed (before we'd always compute where, now we skip it)

282

and why this behavior change. Before we'd bias the relocation by relocbase, but here we're computing the value based on the st_value of the symbol. Are these two things expected to be the same?

andrew retitled this revision from rtld: Add suport for arm64 variant pcs to rtld: Add support for arm64 variant pcs.Fri, Apr 19, 3:56 PM
  • Fix a comment
  • Remove debugging
libexec/rtld-elf/aarch64/reloc.c
275

This is based on the code in reloc_jmpslots which is run just after reloc_plt when bind_now (either per-object, or globally).

libexec/rtld-elf/rtld.c
1539 ↗(On Diff #137397)

Same, would be nice to provide MD hook for MD dyn tags.

libexec/rtld-elf/rtld.h
187 ↗(On Diff #137397)

We usually declare bools as bool bitfield, see below in the structure.

Since we are growing more MD fields in the Obj_Entry, can we provide MD define for them instead of adding more #ifdefs there?

This revision is now accepted and ready to land.Wed, May 8, 3:58 AM
This revision was automatically updated to reflect the committed changes.