Bug 1624776

Summary: binutils: ld removes some R_X86_64_JUMP_SLOT relocations
Product: Red Hat Enterprise Linux 7 Reporter: Florian Weimer <fweimer>
Component: binutilsAssignee: Nick Clifton <nickc>
Status: CLOSED ERRATA QA Contact: Miloš Prchlík <mprchlik>
Severity: low Docs Contact:
Priority: low    
Version: 7.5CC: codonell, law, mcermak, mprchlik, ohudlick
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: binutils-2.27-38.base.el7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 12:41:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1655768    

Description Florian Weimer 2018-09-03 09:23:47 UTC
Consider this assembler source file (reloc.s):

	.text
	mov malloc@GOTPCREL(%rip), %rax
	jmp malloc@plt

Assemble and link it into a shared object:

as -o reloc.o reloc.s
ld -o reloc.so -shared reloc.o

binutils-2.23.52.0.1-16.el7.x86_64 generates these relocations:

Relocation section '.rela.dyn' at offset 0x200 contains 1 entries:
    Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
0000000000200ff8  0000000200000006 R_X86_64_GLOB_DAT      0000000000000000 malloc + 0

Relocation section '.rela.plt' at offset 0x218 contains 1 entries:
    Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
0000000000201018  0000000200000007 R_X86_64_JUMP_SLOT     0000000000000000 malloc + 0

But binutils-2.27-27.base.el7.x86_64 generates these relocations:

Relocation section '.rela.dyn' at offset 0x1e0 contains 1 entries:
    Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
0000000000200ff8  0000000100000006 R_X86_64_GLOB_DAT      0000000000000000 malloc + 0

This is a regression because it prevents PLT enter/exit hooks from working for malloc@plt.

Comment 1 Florian Weimer 2018-09-03 09:26:17 UTC
I forgot to mention that this issue does not seem to be present in binutils-2.31.1-12.fc30.x86_64.

Comment 5 Nick Clifton 2019-01-08 16:44:01 UTC
Fixed in binutils-2.27-38.base.el7

Comment 9 errata-xmlrpc 2019-08-06 12:41:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:2075