summaryrefslogtreecommitdiff
path: root/ldso/ldso/x86_64
AgeCommit message (Collapse)Author
2017-06-21remove the not useful disclaimerWaldemar Brodkorb
2017-06-21remove editor hints for viWaldemar Brodkorb
2017-01-14ldso: do not resolve relocations for debug, dig them up when debuggingWaldemar Brodkorb
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
2012-11-18Replace FSF snail mail address with URLsMike Frysinger
This matches a similar change made to glibc. No functional changes here. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-29ldso: mark _start hiddenMike Frysinger
There's no need to export this symbol, so mark them all hidden. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-14ldso: silence harmless warning for !LDSO_PRELINK_SUPPORTBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-06ldso: merge duplicate dl-syscalls.h code to common headerMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-01ldso: x86_64: delete unused variableMike Frysinger
gcc informed me: In file included from ldso/ldso/ldso.c:46:0: ldso/ldso/x86_64/elfinterp.c: In function '_dl_do_lazy_reloc': ldso/ldso/x86_64/elfinterp.c:294:6: warning: variable 'symtab_index' set but not used [-Wunused-but-set-variable] Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-01ldso: constify reloc array itselfMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-07x86_64/elfinterp.c: Protect missed debug _dl_printf with __SUPPORT_LD_DEBUG__Khem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-06-24Merge remote-tracking branch 'origin/master' into prelinkCarmelo Amoroso
* origin/master: (61 commits) fts: fix warning due to old-style function definition ldso_tls: fix compiler warning due to missing cast resolv: fix bug in res_init with ipv6 nameservers config: Fix passing defconfig args buildsys: pt-initfini.s depends on uClibc_config.h libdl: search for ELF_RTYPE_CLASS_DLSYM in dlsym() resolv: try next server on SERVFAIL getaddrinfo: allow numeric service without any hints bump version to 0.9.33-git nptl/pthread: Correct path for machine specific pt-initfini.c ctor/dtor nptl: Fix init and fini function compilation Rules.mak: Rearrange appending UCLIBC_EXTRA_CFLAGS to CFLAGS ARM: remove EABI/OABI selection ARM: detect BX availibility at build time ARM: #include <bits/arm_asm.h> where __USE_BX__ is used ARM: transform the EABI/OABI choice into a boolean ARM: remove sub-arch/variants selection from menuconfig ARM: introduce blind options to select & force THUMB mode ARM: reorder "Use BX" option Fix __libc_epoll_pwait compile failure on x86 ... Conflicts: ldso/libdl/libdl.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-05-11x86_64: add TODO for R_X86_64_RELATIVEBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-04Merge remote-tracking branch 'origin/master' into prelinkCarmelo Amoroso
* origin/master: (32 commits) libubacktrace: fix backtrace support on arm-eabi, which needs libgcc_eh linked too getaddrinfo.c: fix incorrect check for ERANGE from gethostbyaddr_r getaddrinfo.c: improve code readability. No functional changes string: remove unused variable x86_64: silence warning if !TLS buildsys: prettify ssp.c handling madvise is LINUX_SPECIFIC test_nptl: fix expected result for tst-cputimer[123] test_nptl: fix expected result for tst-clock2 test buildsys: make $(LOCAL_INSTALL_PATH) phony ether_aton: reject invalid input tests: disable ether tests if !HAS_SOCKET inet: add ether_aton testcase sysconf: clock_getres depends on HAS_REALTIME __rt_sigwaitinfo: depends on HAS_REALTIME buildsys: minor fixes in Makefile.arch for C6X buildsys: minor fixes in Makefile.arch for microblaze libubacktrace: enabled for all archs indeed. sparc: don't access fp registers when configured for no fpu libubacktrace: generic implementation based dwarf ... Conflicts: ldso/ldso/dl-elf.c ldso/ldso/mips/elfinterp.c ldso/ldso/x86_64/elfinterp.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-05-03x86_64: silence warning if !TLSBernhard Reutner-Fischer
TODO: fix all other arches Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-04-06Merge remote-tracking branch 'origin/master' into prelinkCarmelo Amoroso
* origin/master: (137 commits) utils/ldd: Check for returned pointer from strrchr not the value it holds cris: add provide arch-specific vfork implementation lutimes.c, stubs.c: fix compiling lutimes, if __NR_utimensat is not defined bump version to 0.9.32-rc3-git release 0.9.32-rc3 memalign: include sys/param.h for MAX arm/bits/atomic.h: Include common/bit/atomic.h for thumb1 wctype.h: fix libc_hidden_proto for iswupper and add it for iswspace add libc_hidden_proto for wcs[n]casecmp_l really fix missing __libc_drand48_data Revert "missing prototype of __libc_drand48_data fixed" missing prototype of __libc_drand48_data fixed time.c, time.h: remove unused hidden strftime/strptime nanosleep.c: remove duplicated libc_hidden_proto ctype.c, ctype.h: remove commented parts that were banned for removal after 0.9.31 _wctype.c, wctype.h: remove unused isw* and wctype_l hidden functions time.c, wchar.h: remove unused hidden wcsftime str[n]casecmp.c: fix hidden usage remove unused hidden functions frv/memset.S: add missing libc_hidden_def ... Conflicts: ldso/ldso/ldso.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-03-03initialize tls_tpnt to NULL on all archsPeter S. Mazinger
Initialize tls_tpnt to NULL on all archs instead of 0. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-01-21Merge remote branch 'origin/master' into prelinkCarmelo Amoroso
* origin/master: bump version to 0.9.32-rc2-git release 0.9.32-rc2 nptl: Fix __USER_LABEL_PREFIX__ concatenatio nptl: fix start_thread() for _STACK_GROWS_UP ldso: get rid of _dl_lookup_hash Add protected symbols support for all architectures Revert "ldso/arm: Correct protected symbol resolution" Revert "ldso_sh: add support for protected symbols to SH" Revert "ldso/i386: support protected symbols" cris: Fix build issues syslog: fix 'everyone logs with user facility' __psfs_parse_spec: always use long int for %p buildsys: headers target should not depend on sysnum.h buildsys: fix make release target nptl: get rid of the last preprocessor warning when __ASSUME_TGKILL is not defined remove uClibc_ctype.h if !LOCALE Revert "Makefile.in: Add header to 'all' target" nptl: get rid of preprocessor warning when __ASSUME_TGKILL is not defined Conflicts: ldso/include/dl-hash.h ldso/ldso/arm/elfinterp.c ldso/ldso/avr32/elfinterp.c ldso/ldso/bfin/elfinterp.c ldso/ldso/cris/elfinterp.c ldso/ldso/dl-hash.c ldso/ldso/i386/elfinterp.c ldso/ldso/m68k/elfinterp.c ldso/ldso/mips/elfinterp.c ldso/ldso/powerpc/elfinterp.c ldso/ldso/sh/elfinterp.c ldso/ldso/sh64/elfinterp.c ldso/ldso/sparc/elfinterp.c ldso/ldso/x86_64/elfinterp.c ldso/ldso/xtensa/elfinterp.c ldso/libdl/libdl.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-01-20Add protected symbols support for all architecturesSalvatore Cro
Protected symbols are global symbols for which interposition is not allowed. We manage them in generic _dl_lookup_hash function. To handle protected symbols we need to get a reference to the module that defines the symbol itself. So we pass a new parameter 'struct symbol_ref' to the __dl_lookup_hash that is defined as below: struct symbol_ref { const ElfW(Sym) *sym; struct elf_resolve *tpnt; }; The tpnt field is used as an ouput parameter and refers to the module which defines the protected symbol. Further it can be used as output parameter for TLS relocations and FDPIC case. The sym field is instead used as an input parameter to detect the visibility of the symbol we are looking-up. In this way we get rid of different signatures for _dl_lookup_hash, allowing to remove the _dl_find_hash wrapper. This new structure is also suitable for prelink integration. Signed-off-by: Salvatore Cro <salvatore.cro@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-10-11ldso: Extend prelink support for all other achitecturesFilippo Arcidiacono
Update Arch specific part of the dynamic linker to the latest cahnges required by prelink: - Use _dl_loaded_modules->scope as global symbol scope - Pass the sym argument (or NULL) to the _dl_find_hash - Update _dl_parse, _dl_do_reloc, _dl_do_lazy_reloc and _dl_parse_relocation_information to reflect the change of the scope argument's type - Add the call to _dl_debug_lookup used for trace prelinking. Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-09-07ldso: Fix compilation for x86_64 without TLS support.Will Newton
Add an #ifdef to avoid using TLS structures when TLS is not enabled. Signed-off-by: Will Newton <will.newton@imgtec.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-05-05ldso: fix x86_64 R_X86_64_TPOFF64 and R_X86_64_DTPOFF64 relocationsRoman I Khimov
R_X86_64_TPOFF64 revealed by trivial testcase: =================================================================== #include <stdio.h> #include <errno.h> int main() { void *a = &errno; printf("errno addr: %llx\n", a); __asm__("movq errno@gottpoff(%%rip), %0;\n" "add %%fs:0x0,%0;" : "=r"(a) ); printf("got errno addr: %llx\n", a); return 0; } =================================================================== The addresses application got with R_X86_64_TPOFF64 was different than the once libc internal __errno_location returned. R_X86_64_DTPOFF64 testcase is even simpler than that: =================================================================== #include <stdio.h> #include <errno.h> #include <netdb.h> #undef h_errno extern __thread int h_errno; int main() { printf("h_errno addr: %llx\n", &h_errno); printf("__h_errno_location addr: %llx\n", __h_errno_location()); return 0; } =================================================================== but needs to be linked with "-lpthread". This way we've got h_errno relocation via R_X86_64_TPOFF64 in application and h_errno relocation via R_X86_64_DTPOFF64 in libpthread which has its own __h_errno_location() (probably we can kill it later?). And addresses were different again. The problem is that both relocations resolve symbols in external modules and thus should use symbol_addr instead of sym->st_value. Signed-off-by: Roman I Khimov <khimov@altell.ru> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-02-19x86_64: finish up tls reloc support in ldsoAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-10-14ldso: fixup all the rest of the calls to _dl_find_hashAustin Foxley
With TLS _dl_find_hash grew an extra param. These archs don't have TLS reloc support yet, but they do need to compile without it. Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-01-28Remove check for the relocation type check in the resolver,Carmelo Amoroso
from all archs. Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
2009-01-04ldso/ldso/dl-startup.c: make _dl_elf_main static; remove one dead variable.Denis Vlasenko
ldso/ldso/avr32/dl-startup.h: remove superfluous definition of START() macro. ldso/ldso/*/dl-startup.h: fix a typo in comment text data bss dec hex filename - 16752 244 92 17088 42c0 lib/ld-uClibc.so + 16709 240 92 17041 4291 lib/ld-uClibc.so
2008-12-03- Use runtime pagesize (Jeremy Kerr)Bernhard Reutner-Fischer
Some powerpc machines can support 64k pages, enabled by the CONFIG_64K_PAGES option in linux. However, the uClibc dynamic loader won't currently work on these machines, as it uses hard-coded values (PAGE_ALIGN, ADDR_ALIGN and OFFS_ALIGN) in the ldso architecture-specific headers. When running on a kernel with 64k pages, ld.so tries to mmap with 4k-aligned addresses, rather than 64k, so mmap fails with -EINVAL. When booting a 64k machine with a uClibc dynamic linker, init fails with: /init:500: can't map '/lib/libc.so.0' /init:500: can't map '/lib/libc.so.0' /init:500: can't map '/lib/libc.so.0' /init: can't load library 'libc.so.0' Kernel panic - not syncing: Attempted to kill init! This change allows ld.so determine these alignment masks at runtime, rather than compile-time. Since we have the _dl_pagesize variable available, we can use that to generate the appropriate masks. Since almost all of the architectures can use the common definitions for the _ALIGN macros, we can consolidate them all in ldso.h, and override in the sysdep headers where necessary (ie, mips). This allows me to start a uClibc-based root fs on a 64k machine. Signed-off-by: Jeremy Kerr <jk at ozlabs org>
2007-07-29Remove stray code alignment (.align 16 and .align 4 directives)Denis Vlasenko
from i386 and x86_64.
2006-06-19eat extraneous ; and insert some whitespace where it belongsMike Frysinger
2006-03-08macro out the /10 operation so arches can have their own versions ... and ↵Mike Frysinger
create some default macros for do_rem/do_div_10 so we dont duplicate the samething in many arch header files
2006-01-24- use keywords __asm__ and __inline__ c99.Bernhard Reutner-Fischer
2006-01-19move a bunch of arch-specific checks out of common files and into an arch ↵Mike Frysinger
specific header file to make porting/updates a lot easier
2006-01-17since just about everyone uses return _dl_elf_main for START() now, make it ↵Mike Frysinger
the default
2006-01-10support a few more relocation typesMike Frysinger
2006-01-09list more relocsMike Frysinger
2006-01-08other half of lazy relocation from glibc dl-trampolineMike Frysinger
2006-01-08patch by Jocke to fix up lazy relocationMike Frysinger
2005-11-21Partly undo earlier patch on vapier's requestPeter S. Mazinger
2005-11-21Guard debug_sym/debug_reloc, make sure elfinterp.c sees __SUPPORT_LD_DEBUG__Peter S. Mazinger
2005-09-21__set_errno must be redefined after #include "sys/syscall.h".Joakim Tjernlund
syscall.h should not have it's own version of __set_errno, instead syscall.h should include errno.h(see powerpc) since errno handling depends on threads/no threads. I leave the the fixing of syscall.h since there might be some smaller compile problems.
2005-08-18use generic ELF wrappersMike Frysinger
2005-08-15move arch-specific checks out of shared dl-syscall.h and into arch-specific ↵Mike Frysinger
dl-syscalls.h
2005-07-14a [mostly working] elfinterp.c based on i386 / glibcMike Frysinger
2005-07-14remove unused instructionsMike Frysinger
2005-07-11dont use void* when we know the type of pointer we wantMike Frysinger
2005-07-08err, x86_64 is RELA, not RELMike Frysinger
2005-07-08fix GET_ARGV() so it pulls out the argc/argv/envp properlyMike Frysinger
2005-07-07remove broken asm code in elf_machine_dynamic() and just do it the glibc way ↵Mike Frysinger
(since it works)
2005-07-07rip out all the duplicated debug code and move into a shared fileMike Frysinger
2005-07-06import start of ldso based on glibcMike Frysinger