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)
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
Unknown Object (File)
Sep 22 2024, 6:34 PM
Unknown Object (File)
Sep 21 2024, 11:49 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 57609
Build 54497: arc lint + arc unit

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