summaryrefslogtreecommitdiff
path: root/arch/x32/reloc.h
AgeCommit message (Collapse)AuthorFilesLines
2015-09-17new dlstart stage-2 chaining for x86_64 and x32Rich Felker1-0/+5
2015-04-20fix breakage in x32 dynamic linker due to mismatching register sizeRich Felker1-1/+1
the jmp instruction requires a 64-bit register, so cast the desired PC address up to uint64_t, going through uintptr_t to ensure that it's zero-extended rather than possibly sign-extended.
2015-04-13dynamic linker bootstrap overhaulRich Felker1-31/+17
this overhaul further reduces the amount of arch-specific code needed by the dynamic linker and removes a number of assumptions, including: - that symbolic function references inside libc are bound at link time via the linker option -Bsymbolic-functions. - that libc functions used by the dynamic linker do not require access to data symbols. - that static/internal function calls and data accesses can be made without performing any relocations, or that arch-specific startup code handled any such relocations needed. removing these assumptions paves the way for allowing libc.so itself to be built with stack protector (among other things), and is achieved by a three-stage bootstrap process: 1. relative relocations are processed with a flat function. 2. symbolic relocations are processed with no external calls/data. 3. main program and dependency libs are processed with a fully-functional libc/ldso. reduction in arch-specific code is achived through the following: - crt_arch.h, used for generating crt1.o, now provides the entry point for the dynamic linker too. - asm is no longer responsible for skipping the beginning of argv[] when ldso is invoked as a command. - the functionality previously provided by __reloc_self for heavily GOT-dependent RISC archs is now the arch-agnostic stage-1. - arch-specific relocation type codes are mapped directly as macros rather than via an inline translation function/switch statement.
2014-06-18refactor to remove arch-specific relocation code from dynamic linkerRich Felker1-27/+20
this was one of the main instances of ugly code duplication: all archs use basically the same types of relocations, but roughly equivalent logic was duplicated for each arch to account for the different naming and numbering of relocation types and variation in whether REL or RELA records are used. as an added bonus, both REL and RELA are now supported on all archs, regardless of which is used by the standard toolchain.
2014-06-16dynamic linker: permit error returns from arch-specific reloc functionRich Felker1-1/+2
the immediate motivation is supporting TLSDESC relocations which require allocation and thus may fail (unless we pre-allocate), but this mechanism should also be used for throwing an error on unsupported or invalid relocation types, and perhaps in certain cases, for reporting when a relocation is not satisfiable.
2014-02-23make the x32 port use the correct ld-musl-x32.path filenameRich Felker1-1/+1
previously it was wrongly using the x86_64 one, precluding having both x32 and x86_64 libs present on the same system.
2014-02-23import vanilla x86_64 code as x32rofl0r1-0/+46