This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold] x32: fix relative reloc preference for R_X86_64_32.
- From: Pavel Chupin <pavel dot v dot chupin at gmail dot com>
- To: binutils at sourceware dot org
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Mon, 2 Sep 2013 14:01:13 +0400
- Subject: Re: [gold] x32: fix relative reloc preference for R_X86_64_32.
- Authentication-results: sourceware.org; auth=none
- References: <CANwJu19j4QOiCMo+8e8o8QmxmvtC5LRPuPd-POOLR7he_jGJGA at mail dot gmail dot com>
On Wed, Aug 21, 2013 at 2:10 PM, Pavel Chupin <pavel.v.chupin@gmail.com> wrote:
> Hi,
> Attached trivial patch fixes R_X86_64_RELATIVE preference over
> R_X86_64_32 for x32 in global scan.
>
> 2013-08-15 Pavel Chupin <pavel.v.chupin@intel.com>
>
> Fix R_X86_64_RELATIVE preference for x32
> * x86_64.cc: Add size check.
>
> OK for mainline?
>
> --
> Pavel Chupin
> Intel Corporation
Ping.
More details on the problem:
Test case:
int bar() {
return 42;
}
static int *a = (int *)&bar;
Currently when compiled with -shared -fpic -mx32 -fvisibility=hidden
and linked with gold:
.rela.dyn
00002004 0000050a R_X86_64_32 000002f4 bar + 0
.dynsym
5: 000002f4 10 FUNC LOCAL HIDDEN 7 bar
.symtab
8: 000002f4 10 FUNC LOCAL HIDDEN 7 bar
After patch:
.rela.dyn
00002004 00000008 R_X86_64_RELATIVE 000002a4
.dynsym
Don't have bar entry
.symtab
8: 000002a4 10 FUNC LOCAL HIDDEN 7 bar
--
Pavel Chupin
Intel Corporation