bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/19567] Symbol_value::value doesn't support x32 overflow check


From: hjl.tools at gmail dot com
Subject: [Bug gold/19567] Symbol_value::value doesn't support x32 overflow check
Date: Sat, 06 Feb 2016 17:22:19 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=19567

--- Comment #11 from H.J. Lu <hjl.tools at gmail dot com> ---
Here is a testcase:

address@hidden pr18695]$ cat foo.S 
        .data
        .space 0x80000000
        .comm foo,4
address@hidden pr18695]$ cat main.c 
#include <stdio.h>

extern int foo;

int
main ()
{
  printf ("foo: %d\n", foo);
  foo = 1;
  printf ("foo: %d\n", foo);
  return 0;
}
address@hidden pr18695]$ make x
gcc -B./ -mx32 -fno-lto    -c -o foo.o foo.S
gcc -B./ -mx32 -fno-lto -g   -c -o main.o main.c
gcc -B./ -mx32 -fno-lto  -o x foo.o main.o
/usr/lib/gcc/x86_64-redhat-linux/5.3.1/x32/crtbegin.o: In function
`__do_global_dtors_aux':
crtstuff.c:(.text+0x72): relocation truncated to fit: R_X86_64_PC32 against
`.bss'
crtstuff.c:(.text+0x84): relocation truncated to fit: R_X86_64_PC32 against
`.bss'
main.o: In function `main':
/export/home/hjl/bugs/binutils/pr18695/main.c:8:(.text+0x5): relocation
truncated to fit: R_X86_64_PC32 against symbol `foo' defined in COMMON section
in foo.o
/export/home/hjl/bugs/binutils/pr18695/main.c:9:(.text+0x21): relocation
truncated to fit: R_X86_64_PC32 against symbol `foo' defined in COMMON section
in foo.o
/export/home/hjl/bugs/binutils/pr18695/main.c:10:(.text+0x2b): relocation
truncated to fit: R_X86_64_PC32 against symbol `foo' defined in COMMON section
in foo.o
collect2: error: ld returned 1 exit status
Makefile:32: recipe for target 'x' failed
make: *** [x] Error 1
address@hidden pr18695]$ make y
gcc -B./ -mx32 -fno-lto  -o y foo.o main.o -fuse-ld=gold
address@hidden pr18695]$ ./y 
Segmentation fault (core dumped)
address@hidden pr18695]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]