]> git.ipfire.org Git - thirdparty/glibc.git/commit
TODO(l_addr): aarch64: morello: dynamic linking support
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 29 Mar 2022 14:24:38 +0000 (15:24 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 5 Aug 2022 18:45:19 +0000 (19:45 +0100)
commit3eb1c569eb5ab70a27fd4151a101e9d57b57b885
tree20c1478a2198eaa903448d7653a65d3b15c248a3
parent6f93421a5f177e382832cf49a5796eadabee32a9
TODO(l_addr): aarch64: morello: dynamic linking support

Add morello specific dl-machine.h.

Add morello dynamic relocation processing support for purecap ABI.
Only support R_AARCH64_NONE, R_AARCH64_ABS64 and R_AARCH64_RELATIVE
dynamic relocs from the lp64 abi. This required several APIs to
change ElfW(Addr) to uintptr_t including in generic code (where
elfptr_t used to cover both traditional and capability abis).

RELATIVE and IRELATIVE relocs use a helper function to construct a
capability.  Also fixed the IRELATIVE handling for static linking.

Use new machine routines on morello for load address computation so it
is a valid capability:

 void *elf_machine_runtime_dynamic (void)
 uintptr_t elf_machine_load_address_from_args (void *)

The ld.so load address is either AT_BASE or if it is invoked as a
command then derived from AT_PHDR or _DYNAMIC (pcc).

ELF_MACHINE_START_ADDRESS is updated to turn the ElfW(Addr) user entry
into a capability based on l_addr.

TODO: __tls_get_addr should return a bounded pointer.
(in case traditional tls is defined for morello)

note: tls_index struct that is used for trad tls is changed for morello.
(this is abi once trad tls is defined for morello)

arguably _dl_make_tlsdesc_dynamic should set up tlsinfo.ti_size too.
(but it's better to avoid changing the generic code)

TODO: use cheri auxv entries to derive ld.so capabilities, this will
      require separate RW and RX base pointers instead of single l_addr.
      AT_BASE will not be a capability covering ld.so.
12 files changed:
elf/dl-sym-post.h
elf/do-rel.h
elf/dynamic-link.h
elf/rtld.c
sysdeps/aarch64/linkmap.h
sysdeps/aarch64/morello/dl-irel.h [new file with mode: 0644]
sysdeps/aarch64/morello/dl-machine.h [new file with mode: 0644]
sysdeps/aarch64/morello/dl-tlsdesc.S [new file with mode: 0644]
sysdeps/aarch64/morello/dl-tlsdesc.h [new file with mode: 0644]
sysdeps/aarch64/morello/tlsdesc.sym [new file with mode: 0644]
sysdeps/aarch64/sys/ifunc.h
sysdeps/generic/dl-lookupcfg.h