History log of /seL4-camkes-master/projects/musllibc/arch/x86_64/reloc.h
Revision Date Author Comments
# de8621ca 16-Aug-2015 Adrian Danis <Adrian.Danis@nicta.com.au>

Support a seL4 x86_64 build


# 12b0b7d8 17-Sep-2015 Rich Felker <dalias@aerifal.cx>

new dlstart stage-2 chaining for x86_64 and x32


# f3ddd173 13-Apr-2015 Rich Felker <dalias@aerifal.cx>

dynamic linker bootstrap overhaul

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.


# 39201d07 19-Jun-2014 Rich Felker <dalias@aerifal.cx>

add tlsdesc support for x86_64


# adf94c19 18-Jun-2014 Rich Felker <dalias@aerifal.cx>

refactor to remove arch-specific relocation code from dynamic linker

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.


# bfa09700 16-Jun-2014 Rich Felker <dalias@aerifal.cx>

dynamic linker: permit error returns from arch-specific reloc function

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.


# f389c498 18-Jul-2013 Rich Felker <dalias@aerifal.cx>

make the dynamic linker find its path file relative to its own location

prior to this change, using a non-default syslibdir was impractical on
systems where the ordinary library paths contain musl-incompatible
library files. the file containing search paths was always taken from
/etc, which would either correspond to a system-wide musl
installation, or fail to exist at all, resulting in searching of the
default library path.

the new search strategy is safe even for suid programs because the
pathname used comes from the PT_INTERP header of the program being
run, rather than any external input.

as part of this change, I have also begun differentiating the names of
arch variants that differ by endianness or floating point calling
convention. the corresponding changes in the build system and and gcc
wrapper script (to use an alternate dynamic linker name) for these
configurations have not yet been made.


# 99a2af6f 04-Oct-2012 Rich Felker <dalias@aerifal.cx>

fix incorrect TLS reloc macro names in x86_64 reloc.h


# 9c74856a 04-Oct-2012 Rich Felker <dalias@aerifal.cx>

dynamic-linked TLS support for everything but dlopen'd libs

currently, only i386 is tested. x86_64 and arm should probably work.
the necessary relocation types for mips and microblaze have not been
added because I don't understand how they're supposed to work, and I'm
not even sure if it's defined yet on microblaze. I may be able to
reverse engineer the requirements out of gcc/binutils output.


# 32de61e8 25-Jun-2011 Rich Felker <dalias@aerifal.cx>

fix some symbol resolution issues in dynamic linker

1. search was wrongly beginning with lib itself rather than dso head
2. inconsistent resolution of function pointers for functions in plt


# 568b8075 24-Jun-2011 Rich Felker <dalias@aerifal.cx>

proper path searching for dynamic linker

first, use $LD_LIBRARY_PATH unless suid. if that fails, read path from
/etc/ld-musl-$ARCH.path and fallback to a builtin default.


# 51e2d831 18-Jun-2011 Rich Felker <dalias@aerifal.cx>

experimental dynamic linker!

some notes:
- library search path is hard coded
- x86_64 code is untested and may not work
- dlopen/dlsym is not yet implemented
- relocations in read-only memory won't work