fix missing Xtensa relocations for difference of symbols

Bob Wilson bwilson@tensilica.com
Fri Mar 18 01:49:00 GMT 2005


I've committed this patch for the Xtensa port of GAS to fix a problem of missing 
relocations.  When doing link-time relaxation (which is now the default for 
Xtensa), a relocation is required to identify values that are the difference of 
two symbols  from the same section.  I missed this change last fall when I 
dumped a bunch of Xtensa changes into the code.  The patch also removes a few 
unnecessary checks, and moves code that belongs in md_apply_fix3 out of 
tc_gen_reloc.

I'm planning to put this patch on the 2.16 branch.  In fact, I have a  number of 
Xtensa-specific changes that I'd like to make before 2.16 goes out.  Some of 
these changes are more risky than would usually be appropriate for a release 
branch, but I think they will still be improvements to the current state of the 
Xtensa code.  I would have liked to get the Xtensa-related binutils code in 
better shape before the branch was made, but I haven't been able to spend much 
time on it until recently.  Daniel said to use good judgement and I assume this 
is OK, but I wanted to explain the situation ahead of time in case anyone objects.

2005-03-17  Bob Wilson  <bob.wilson@acm.org>

         * config/tc-xtensa.c (xg_apply_tentative_value): Rename to
         xg_apply_fix_value and return a value to indicate success.
         (md_pcrel_from): Skip check of fx_done.  Return 0 if not PC-relative.
         (xtensa_force_relocation): Remove checks for VTABLE relocs.
         (xtensa_validate_fix_sub): New.
         (xtensa_fix_adjustable): Remove check for external or weak symbols.
         (tc_gen_reloc): Move code to handle difference of symbols and code to
         apply tentative fix values to ...
         (md_apply_fix3): ...here.  Enable standard overflow checks for simple
         8, 16, and 32 bit relocations.  Apply fixes for slot-specific
         relocations when linkrelax flag is not set.
         * config/tc-xtensa.h (xtensa_validate_fix_sub): Add prototype.
         (TC_FORCE_RELOCATION_SUB_SAME, TC_VALIDATE_FIX_SUB): Define.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff-reloc.patch
Type: text/x-patch
Size: 15970 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20050318/968a705d/attachment.bin>


More information about the Binutils mailing list