This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold] x32: fix relative reloc preference for R_X86_64_32.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]