This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/14341] Dynamic linker crash when DT_JMPREL and DT_REL{,A} are not contiguous


http://sourceware.org/bugzilla/show_bug.cgi?id=14341

--- Comment #5 from Mike Hommey <mh-sourceware at glandium dot org> 2012-07-10 07:54:59 UTC ---
Essentially, elfhack adds sections between .rela.dyn and .rela.plt. (.rel.dyn
and .rel.plt on x86)
Here is a small testcase:

$ cat > test.c <<EOF
#include <stdio.h>

static int __attribute__((section(".bar"))) bar = 0x12345678;

static const char foo[] = "foo";

int main() {
  printf("%s\n", foo);
  return 0;
}
EOF

$ cat > script <<EOF
SECTIONS
{
   .bar : { *(.bar) }
}
INSERT AFTER .rela.dyn;
EOF

$ gcc -o test test.c -fPIE -Wl,-T,script
$ LD_BIND_NOW=1 ./test
./test: error while loading shared libraries: unexpected reloc type 0x006008a0

(Some of the libraries Firefox opens are dlopened with RTLD_BIND_NOW, which
triggers the crash ; i figured when testing the above testcase)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]