Bug 18609 - Invalid R_X86_64_GOTPCREL -> R_X86_64_PC32 conversions
Summary: Invalid R_X86_64_GOTPCREL -> R_X86_64_PC32 conversions
Status: ASSIGNED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.26
: P2 normal
Target Milestone: ---
Assignee: Andrew Senkevich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-28 16:42 UTC by H.J. Lu
Modified: 2016-01-19 18:07 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2015-06-28 16:42:56 UTC
[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.
Comment 1 Cary Coutant 2015-06-30 06:42:53 UTC
I tried to assign this to Ilya, but bugzilla won't let me.