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

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
[hjl@gnu-6 pr19567]$ cat x.s 
    .globl _start
_start:
    mov $_start,%rax
    mov _start,%rax
[hjl@gnu-6 pr19567]$ make
as --x32 -o x.o x.s
ld.gold -m elf32_x86_64 -Ttext-segment 0x80000000 -o x x.o
objdump -dw x

x:     file format elf32-x86-64


Disassembly of section .text:

80000074 <_start>:
80000074:       48 c7 c0 74 00 00 80    mov    $0xffffffff80000074,%rax
8000007b:       48 8b 04 25 74 00 00 80         mov    0xffffffff80000074,%rax
[hjl@gnu-6 pr19567]$ readelf -r x.o

Relocation section '.rela.text' at offset 0x9c contains 2 entries:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
00000003  0000040b R_X86_64_32S      00000000   _start + 0
0000000b  0000040b R_X86_64_32S      00000000   _start + 0
[hjl@gnu-6 pr19567]$ ld -m elf32_x86_64 -Ttext-segment 0x80000000 -o x x.o
x.o: In function `_start':
(.text+0x3): relocation truncated to fit: R_X86_64_32S against symbol `_start'
defined in .text section in x.o
x.o: In function `_start':
(.text+0xb): relocation truncated to fit: R_X86_64_32S against symbol `_start'
defined in .text section in x.o
[hjl@gnu-6 pr19567]$ 

To detect R_X86_64_32S overflow, Symbol_value::value to return 64-bit value
so that I can check if there is an overflow.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to