This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[Fwd: gas: installing relocations for SEC_MERGE strings]
- From: Joern Rennecke <joern dot rennecke at st dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 10 Apr 2002 11:29:40 +0100
- Subject: [Fwd: gas: installing relocations for SEC_MERGE strings]
- Organization: SuperH UK Ltd.
- Reply-to: joern dot rennecke at st dot com
-------- Original Message --------
BCC: joern.rennecke@st.com
Message-ID: <3CB3144C.2070902@st.com>
Date: Tue, 09 Apr 2002 17:18:20 +0100
From: Joern Rennecke <joern.rennecke@st.com>
Organization: SuperH UK Ltd.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901
X-Accept-Language: en-us
MIME-Version: 1.0
To: binutils@sources.redhat.com
Subject: gas: installing relocations for SEC_MERGE strings
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
adjust_reloc_syms avoids installing relocations for SEC_MERGE
strings:
/* Never adjust a reloc against local symbol in a merge section
with non-zero addend. */
if ((symsec->flags & SEC_MERGE) && fixp->fx_offset)
{
symbol_mark_used_in_reloc (fixp->fx_addsy);
goto done;
}
But the relocation is then still installed in fixup_segment:
if (TC_FIX_ADJUSTABLE(fixP))
add_number += S_GET_VALUE (add_symbolP);
...
if (!fixP->fx_done)
md_apply_fix3 (fixP, & add_number, this_segment_type);
This causes c-torture/execure/string-opt-[56].c to fail, since the
difference between the section start and the string start is added twice
into the source address of memcpy where a source like "vwxyz"+1 was
specified in the source code.
I can fix this for now in TC_FIX_ADJUSTABLE in tc-sh.h, but I wonder if
any target actually wants these fixups to occur, or if we would be
better off to change the condition above to
if (! symbol_used_in_reloc_p (fixP->fx_addsy)
&& TC_FIX_ADJUSTABLE(fixP))
--
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330