Page MenuHomeFreeBSD

rtld: Add support for arm64 variant pcs
ClosedPublic

Authored by andrew on Apr 19 2024, 3:37 PM.
Tags
None
Referenced Files
F102952717: D44869.diff
Tue, Nov 19, 3:32 AM
F102899199: D44869.id137397.diff
Mon, Nov 18, 11:57 AM
Unknown Object (File)
Sep 29 2024, 11:22 AM
Unknown Object (File)
Sep 29 2024, 11:21 AM
Unknown Object (File)
Sep 28 2024, 5:17 PM
Unknown Object (File)
Sep 28 2024, 5:17 PM
Unknown Object (File)
Sep 28 2024, 5:06 PM
Unknown Object (File)
Sep 24 2024, 8:20 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 57223
Build 54111: arc lint + arc unit

Event Timeline

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

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
252

this sentence just trails off...

264

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?

268

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)

271

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.Apr 19 2024, 3:56 PM
  • Fix a comment
  • Remove debugging
libexec/rtld-elf/aarch64/reloc.c
264

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

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

libexec/rtld-elf/rtld.h
187

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.May 8 2024, 3:58 AM
This revision was automatically updated to reflect the committed changes.