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

            Bug ID: 18609
           Summary: Invalid R_X86_64_GOTPCREL -> R_X86_64_PC32 conversions
           Product: binutils
           Version: 2.26 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: hjl.tools at gmail dot com
                CC: ian at airs dot com
  Target Milestone: ---

[hjl@gnu-6 pr18591]$ cat x.S
        .data
#if 1
        .space 0x8ff00000
#else
        .space 0x70000000
#endif
        .hidden foo
        .globl  foo
//      .type   foo, @object
foo:
        .byte 20
//      .size   foo, .-foo
local:
        .byte 20
        .text
        .globl  _start
        .type   _start, @function
_start:
        movq    foo@GOTPCREL(%rip), %rax
        movq    local@GOTPCREL(%rip), %rax
        .size   _start, .-_start
[hjl@gnu-6 pr18591]$ make LD=ld.gold
gcc    -c -o x.o x.S
ld.gold -z max-page-size=0x200000 -shared -o x.so x.o
objdump -dw x.so

x.so:     file format elf64-x86-64


Disassembly of section .text:

00000000000001e0 <_start>:
 1e0:   48 8d 05 e1 00 10 90    lea    -0x6fefff1f(%rip),%rax        #
ffffffff901002c8 <__bss_start+0xfffffffefffffffe>
 1e7:   48 8d 05 db 00 10 90    lea    -0x6fefff25(%rip),%rax        #
ffffffff901002c9 <__bss_start+0xfffffffeffffffff>
[hjl@gnu-6 pr18591]$ 

gold failed to check if R_X86_64_PC32 will overflow when converting
R_X86_64_GOTPCREL to R_X86_64_PC32.

-- 
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