Age | Commit message (Collapse) | Author |
|
create some default macros for do_rem/do_div_10 so we dont duplicate the samething in many arch header files
|
|
specific header file to make porting/updates a lot easier
|
|
the default
|
|
use r3 instead to pass _dl_fini.
|
|
|
|
|
|
http://uclibc.org/lists/uclibc/2005-October/012809.html
This will only fix powerpc. Should be easy to fix the other arches.
|
|
|
|
|
|
dl-syscalls.h
|
|
|
|
Note that every arch that wants to support standalone execution needs
to align its stack pointer in crtX since ldso will adjust the stack pointer
when adjusting argc and argv in standalone mode.
|
|
where possible. This will also make ldso smaller.
However the patch touches all archs and I have only tested PPC and x86.
|
|
should not break ABI.
Minor cleanup as well.
|
|
execution of ldso.
Added new asm for MIPS to be tested.
All arches should retest.
|
|
Add elf_machine_dynamic() and elf_machine_load_address() for
all archs. elf_machine_dynamic() replaces the #ifdef mess to
get at the GOT. elf_machine_load_address() is needed to execute
ldso directly, this is not complete yet.
I probably broke one or two archs(only tested PPC) so please
try and report problems. For a report to be useful you need
to enable __SUPPORT_LD_DEBUG_EARLY__ and __SUPPORT_LD_DEBUG__
|
|
relocs. All RELA arches can probably copy this. REL archs
will have to delete the "+ rpnt->r_addend" from the loop.
|
|
Andrew de Quincey, who has been most helpful getting this sorted
out, thanks. Thanks also to Peter Mazinger who did alot of testing.
Removed all traces of dl_parse_copy_information() since it is no longer used.
|
|
Remove definition of _dl_parse_copy_information() for powerpc.
Remaining archs can do the same.
Make debugging output of "relocation processing: xxx" a bit more sane.
|
|
|
|
|
|
but can be nonzero for JMP relocs as well.
All Rela arches need to do this, test and send a patch :)
Remove unneeded test in R_PPC_COPY.
|
|
If you are using buildroot and soft floating point, you may have to
rebuild the libm.so library, copy it to staging_dir/lib and rebuild
your application.
Cleanups as well.
|
|
"I fixed the _dl_parse_copy_information in the same way than for the
powerpc and it works fine for me.
You may luck at the patch for the powerpc/elfinterp.c, where I change
the paramter of a dl_dprintf statement. Now we use the same
parameters than for the relocation copy."
Arch mantainers, please do the same.
When all arches has been fixed, we can remove of _dl_parse_copy_information,
it is just a waste of CPU cycles.
|
|
Remove unused function parameter in ldso.
Remove echo option '-e' since it is not supported on Solaris.
|
|
|
|
is needed if ldso should use libcs malloc whenever possible.
Fix RTLD_LAZY propagation to RTLD_NOW relocation when requested by
libdl.
|
|
PPC32, SPARC32/64 and S390 includes the PLT in its RELA size. This caused ldso
to always do unlazy relocation of the JMPRELs. This patch fixes it.
|
|
This patch makes -fpic work for PCC and optimzes the relcation by moving the cache
flushing stuff to JMP relocs only. Actually PPCs ldso can only handle small
GOT tables(<=8192 entries)anyhow, so it makes little sense to compile PPC with -fPIC.
libuClibc shrunk from 340724 to 330780 bytes with -fpic.
|
|
|
|
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
|
|
shared libraries with -fPIC
|
|
useful syscall failure diagnostics.
|
|
|
|
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?
|
|
Begin converting some big ugly macros to inline functions
instead
|
|
|
|
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 ...
|
|
|
|
to be arch specific to work properly.
|
|
to make it easier to treat it specially while not bothering the
rest of the code with the same constraints.
|
|
I still don't have a good handle on why and when the different
scope values should be used.
|
|
> Not there yet, but the interfaces are much closer now...
> Heading to bed though, since its 5:30am. :-)
This works, but I discovered something "funny". For all
relocs but COPY you can use scope instead of scope->dyn->symbol_scope
and it is much faster to do that. Search for "Funny" in the patch
to see what I mean. Probably I probably broke something, please let me
know if it works for you too.
I think I am done with ldso now. Has been fun and I hope to
actually use uClibc/busybox soon in a project.
Ohh, there is one thing left, double sized PLT entries, but maybe these
aren't needed in uClibc?
Sweet dreams
Jocke
|
|
_dl_parse_lazy_relocation_information() and _dl_parse_copy_information()
so they are all consistant, allowing for future consolidation.
Trim some trailing whitespace as well.
|
|
Here is the cleaned up laze reloc patch.
Summary:
- Minor cleanup.
- disable the "if (finaladdr <= 0x01fffffc || finaladdr >= 0xfe000000)"
test since it almost never triggered.
- Optimized the lazy relocs handling.
Would be great if you could commit ASAP.
Jocke
|
|
|
|
Removed R_PPC_NONE and R_PPC_REL24 as these does not seem to be used.
Corrected R_PPC_ADDR32 and R_PPC_JMP_SLOT
|
|
|
|
Hi again
I have done some serious clenup of powerpc/elfinterp.c
- Make it look more like glibc.
- Performance modifictions.
- Fixed a few bugs in _dl_do_reloc(). These seem not to have affected
anything, but this how glibc do it.
Jocke
|
|
The current behavior of the powerpc boot1_arch.h seems somewhat broken.
Currently room is made on the stack pointer for the link register, but the link
register is never actually pushed onto it. glibc bears the following comments:
/* Call _dl_start with one parameter pointing at argc */
mr r3,r1
/* (we have to frob the stack pointer a bit to allow room for
_dl_start to save the link register). */
followed by the -16 add to r1. Despite the fact that r1 is modified, the link
register is never actually pushed onto r1, thus the adjustment is completely
superfluous.
There's two possible fixes for this, either saving the link register in the way
that glibc does, or getting rid of the r1 adjustment. As I'm not sure if saving
the link register will actually break the _dl_boot2 callin, both options will
probably want to be played with.
The following bit of inline assembly in the attached patch builds cleanly for
me with gcc 3.3 on darwin, but I'm not able to test it any further beyond that.
|