This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug dynamic-link/14341] Dynamic linker crash when DT_JMPREL and DT_REL{,A} are not contiguous
- From: "mh-sourceware at glandium dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Tue, 10 Jul 2012 07:54:59 +0000
- Subject: [Bug dynamic-link/14341] Dynamic linker crash when DT_JMPREL and DT_REL{,A} are not contiguous
- Auto-submitted: auto-generated
- References: <bug-14341-131@http.sourceware.org/bugzilla/>
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.