bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/6943] New: Avr target - Starting with 2.18, the LMA for the .bss


From: curtvm at yahoo dot com
Subject: [Bug ld/6943] New: Avr target - Starting with 2.18, the LMA for the .bss section now resides inside .text
Date: 4 Oct 2008 20:17:45 -0000

Summary- for the avr target, the .bss section is now getting an LMA address
inside the .text region, allowing the unused space set aside by the linker to
collide with other sections, or the end of flash.

Starting with binutils 2.18, the change log indicates changes were made in the
way the LMA output section is created. Before 2.18, for the avr target, the .bss
output section LMA was equal to its VMA address. Starting with 2.18, the LMA is
now calculated based on the previous output section in the same region. Since
the .data section has an LMA address in the .text section, now too the .bss also
is getting an LMA address which sits inside the .text section. The .bss section
does not need an LMA address, and is causing problems when the linker 'reserves'
space in .text for the .bss section (the space set aside for .bss in the .text
section runs into the end of available flash, or runs into other created
sections, etc.).

Without changing ld, I think a simple change to the default linker script for
the avr target would solve the problem. The current linker script line (this is
not from the file avr.sc, but is the end user linker script code)-
    .bss  SIZEOF(.data) + ADDR(.data) :
can be replaced with-
    .bss  SIZEOF(.data) + ADDR(.data) : AT (ADDR (.bss) )
to give the .bss section the same LMA address as its VMA. This also handles the
following .noinit section (which also doesn't need an LMA), and makes the avr
target act just as it did before binutils 2.18.

Although bug reports were filed with WinAVR, the source seems to be the way ld
now works, so it seems the default avr script template (avr.sc) should be
changed in binutils.

-- 
           Summary: Avr target - Starting with 2.18, the LMA for the .bss
                    section now resides inside .text
           Product: binutils
           Version: 2.18
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: curtvm at yahoo dot com
                CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=6943

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

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