[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/19969] New: ld fails to detect run-time relocation overflow
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/19969] New: ld fails to detect run-time relocation overflow |
Date: |
Tue, 19 Apr 2016 23:19:42 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=19969
Bug ID: 19969
Summary: ld fails to detect run-time relocation overflow
Product: binutils
Version: 2.27 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: hjl.tools at gmail dot com
Target Milestone: ---
Target: x86-64
address@hidden error-1]$ cat y.c
int foo = -1;
address@hidden error-1]$ cat bar.c
extern int * get_foo_p (void);
int
main (void)
{
int *p = get_foo_p ();
if (*p != -1)
__builtin_abort ();
return 0;
}
address@hidden error-1]$ cat x.S
.text
.globl get_foo_p
.type get_foo_p, @function
get_foo_p:
movl foo_p(%rip), %eax
ret
.size get_foo_p, .-get_foo_p
.globl foo_p
.data
.align 4
.type foo_p, @object
.size foo_p, 4
foo_p:
.long foo
.section .note.GNU-stack,"",@progbits
address@hidden error-1]$ make
gcc -g -fPIC -c -o y.o y.c
ld -shared -o y.so y.o
gcc -g -c -o x.o x.S
gcc -g -c -o bar.o bar.c
gcc -o x x.o bar.o y.so -Wl,-R,.
./x
./x: Symbol `foo' causes overflow in R_X86_64_32 relocation
Makefile:12: recipe for target 'all' failed
make: *** [all] Segmentation fault
address@hidden error-1]$
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/19969] New: ld fails to detect run-time relocation overflow,
hjl.tools at gmail dot com <=