bugAVR C Runtime Library - Bugs: bug #21559, BOOTLOADER_SECTION macro does not...

 
 

bug #21559: BOOTLOADER_SECTION macro does not function properly when used in more than one file

Submitted by:  David Luksenberg <dluksenberg>
Submitted on:  Sun 11 Nov 2007 08:39:07 PM UTC  
 
Category: HeaderSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Build system
Status: InvalidPercent Complete: 0%
Assigned to: Eric Weddington <arcanum>Open/Closed: Closed
Release: NoneFixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 11 Nov 2007 09:01:43 PM UTC, comment #2:

The problem is not with avr-libc. The issue is with GNU ld (the linker) in Binutils. For some unknown reason, this changed between 2.16.1 and 2.17.

The workaround is to use a custom linker script. Copy the default linker script (.x file for your architecture) and add the following to the SECTIONS block:

.bootloader : { KEEP((.bootloader)) }

Which means for all files (the first star) add all sections that start the ".bootloader" and any characters after that, KEEP the sections in the final output, and place them in the output section ".bootloader"

Eric Weddington <arcanum>
Project AdministratorIn charge of this item.
Sun 11 Nov 2007 08:46:39 PM UTC, comment #1:

Using: avr-gcc (GCC) 4.1.2 (WinAVR 20070525)

Example:

Disassembly of section .bootloader.1:
0000010c <rc4_crypt>:

Disassembly of section .bootloader:
00003800 <MyEepromReadByte>:

David Luksenberg <dluksenberg>
Sun 11 Nov 2007 08:39:07 PM UTC, original submission:

When using the macro BOOTLOADER_SECTION from boot.h in more than one file, the compiler starts creating subsections (bootloader.1, bootloader.2 ...) for every file compiled after the first. Using the linker section-start option will only move the original .bootloader section and not the other .bootloader.x sections.

David Luksenberg <dluksenberg>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by arcanum (Posted a comment)
  • -unavailable- added by dluksenberg (Submitted the item)
  • -unavailable- added by dluksenberg
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 11 Nov 2007 09:01:43 PM UTCarcanumStatusNone=>Invalid
      Assigned toNone=>arcanum
      Open/ClosedOpen=>Closed
    Sun 11 Nov 2007 08:39:07 PM UTCdluksenbergCarbon-Copy-=>Added dluksenberg

    Back to the top


    Powered by Savane 3.1-cleanup1