avr-objcopy in winavr20070101 doesn't like 0 eeprom

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

The command,

avr-objcopy -j .eeprom -j .eestart --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 -O ihex bin/release/ARCH_AVR.atmega128.BNET_USE_BIO.BNET_USE_GLCD.elf bin/release/ARCH_AVR.atmega128.BNET_USE_BIO.BNET_USE_GLCD.eep

, is okay with the avr-objcopy in winavr20060421, but when I compile the same project with winavr20070101 avr-objcopy complains with the following message...

c:\WinAVR\bin\avr-objcopy.exe: there are no sections to be copied!

avr-size -A gives the following results from the winavr20060421 elf file:

bin/release/ARCH_AVR.atmega128.BNET_USE_BIO.BNET_USE_GLCD.elf  :
section            size      addr
.data              5998   8392960
.text              8502         0
.bss               8321   8398958
.noinit               0   8407279
.eeprom               0   8454144
.stab              1032         0
.stabstr            132         0
.debug_aranges      264         0
.debug_pubnames    4336         0
.debug_info       14964         0
.debug_abbrev      4218         0
.debug_line        8387         0
.debug_str         5148         0
Total             61302

However, avr-size -A gives the following results (no eeprom section) with winavr20070101

ARCH_AVR.atmega128.BNET_USE_BIO.BNET_USE_GLCD.elf  :
section            size      addr
.data              6014   8392960
.text              8556         0
.bss               8321   8398974
.stab              1032         0
.stabstr            132         0
.debug_aranges      424         0
.debug_pubnames    4336         0
.debug_info       15158         0
.debug_abbrev      4591         0
.debug_line       10204         0
.debug_frame       2416         0
.debug_str         5183         0
.debug_loc         2426         0
.debug_ranges        48         0
Total             68841

Is this intentional? and is there anyway I can stop the avr-objcopy line from complaining. Is there a way of forcing the section to be created, even if it is zero is size?

Many Thanks,

Brian.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My understanding is that this issue in the new version of binutils (2.17) difference is already known, and EW had to produce a new makefile template to work around it.

Have you migrated your project over to the new makefile yet?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I work with a my own makefile as I have a large source tree with multiple processor targets and other options. I'll take a look at the new makefile templates though to see what they've done.

Sorry, should have thought of looking at that first! Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

D'oh, just add "|| exit 0" to the end of the command.

@$(OBJCOPY) -j .eeprom -j .eestart --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ || exit 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@-$(OBJCOPY) ... ought to work as well.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, -$(OBJCOPY) works fine. Another thing learnt about the make manual!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

IIRC, the extra " || exit 0" was put in because thats what we figured out worked for AVR Studio when they generate their internal Makefile on doing a build. So I kept it in the WinAVR Makefile Template.