This is the mail archive of the 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]

[Fwd: gas: installing relocations for SEC_MERGE strings]

-------- Original Message --------
Message-ID: <>
Date: Tue, 09 Apr 2002 17:18:20 +0100
From: Joern Rennecke <>
Organization: SuperH UK Ltd.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20010901
X-Accept-Language: en-us
MIME-Version: 1.0
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

         /* 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))
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330

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