summaryrefslogtreecommitdiff
path: root/ldso/include/dl-string.h
AgeCommit message (Collapse)Author
2024-02-20Remove duplicate semicolonsMarcus Haehnel
While they are not a problem per-se they cause issues with some tooling (such as clang coverage) and are confusing to the reader.
2021-12-24Fix -Wundef related warningsYann Sionneau
Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>
2018-08-10rtld: Add FDPIC code for armChristophe Lyon
Add FDPIC dynamic relocations support, similar to what other FDPIC targets do. Lazy binding is implemented in a folllow-up patch. Disable the SEND* macros because they involve relocations to access constant strings that are unsupported by the existing arm version. Define DL_START, START, ARCH_NEEDS_BOOTSTRAP_RELOCS, DL_CHECK_LIB_TYPE similarly to what other FDPIC targets do. Define raise() because _dl_find_hash references __aeabi_uidivmod, which uses __aeabi_idiv0 which in turn references raise. * include/elf.h (R_ARM_FUNCDESC): Define. (R_ARM_FUNCDESC_VALUE): Define. * ldso/include/dl-string.h (SEND_STDERR, SEND_ADDRESS_STDERR) (SEND_NUMBER_STDERR): Define empty for __FDPIC__. * ldso/ldso/arm/dl-inlines.h: New file. * ldso/ldso/arm/dl-startup.h (PERFORM_BOOTSTRAP_RELOC): Fix type of load_addr. Fix handling of R_ARM_RELATIVE, add support for R_ARM_FUNCDESC_VALUE. (DL_START, START): Define for __FDPIC__. (raise): Define. * ldso/ldso/arm/dl-sysdep.h (ARCH_NEEDS_BOOTSTRAP_RELOCS): Define. (DL_CHECK_LIB_TYPE): Define. (elf_machine_type_class): Take into account FDPIC related relocations. (elf_machine_load_address): Support __FDPIC__. (elf_machine_relative): Likewise. * ldso/ldso/arm/elfinterp.c (_dl_linux_resolver): Dummy support for __FDPIC__, implemented in a later patch. (_dl_do_reloc): Fix reloc_adr computation for __FDPIC__, fix handling of local symbols. Fix handling of R_ARM_RELATIVE, add support for R_ARM_FUNCDESC_VALUE, R_ARM_FUNCDESC. * ldso/ldso/arm/resolve.S: Make _dl_linux_resolve hidden. * ldso/ldso/fdpic/dl-inlines.h (htab_delete): Declare. * libc/sysdeps/linux/arm/bits/elf-fdpic.h: New file, similar to bfin's. * libc/sysdeps/linux/arm/crtreloc.c: Likewise. * libc/sysdeps/linux/arm/find_exidx.c (__dl_addr_in_loadaddr) Define. (find_exidx_callback): Support __FDPIC__. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2017-06-21remove editor hints for viWaldemar Brodkorb
2015-06-10avoid some compiler warningsWaldemar Brodkorb
Patch seen here: http://lists.uclibc.org/pipermail/uclibc/2015-April/048892.html
2012-06-15dl-string.h: include dl-defs.h instead of dl-sysdep.hPeter S. Mazinger
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>
2012-06-15dl-string.h: change IS_IN_libdl guard to IS_IN_rtldPeter S. Mazinger
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>
2012-06-15dl-string.h: use __powerpc__ guard instead of powerpcPeter S. Mazinger
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>
2012-06-15dl-string.h: remove mips related guardPeter S. Mazinger
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>
2012-06-15libdl: no need for _dl_strstr in libdl, use strstrPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15libdl.c,dl-string.h: do not use inlined _dl_memset and others in libdlPeter S. Mazinger
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>
2011-10-06microblaze mmu/elf/shared lib supportRyan Flux
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>
2009-04-11sparc also needs CONSTANT_STRING_GOT_FIXUP for doing debug printing in ldsoaustinf
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-01-10simple optimizations and style fixes in dynamic loadingDenis Vlasenko
text data bss dec hex filename - 16709 240 92 17041 4291 lib/ld-uClibc.so + 16634 236 92 16962 4242 lib/ld-uClibc.so - 4602 344 4 4950 1356 lib/libdl-0.9.30-svn.so + 4571 328 4 4903 1327 lib/libdl-0.9.30-svn.so - 4602 344 4 4950 1356 lib/libdl.so + 4571 328 4 4903 1327 lib/libdl.so
2008-01-05Chris Zankel writes:Mike Frysinger
The following patches add support for the Xtensa processor architecture to uClibc. They are based on a recent SVN checkout (12/05/2007). The first patch (attached to this post) adds Xtensa support to various shared configuration and make files. The following patches then include the Xtensa specific files and directories. I welcome any feedback and would appreciate it if you could include the patches into the mainline tree. I am certainly committed to maintain the port. Bob Wilson was kind enough to review the patches. Some notes about the architecture: Xtensa is a configurable and extensible processor architecture developed by Tensilica. For more information, please visit: www.linux-xtensa.org.
2008-01-05whitespace only: fix indentationMike Frysinger
2007-11-16Added AVR32 support to uClibc. Signed-off-by: Hans-Christian Egtvedt ↵Carmelo Amoroso
<hcegtvedt@atmel.com>
2006-10-07Bernd Schmidt writes:Mike Frysinger
This introduces a new SEND_EARLY_STDERR macro that is to be used in dl-startup.c before ld.so is relocated. It is needed on Blackfin (and frv) FDPIC since we have to use special tricks to get the address of a string constant. EARLY_STDERR_SPECIAL gets defined on such a machine and prevents printing of debug strings inside the loop that relocates ld.so, since we can't decide which of the two variants to use.
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-31John Bowler writes in Bug 385:Mike Frysinger
in various places defined(__arm__) is used to protect/select code which is ARM specific, that code must also be selected for __thumb__ because __thumb__ is an ARM but __arm__ is not set...
2006-01-27use attribute_unused instead of hardcodedPeter S. Mazinger
2006-01-17cleanup whitespaceMike Frysinger
2005-11-23change to Lesser GPL 2.1 as pointed out by psmMike Frysinger
2005-11-22add some copyright infoMike Frysinger
2005-09-23I really really HATE gcc-4.1 and its whimsical inline rules."Steven J. Hill"
2005-08-09disable early debug code if the arch relies on certain values (like ↵Mike Frysinger
load_addr) which are computer later
2005-07-11make sure the SEND_NUMBER_STDERR macro doesnt modify the number given to itMike Frysinger
2005-07-08need _DEBUG macros for NUMBER tooMike Frysinger
2005-07-06need features.h for the misc attribute defines and uclibc featuresMike Frysinger
2005-07-02use new __always_inline defineMike Frysinger
2005-07-02use new __always_inline defineMike Frysinger
2005-06-30The function '_dl_memset' should always be inlined regardless of the"Steven J. Hill"
optimization level chosen. This allows uClibc to be compiled with the latest GCC-4.1.0. While tracking down the specific culprit causing the segmentation fault of the dynamic loader with GCC-4.1.0 I was able to force inlining of other functions such that I shaved 512 bytes off the size of the loader, yay. Also fixed warning in 'dl-hash.c'.
2005-06-25create some DEBUG macros for the ld debug earlyMike Frysinger
2005-06-25whitespace/syntax cleanupsMike Frysinger
2005-05-20Fix debug macros.Joakim Tjernlund
2005-04-13On some wierd arches (i.e. mips), none of the early debug stuffEric Andersen
works at all, so disable the whole lot.
2005-04-13Don't write out the terminating NULL charEric Andersen
2005-04-13Rework the dl-startup.c ldso early debugging macros to beEric Andersen
significantly less horrible
2004-12-11Partial commit of a patch from Alexandre Oliva:Eric Andersen
Here's an updated version of the patch I posted about a month ago. It leaves -nostdinc alone, and uses -print-file-name=include instead of -print-search-dirs to figure out where GCC's internal headers are. Please let me know whether there are any portions of this patch you'd like me to break into smaller pieces, to rework, or to give up trying to get into uClibc :-) Thanks,
2004-08-10Optimze _dl_memset() for PowerPC.Joakim Tjernlund
Other arches may also benefit from this iff it can do unaligned stores.
2004-08-10Forgot _dl_memcpy in previous checkin.Joakim Tjernlund
2004-08-10_dl_strlen,_dl_strcat,_dl_strcpy,_dl_strcmp,_dl_strncmp,Joakim Tjernlund
_dl_strchr,_dl_strrchr,_dl_strstr,_dl_memcmp: Optimize for archs which can do pre increment/decrement and load/store in one instruction.
2004-08-10_dl_get_last_path_component:Joakim Tjernlund
handle "" strings and optimze it. _dl_simple_ltoa,_dl_simple_ltoahex: Optimize for archs which can do pre increment/decrement and load/store in one instruction.
2004-06-19Bradley D. LaRonde writes:Eric Andersen
dl-string.h references do_rem, but do_rem is a #define in <arch>/dl-sysdep.h which is not included by dl-sysdep.h. This causes a problem in libdl: In file included from ../../ldso/include/ldso.h:27, from libdl.c:33: ../../ldso/include/dl-string.h: In function `_dl_simple_ltoa': ../../ldso/include/dl-string.h:216: warning: implicit declaration of function `do_rem' Include dl-sysdep.h in dl-string.h before using do_rem.
2004-06-12Jakub Bogusz from pld-linux dot org writes:Eric Andersen
Hello, I managed to get ldso (and thus shared linking to uClibc) to work on sparc (actually sparc64 kernel with 32-bit userspace), at least on simple "hello world" program (more complex ones not tested). Some notes on attached patch (against 0.9.26, would require some work to apply on current CVS - but I tested 0.9.26, not CVS): - ELF magic cannot be examined by _dl_strncmp so early, probably because of string constant, like on ppc/mips/sh (note that early SEND_STDERR still crashes when trying to do _dl_strlen - I suppose that string constants require relocation; but adding load_addr didn't help, just ELF header was displayed instead of crash) - mmap() is syscall6 like on ppc/mips/sh, not old i386 mmap() - for generic sparc (i.e. not sparcv8/sparcv9) gcc produces .udiv/.urem calls for unsigned integer / and % operators - so these operations must be avoided. I copied do_rem definition from arm header. But / and % are used also in _dl_simple_ltoa() and _dl_simple_ltoahex(); in ltoahex gcc optimizes it to shifts (but I think it's safer to use shifts explicitly, not rely on optimization...). I changed % in ltoa to do_rem, but as there was no do_div definition, I changed all "%d" specifiers to "%x" to avoid crashes (this changes wouldn't be needed if _dl_simple_ltoa() were fixed to not use division on sparc). - "#define SOLARIS_COMPATIBLE" in ld_sysdep.h broke ldso on Linux because of redefining _dl_linux_resolve only in some places (it was still referenced in INIT_GOT before redefinition). So _dl_linux_resolve redefinition should be moved before INIT_GOT definition or removed. - sparc64 kernel requires mmap() addresses to be aligned to 8192, not 4096, otherwise mmap() call failed - reloc_entry must be shifted by 10, not 12 (I found similar operation in glibc sources) Aside of sparc-specific fixes: - I moved some _dl_dprintf()s inside if(_dl_debug_*) conditions (to avoid debugging messages when LD_DEBUG is not defined) - it seems that there was possible off-by-one in ltoa and ltoahex? they are called with char[22] as 1st argument, and then '\0' is stored in local[22] (_before_ p decrementation)... or am I missing something? If not, fix is included in patch.
2004-02-10Rework file naming, aiming for at least a vague level of consistancyEric Andersen
2004-02-06Trim trailing whitespaceEric Andersen
2003-09-29Fix SUPPORT_LD_DEBUG_EARLY on powerpcEric Andersen
2003-08-19Phase one of my evil plan to clean up ld.so...Eric Andersen