bugAVR C Runtime Library - Bugs: bug #26995, .fuses and .bss overlap on the elf...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #26995: .fuses and .bss overlap on the elf file

Submitter:  Renato Caldas <seventhguardian>
Submitted:  Thu 09 Jul 2009 09:06:53 PM UTC
   
 
Category:  Library Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Works For Me Assigned to:  None
Percent Complete:  0% Open/Closed:  Closed
Release:  1.6.4 Fixed Release:  None

Wed 09 Jun 2010 09:42:47 AM UTC, comment #2: 

I have just resurected my old code, and now it works perfectly. Probably some old bug that got fixed.

Thanks for looking into this, I believe this report can be safely closed.

Renato Caldas <seventhguardian>
Wed 09 Jun 2010 09:26:07 AM UTC, comment #1: 

Not confirmed:


$ cat bar.c
#include <avr/io.h>

FUSES =
{
.low = LFUSE_DEFAULT,
.high = HFUSE_DEFAULT,
.extended = EFUSE_DEFAULT
};

int foo;

int
main(void)
{
  foo = 42;
  return 0;
}
$ avr-gcc -Os -Wall -std=c99 -mcall-prologues -mmcu=atmega168 -o bar.elf bar.c
$ avr-objdump -h bar.elf

bar.elf:     file format elf32-avr

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         000000a6  00000000  00000000  00000094  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .bss          00000002  00800100  00800100  0000013a  2**0
                  ALLOC
  2 .fuse         00000003  00820000  00820000  0000013a  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  3 .stab         000006b4  00000000  00000000  00000140  2**2
                  CONTENTS, READONLY, DEBUGGING
  4 .stabstr      00000054  00000000  00000000  000007f4  2**0
                  CONTENTS, READONLY, DEBUGGING
$ avr-objdump -j .fuse -s bar.elf

bar.elf:     file format elf32-avr

Contents of section .fuse:
 820000 62dff9                               b..


Please provide a full example that can reproduce the bug.

Btw., the location of your -lm option on the command-line makes it
have zero effect to the linker.

Joerg Wunsch <joerg_wunsch>
Group administrator
Thu 09 Jul 2009 09:06:53 PM UTC, original submission:  

It is apparently not possible to include both the fuses and global variables in the same elf file.

When using something like:

FUSES =
  {
    .low = LFUSE_DEFAULT,
    .high = HFUSE_DEFAULT,
    .extended = EFUSE_DEFAULT
  };

and global variables I get this linker error:

avr-gcc -Os -Wall -std=c99 -mcall-prologues -mmcu=atmega168 -I. -L/usr/lib/binutils/avr/2.18/ -Wl,-Map,mcrt.map -lm mcrt.o -o mcrt.elf
/usr/libexec/gcc/avr/ld: section .bss [0000000000000580 -> 0000000000000588] overlaps section .fuse [0000000000000580 -> 0000000000000582]
/usr/libexec/gcc/avr/ld: mcrt.elf: section .bss lma 0x580 overlaps previous sections
make: * [mcrt.elf] Error 1

I've reproduced this with other targets like the attiny2313, so it should not be device-specific.

Renato Caldas <seventhguardian>

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by seventhguardian (Submitted the item)
  •  

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-06-09 joerg_wunsch StatusNeed Info Works For Me
        Open/ClosedOpen Closed
    2010-06-09 joerg_wunsch StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code