This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Allow copy relocations with pie links
- From: Cary Coutant <ccoutant at google dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: binutils <binutils at sourceware dot org>, Ian Lance Taylor <iant at google dot com>, David Li <davidxl at google dot com>
- Date: Wed, 7 May 2014 16:46:44 -0700
- Subject: Re: Allow copy relocations with pie links
- Authentication-results: sourceware.org; auth=none
- References: <CAAs8HmxwPuH7_s1yLxeW_6qkMCB+_kYSzB6yYG85QZS6yVHpZg at mail dot gmail dot com>
> * symtab.h (may_need_copy_reloc): Extra default parameter to
> indicate if this is a PC relative relocation.
In the PC-rel case, you need to check for output_is_executable. With
your patch, we will now allow copy relocs for pc-relative relocations
even in shared libraries.
I'd prefer to move the check for output format to the points of call;
there are two calls in each target, one for pc-relative relocs, and
one for absolute relocs. For the absolute reloc, use:
if (!parameters->options().output_is_position_independent()
&& gsym->may_need_copy_reloc())
For the pc-relative reloc, use:
if (parameters->options().output_is_executable()
&& gsym->may_need_copy_reloc())
> * x86_64.cc (Target_x86_64<size>::Scan::global): Call
> may_need_copy_reloc with parameter set to true.
Please update the other targets, too.
Thanks!
-cary