summaryrefslogtreecommitdiffstats
path: root/ldso
Commit message (Collapse)AuthorAgeFilesLines
...
* s/___brk_addr/__curbrk/gEric Andersen2004-07-301-1/+1
| | | | | | | | Some utilities, such as valgrind, have a legitimate reason to know the address of the current brk. Since we know such utils will peek under our skirt, we might as well give them what they expect and not use a gratuitously different symbol name. -Erik
* Teach libdl to use normal libc symbols whenever possible, i.e. mallocEric Andersen2004-07-309-110/+90
| | | | | rather than _dl_malloc, fprintf rather than _dl_printf, etc. -Erik
* Whitespace cleanupEric Andersen2004-07-307-48/+22
|
* Fix screwed up indentingEric Andersen2004-07-301-51/+51
|
* Revert this stuff for nowEric Andersen2004-07-163-48/+9
|
* Sigh. I got things working this morning, then checked stuff in from the wrongEric Andersen2004-07-145-21/+20
| | | | | tree. Bad boy, No doughnut. -Erik
* Based on a patch from Alexandre Oliva, make sure _dl_malloc returns a nicelyEric Andersen2004-07-145-14/+54
| | | | aligned pointer that may be aligned up to page_size. Also add _dl_free,
* Joakim Tjernlund writes:Eric Andersen2004-06-275-54/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi yet again :) in dl-startup.c when performing boot strap relocation the following test exists to make sure that only "_dl_" symbols are relocated: /* We only do a partial dynamic linking right now. The user is not supposed to define any symbols that start with a '_dl', so we can do this with confidence. */ if (!symname || !_dl_symbol(symname)) { continue; } However on PPC(and the other archs as well I suspect) all symbols are "_dl_" symbols so the test is never true. The test can be removed and the whole loop simplified(smaller). This also makes it possible to simplify elfinterp.c This remove the scanning of ldso.so relocs, making relocation faster. I have tested this on PPC and it works well. Do you think this optimization will work for the other arches as well? I can't see why not. Jocke * Tested on x86, arm, mipsel, and powerpc by Erik and works nicely -Erik
* Disable support for R_ARM_PC24, just like R_PPC_REL24 these shouldEric Andersen2004-06-241-0/+7
| | | | only occur when shared libs are not compiled with -fPIC
* Let dl-string.h include dl-sysdep.h, since it has proper include guardsEric Andersen2004-06-201-1/+1
|
* Whine about R_PPC_REL24 relocations, and tell people to compileEric Andersen2004-06-201-10/+15
| | | | shared libraries with -fPIC
* Joakim Tjernlund writes:Eric Andersen2004-06-191-6/+5
| | | | | Make old weak symbol handling work, if someone wants to enable it.
* Joakim Tjernlund writes:Eric Andersen2004-06-191-0/+2
| | | | | Since MIPS don't have COPY relocs it seems apropiate to define DL_NO_COPY_RELOCS. This will optimize dl_find_hash somewhat.
* Joakim Tjernlund writes:Eric Andersen2004-06-191-1/+1
| | | | | Glibc does not use COPY class for SHN_COMMOM in MIPS. Make uClibc ldso the same.
* Bradley D. LaRonde writes:Eric Andersen2004-06-191-0/+2
| | | | | | | | | | | | 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.
* Jakub Bogusz from pld-linux dot org writes:Eric Andersen2004-06-126-16/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Alexandre Oliva writes:Eric Andersen2004-05-142-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here are a number of minor changes to FR-V-specific bits of the uClibc port: - I've adjusted the definition of _dl_mmap to cope with the fact that there will be a definition for an mmap2-only system. - We don't have COPY relocs, so optimize the copy reloc-related code away. - Change the page size to 16KiB, to match the ABI spec, and not a stale value I'd copied from a linker config file. Oops. - Fix error handling in clone and vfork; parts of the changes by David Howells <dhowells@redhat.com> - Rearrange includes in crtreloc.c. - Change the API of __syscall_error, to reduce code size. - Improve __syscall_return in terms of code size, so as to enable tail-calling of __syscall_error, at least within libc. Ideally, __syscall_error should be hidden within libc.so, but this didn't work because of libdl. I haven't looked into why, and figured I'd leave it visible for now. - Rename enumerators and macros in sys/ucontext.h to reduce namespace pollution.
* update libdl so it also groks the new _dl_errnoEric Andersen2004-05-131-0/+2
|
* Bradley D. LaRonde writes:Eric Andersen2004-05-131-1/+2
| | | | | | | Oops, this adds the page alignment offset to the mprotected size. Regards, Brad
* Patch from Bradley D. LaRonde:Eric Andersen2004-05-121-4/+9
| | | | | | | ld.so mprotect rwx .dyanmic segment for mips DT_DEBUG Allow writing debug_addr into the .dynamic segment. Even though the program header is marked RWE, the kernel gives it to us rx.
* Add a local '_dl_errno' to be used by syscalls in ldso, allowingEric Andersen2004-05-1211-59/+62
| | | | useful syscall failure diagnostics.
* As noticed by the sharp eyed Joakim Tjernlund, I stupidlyEric Andersen2004-05-112-2/+2
| | | | hard coded 4096 instead of PAGE_SIZE. Because I'm an idiot.
* make certain that getpagesize() returns correct the value for mipsEric Andersen2004-05-114-15/+22
| | | | by extracting the value from the ELF header.
* Bradley D. LaRonde, brad at laronde dot org writes:Eric Andersen2004-05-111-1/+1
| | | | | | | If I change that ELF_RTYPE_CLASS_COPY to ELF_RTYPE_CLASS_PLT to tell _dl_find_hash to ignore stubs when resolving undefined functions without stubs, the dlopen tests all pass. dlopen gets a pointer to the libc.so malloc instead of a pointer to the libpthread malloc stub. Yay! :-)
* Save r0 before modifying it.Tobias Anderberg2004-05-101-2/+4
|
* Cope with gcc 3.4's more aggressive persuit of attribute unusedEric Andersen2004-04-2010-22/+20
|
* Based on a patch from Alexandre Oliva, allow uClibc to compileEric Andersen2004-03-191-1/+16
| | | | with __NR_mmap is not available (i.e. only __NR_mmap2)
* Look in /usr/X11R6/lib as wellEric Andersen2004-03-181-1/+1
|
* Joakim Tjernlund writes:Eric Andersen2004-03-181-8/+4
| | | | | | | | | | Hi I just noticed that gcc has an "b"(Address base register) operand that will match all "r" registers but r0. It is a better fix then adding r0 to the clobber list. What do you think?
* Sigh. I switched the values...Eric Andersen2004-02-201-2/+2
|
* Per discussion with Joakim Tjernlund, all the horrible weak declarations junkEric Andersen2004-02-201-78/+96
| | | | | | in libdl pointing to the local 'foobar' function is garbage. This cleans all that up and makes the code much less horrible. Now it is only really really ugly (which is a marked improvement),
* Patch from Joakim Tjernlund:Eric Andersen2004-02-201-22/+13
| | | | white space cleanup and optimize the inner loop in dl_find_hash.
* ___brk_addr and __environ are not functions. Finding the brokenEric Andersen2004-02-201-2/+2
| | | | | | lookup on 'atexit' got me excited and I started fixing the same problem elsewhere. Except these were correct as-was, and were not a problem....
* Slightly cleaner formattingEric Andersen2004-02-201-4/+4
|
* Patch by Joakim Tjernlund <joakim.tjernlund@lumentis.se>, which gotManuel Novoa III2004-02-201-1/+1
| | | | | mips mostly working. From there, I tracked the bash failure to a bad _dl_atexit address and Erik took it from there.
* When doing symbol lookups on functionsEric Andersen2004-02-201-4/+4
|
* Minor change to better match recent changes to other archesEric Andersen2004-02-182-61/+63
|
* Alexandre Oliva writes:Eric Andersen2004-02-185-0/+1474
| | | | | | | | | | | | | | | | | | | | This patch adds code to uClibc to support a new ABI designed for the FR-V architecture, that enables text segments of executables and shared libraries to be shared by multiple processes on an OS such as uClinux, that can run on FR-V processors without an MMU. Patches for binutils and GCC have just been posted in the corresponding mailing lists. The binutils patch was approved, but there's one additional patch pending review, that I posted this week. An updated GCC patch will be posted to gcc-patches@gcc.gnu.org as soon as I complete testing (I used a known-good compiler to test the uClibc patch below). Since the existing dynamic loader code didn't support independent relocation of segments, it required changes that were somewhat extensive. I've added a number of new machine-specific macros to try to keep the platform and ABI-specific details outside the generic code. I hope this is not a problem.
* Fixup support for gcc 2.95Eric Andersen2004-02-171-15/+15
|
* Seperate out the startup stuff from the non-startup stuff.Eric Andersen2004-02-1718-694/+696
| | | | | Begin converting some big ugly macros to inline functions instead
* Kill off an arm specific hack, that fostered three other arch specificEric Andersen2004-02-172-13/+5
| | | | hacks. Just check for the elf magic string one byte at a time....
* When doing _dl_mmap to obtain a bit of anonymous memory, use a much moreEric Andersen2004-02-172-4/+4
| | | | | sensible -1 fd, rather than pretending to work off of fd 0, which makes absolutely no sense.
* Do not duplicate stuff from ldso.hEric Andersen2004-02-171-12/+0
|
* Provide the ldso syscalls and string funcs earlier in the listEric Andersen2004-02-171-3/+4
|
* No point in including debug info for ldso. It isn't helpful to do soEric Andersen2004-02-141-5/+4
| | | | since gdb can't do anything for us.
* Atsushi Nemoto writes:Eric Andersen2004-02-141-2/+3
| | | | | Also, if you are to enable SUPPORT_LD_DEBUG on MIPS, I think this patch is needed too.
* Fix this as should have been done a long time ago...Manuel Novoa III2004-02-141-0/+3
|
* Give gcc branch prediction some hits on obviously unlikely branchesEric Andersen2004-02-149-30/+31
|
* Joakim Tjernlund writes:Eric Andersen2004-02-1425-123/+177
| | | | | | | | | | | | | | | | | | Hi it is me again. This is the latest ldso patch. the NEW weak symbol handling works now with a little special handling in _dl_find_hash(). You get to chose if you want the new or old handling :) There was 2 missing _dl_check_if_named_library_is_loaded() calls in _dlopen(). I then disabled the _dl_check_if_named_library_is_loaded() in dl-elf.c since it is rendundant. Question, why does some _dl_linux_resolver(), like i386, have 2 calls to _dl_find_hash()? I think that is wrong, isn't it? I really hope you can check this out soon ...
* Based on a problem report and patch from Florian Schirmer, fix a compileEric Andersen2004-02-122-4/+4
| | | | | | problem with mips -- contrary to my expectation gcc on mips _always_ defines __PIC__ which breaks the assumption inherent in my code. This should fix things up.