avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] RFT: Linker relaxation


From: Björn Haase
Subject: [avr-libc-dev] RFT: Linker relaxation
Date: Thu, 20 Apr 2006 06:23:16 +0200
User-agent: KMail/1.7.1

Hi Fabrizio,

here is a mail-sketch that I am about to send to the binutils mailing list.
With the attached patch I consider the remaining linker relaxation issues to
be solved.
Since I am on vacation right now, I don't currently have access to hardware.
I consider the patch to be correct, but prior to posting it, I would prefer
to have the patch tested on a real-world application at least once.

It would, thus, be quite helpful if you or somebody else could test the
 patch.

Once this issue is resolved, I am planing to extend ld to support target
specific options. The required changes (new emulation template file) would be
also a first step towards implementing the "jump stub insertion" that we will
need for the > 128k devices. In the very first step, I'd add target switches
for disabling the call / ret -> jmp optimization and switches for setting the
program-memory-wrap-around address.

Yours,

Bjoern.

P.S.:
For your information, We are already using an older version of the linker
relaxation for two mass series products (e.g. the Bosch DMF10 metal detector
or the Bosch DLE50 laser range finder) without encountering problems.


/* Mail sketch meant to be sent to the binutils mailing list follows:   */

Hi,

I have now found out a couple of issues that show up when using linker
relaxation with the cvs state.
One problem was that the adjustment of changed addresses (address changes due
to the code-shrinking) were only applied in the .text section itself. It
could, however happen that there are references in the .data or .rodata
sections of the same module. E.g. when considering initialized function
pointer tables.
With the attached patch the "delete_bytes" function now looks for relocs in
all of the sections of an individual bfd.

The second issue that this patch addresses are PC relative expressions that
seemingly could be resolved at assembly time, but that could become invalid
when the code shrinks due to relaxation. Now gas is ordered to always use
relocs instead of fixups for these program memory related address
expressions.

The gas testsuite did not exhibit new regressions.

Bjoern

2006-04-19  Bjoern Haase  <address@hidden>

        * bfd/elf32-avr.c:
        elf32_avr_relax_delete_bytes:
        Iterate over all of the bfd's sections for reloc-addend adjustments.

        * gas/config/tc-avr.h:
        TC_VALIDATE_FIX: add.

-------------------------------------------------------

Attachment: avr-linkrelax.followup.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]