summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-09-17 09:11:53 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-09-17 09:11:53 +0000
commitd88a7c90cc5b4abc9bc54f966f6be0e9eba3d465 (patch)
treef9d3c3750b85c33ab3473bb3ca2d8f286c61201e
parent68465f9e53905daca3ea10015e7bb405042a9319 (diff)
Don't allow undefined global symbols to pass(all archs needs fixing,
but powerpc). 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. Move handling of R_386_COPY back into _dl_do_reloc(all archs should do this). Adjust the first argument to _dl_memcpy as it looks wrong to have symtab[symtab_index].st_value as destination for the mem copy.
-rw-r--r--ldso/ldso/i386/elfinterp.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/ldso/ldso/i386/elfinterp.c b/ldso/ldso/i386/elfinterp.c
index 9678de93b..c9eb0b6c5 100644
--- a/ldso/ldso/i386/elfinterp.c
+++ b/ldso/ldso/i386/elfinterp.c
@@ -258,14 +258,10 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
* have been intentional. We should not be linking local symbols
* here, so all bases should be covered.
*/
-
- if (!symbol_addr && ELF32_ST_BIND(symtab[symtab_index].st_info) == STB_GLOBAL) {
-#if defined (__SUPPORT_LD_DEBUG__)
- _dl_dprintf(2, "\tglobal symbol '%s' already defined in '%s', rel type: %s\n",
- symname, tpnt->libname, _dl_reltypes(reloc_type));
-#endif
- return 0;
- }
+ if (unlikely(!symbol_addr && ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK)) {
+ _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname);
+ _dl_exit(1);
+ };
}
#if defined (__SUPPORT_LD_DEBUG__)
@@ -288,7 +284,15 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
*reloc_addr += (unsigned long) tpnt->loadaddr;
break;
case R_386_COPY:
- /* handled later on */
+ if (symbol_addr) {
+#if defined (__SUPPORT_LD_DEBUG__)
+ if(_dl_debug_move)
+ _dl_dprintf(_dl_debug_file,"\n%s move %x bytes from %x to %x",
+ symname, symtab[symtab_index].st_size,
+ symbol_addr, reloc_addr);
+#endif
+ _dl_memcpy((char *) reloc_addr, (char *) symbol_addr, symtab[symtab_index].st_size);
+ }
break;
default:
return -1; /*call _dl_exit(1) */
@@ -397,6 +401,8 @@ int _dl_parse_relocation_information(struct dyn_elf *rpnt,
int _dl_parse_copy_information(struct dyn_elf *rpnt,
unsigned long rel_addr, unsigned long rel_size)
{
- return _dl_parse(rpnt->dyn, rpnt->next, rel_addr, rel_size, _dl_do_copy_reloc);
+ return 0;
+ /* just disable for now, remove when we know that it works */
+ /* return _dl_parse(rpnt->dyn, rpnt->next, rel_addr, rel_size, _dl_do_copy_reloc); */
}