Age | Commit message (Collapse) | Author |
|
This drops __signed, __volatile, and __const. Only the latter was
used in the code base, and for uClibc, not consistently. Much of
the code used plain "const" which meant "__const" was useless.
Really, the point of this is to stay in sync with what glibc did.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Building with NPTL enabled and shared library support disabled we hit:
In file included from libpthread/nptl/sysdeps/generic/dl-tls.c:30:0:
./ldso/include/dl-elf.h: In function '__dl_parse_dynamic_info':
./ldso/include/dl-elf.h:173:20: error: 'RTLD_NODELETE' undeclared (first use in this function)
./ldso/include/dl-elf.h:173:20: note: each undeclared identifier is reported only once for each function it appears in
make: *** [libpthread/nptl/sysdeps/generic/dl-tls.os] Error 1
A previous commit (f26c5f6952ce9bf8edec9c1571c47addb1bcc442) touched
on a similar issue, but added the include to the incorrect location.
Reported-by: Christophe Lyon <christophe.lyon@st.com> [arm nommu]
Reported-by: Daniel Beecham <daniel@lunix.se> [static x86_64]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Add support for %p to _dl_dprintf for later corrections in debug messages.
Disable _dl_debug_file if LD debugging is not enabled and change it's use to 2.
The use of dprintf in elfinterp.c will spit out warnings, will be fixed in the
reworked ldso.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Include stddef.h instead of defining NULL
Adapt guard to file name.
Reorder includes a bit.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
dl-sysdep.h has to come before the fallbacks in dl-defs.h,
else the wrong macros are used.
While there adapt the guard to the file name.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
While there change the guard of the file
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
The guard is changed to allow to be used the file in libc as well.
Include string.h (although already included by ldso.h).
Guard the rest of the file according to config options.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
powerpc guard depends on the compiler options, __powerpc__ should
work all the time.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
This can't happen, __mips__ was already checked earlier
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Use the one from libc.
While there, remove unused _dl_strncmp() and superfluos static forward declarations.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
The existing DSBT support relies on the kernel to provide DSBT info
as part of the load maps passed to user space. The problem with this
approach is that the DSBT info is in the dynamic section, so the
kernel must access a userspace mapping of the dynamic section (or
separately read a copy for the kernel) in order to retrieve the
information needed by userspace.
This patch reworks the DSBT support to remove the reliance on DSBT
info coming from the kernel. Instead, ldso reads the info itself from
the dynamic section. One other benefit of this is that it allows the
existing kernel FDPIC loader to also load DSBT binaries.
Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
The fdpic support has been broken since the prelink support was added,
because it didn't take into account DL_LOADADDR_TYPE could be a different
type of ElfW(Addr).
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
The setup logic is duplicated, so unify it in a local func.
Mark the variable const while we're doing this, and add missing
ifdef protection to the header that declares it availability.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
The former is part of a standard (C99) while the latter is not.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
So application query if specified module is loaded or not with
dlopen.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
A few arches want pread() defined, so move it to common code.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
microblaze can either be with mmu or without
If with, use elf rather than flat, and support shared libs
Signed-off-by: Ryan Flux <ryan.flux@emsolutions.com.au>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
* 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>
|
|
Fix dladdr to correctly handle local function's address so backtrace_symbols
print only the function address for these function, instead of showing the name
of nearest one.
Indeed the dladdr walk through the hash table to find the nearest symbol, that
doesn't contain local symbols.
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
* 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>
|
|
We have a problem with DT_TEXTREL shared libraries on nommu machines.
The dynamic linker's strategy is to map the text segment read-only
first, then look for DT_TEXTREL, and use mprotect to change protections
if necessary. This fails on nommu, since a nommu kernel can decide to
share the memory for private read-only file mappings, and mprotect
doesn't (can't) do anything about this sharing. Existing nommu targets
apparently have no need for this, but on C6X, we may need to assign
library indices at run-time if no --dsbt-index option was passed to the
linker at build time.
Hence, the following patch, which instead of using mprotect, redoes the
mapping with PF_W set.
Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
|
|
* 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>
|
|
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
|
|
This adds support for DSBT ELF to ld.so. This uses loadmaps like FD-PIC.
Some code is added in ld.so to initialize the DSBT tables, and there's
also a new target macro FINISH_BOOTSTRAP_RELOC.
Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Aurelien Jacquiot <a-jacquiot@ti.com>
Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
|
|
Commit 33cb7f0b4 tried to add a small optimization for skipping unnecessary
.dynamic adjustments, but did so by referencing an opaque type. While this
works for non-fdpic targets (since the type can be cast to an integer), it
falls apart for fdpic targets where the type is actually a structure.
Since FDPIC can't support this optimization without walking a series of
linked structures, just skip it.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
* 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>
|
|
Now _dl_find_hash and _dl_lookup_hash are exactly the same, we can get rid
of the _dl_lookup_hash, reverting the _dl_find_hash from a wrapper of
_dl_lookup_hash to its original role.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
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>
|
|
Conflicts:
ldso/include/dl-hash.h
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
The warning was repeated for every .c file which is including
this header:
./ldso/include/dl-hash.h: In function '_dl_find_hash':
./ldso/include/dl-hash.h:150: warning: unused parameter 'tpntp'
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Added runtime prelink support to be able to run a prelinked
application; at process startup only the conflicts will be relocated.
This speed up the startup time.
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
Added support for the following tracing capabilities:
- LD_WARN to warn about undefined symbols during the lookup stage.
- LD_TRACE_PRELINKING to trace the needed libraries of the object
that we are prelinking.
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
Global symbol scope is implemented as a linked list of
local scope, that dynamically grows and shrinks when dlopen/
dlclose are called. Each local scope is implemented as an array
of pointer to struct elf_resolve.
This will help to detect conflict when LD_TRACE_PRELINKING option
will be implemented.
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
The dynamic linker can be run either indirectly through running some
dynamically linked program or library (in which case no command line options
to the dynamic linker can be passed and, in the ELF case, the dynamic linker
which is stored in the .interp section of the program is executed)
or directly by running:
/lib/ld-uClibc.so.* [OPTIONS] [PROGRAM [ARGUMENTS]]
Stand-alone execution is a prerequisite for adding prelink capabilities
to uClibc dynamic linker, as well useful for testing an updated version
of the dynamic linker without breaking the whole system.
Currently supported option:
--library-path PATH use given PATH instead of content of the environment
variable LD_LIBRARY_PATH
(Mandatory for prelinking)
Not supported options:
--list list all dependencies and how they are resolved
--verify verify that given object really is a dynamically linked
object we can handle
--inhibit-rpath LIST ignore RUNPATH and RPATH information in object names
in LIST
This feature can be enabled by setting LDSO_STANDALONE_SUPPORT=y
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
Honor the nodelete flags so we don't delete shared library if it's
sticky. This is useful for libpthread if it gets pulled in by a
dlopen'ed library.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
this was causing tls symbols to leak into non-tls builds
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|