RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1573872 - ld should allow "lea foo@GOT, %ecx"
Summary: ld should allow "lea foo@GOT, %ecx"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: binutils
Version: 7.6
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Nick Clifton
QA Contact: Miloš Prchlík
URL:
Whiteboard:
: 1593421 (view as bug list)
Depends On:
Blocks: 1582602
TreeView+ depends on / blocked
 
Reported: 2018-05-02 12:18 UTC by Deepu K S
Modified: 2021-12-10 16:04 UTC (History)
10 users (show)

Fixed In Version: binutils-2.27-31.base.el7
Doc Type: Bug Fix
Doc Text:
Cause: The BFD based linker was being needlessly restrictive in its handling of a special form of the x86 LEA instruction when building a shared library. Consequence: The linker would reject valid code with an error message about an unsupported address mode. Fix: Patch the linker so that it can handle the addressing mode. Result: The linker no longers complains, but instead accepts and links the input file.
Clone Of:
: 1582602 (view as bug list)
Environment:
Last Closed: 2018-10-30 07:50:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3451312 0 None None None 2018-05-21 18:07:40 UTC
Red Hat Knowledge Base (Solution) 3452571 0 None None None 2018-05-23 14:45:01 UTC
Red Hat Product Errata RHSA-2018:3032 0 None None None 2018-10-30 07:51:10 UTC
Sourceware 21168 0 None None None 2018-05-02 12:18:45 UTC

Description Deepu K S 2018-05-02 12:18:45 UTC
Description of problem:
$ cat x.S 
	.text
	.globl	bar
	.type	bar, @function
bar:
	call	__x86.get_pc_thunk.ax
	addl	$_GLOBAL_OFFSET_TABLE_, %eax
	lea	foo@GOT, %ecx
	mov	(%eax,%ecx,1), %eax
	ret
	.section	.text.__x86.get_pc_thunk.ax,"axG",@progbits,__x86.get_pc_thunk.ax,comdat
	.globl	__x86.get_pc_thunk.ax
	.hidden	__x86.get_pc_thunk.ax
	.type	__x86.get_pc_thunk.ax, @function
__x86.get_pc_thunk.ax:
	movl	(%esp), %eax
	ret
	.section	.note.GNU-stack,"",@progbits

# gcc -B./ -m32 -c -o x.o x.S
# ld -melf_i386 -shared -o libx.so x.o
ld: x.o: direct GOT relocation R_386_GOT32 against `foo' without base register can not be used when making a shared object
ld: final link failed: Bad value

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 7.5
binutils-2.27-27.base.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Reproducer program provided in bug description.
2.
3.

Actual results:
ld: x.o: direct GOT relocation R_386_GOT32 against `foo' without base register can not be used when making a shared object
ld: final link failed: Bad value


Expected results:
No linker failures.

Additional info:

Comment 2 Nick Clifton 2018-05-02 14:57:36 UTC
This is PR 21168:

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

Patch on its way....

Comment 3 Nick Clifton 2018-05-02 15:21:12 UTC
Fixed in binutils-2.27-31.base.el7.

Comment 7 Nick Clifton 2018-06-21 12:13:16 UTC
*** Bug 1593421 has been marked as a duplicate of this bug. ***

Comment 8 Miloš Prchlík 2018-07-26 07:01:18 UTC
Verified for build binutils-2.27-34.base.el7 by manually running /tools/binutils/Regression/bz1573872-ld-should-allow-lea-foo-GOT-ecx test using the provided reproducer.

Comment 10 errata-xmlrpc 2018-10-30 07:50:06 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-2018:3032


Note You need to log in before you can comment on or make changes to this bug.