avr-gcc-list
[Top][All Lists]
Advanced

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

RE: [avr-gcc-list] avr-objdump behaviour


From: Ben Mann
Subject: RE: [avr-gcc-list] avr-objdump behaviour
Date: Mon, 15 Nov 2004 16:21:01 +0800

Hi Eric,

I should prefix this with the note that I've since worked out a solution to
my satisfaction by avoiding avr-objdump and instead using the winavr
makefile template to generate source+assembler without any further problems.

After changing all return types to int (and int foo() { return 1+bar(); }
for luck) the objdump output looks like this:

----------------------------------------------------------------------------
--
demo3.o:     file format elf32-avr

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000010  00000000  00000000  00000034  2**0
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .data         00000000  00000000  00000000  00000044  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  2 .bss          00000000  00000000  00000000  00000044  2**0
                  ALLOC
  3 .stab         000001bc  00000000  00000000  00000044  2**2
                  CONTENTS, RELOC, READONLY, DEBUGGING
  4 .stabstr      000003f0  00000000  00000000  00000200  2**0
                  CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:

00000000 <bar>:
bar():
C:\mypath/demo3.c:9
}

int bar() {
    unsigned char c;
    for(c = 255; c != 0; c--)
   0:   8f ef           ldi     r24, 0xFF       ; 255
   2:   81 50           subi    r24, 0x01       ; 1
   4:   f1 f7           brne    .-4             ; 0x2
   6:   08 95           ret

00000008 <foo>:
foo():
C:\mypath/demo3.c:4
   8:   0e 94 00 00     call    0x0
C:\mypath/demo3.c:5
   c:   01 96           adiw    r24, 0x01       ; 1
   e:   08 95           ret
----------------------------------------------------------------------------
--
Clearly, foo() is not being optimised out, however the annoyance is simply
that the source line is not included, even though a reference to it
(demo3.c:4) is shown.

However, as I've worked around this to my satisfaction I'm happy to ignore
this for the time being.

Ben Mann
mailto:address@hidden


-----Original Message-----
From: Erik Christiansen [mailto:address@hidden 
Sent: Monday, 15 November 2004 3:52 PM
To: Ben Mann
Cc: address@hidden
Subject: Re: [avr-gcc-list] avr-objdump behaviour

--snip!--

Ben,

   Is it possible that "void bar();" is just being optimised out, and
therefore isn't there to be listed? If you try with a non-void function,
we'd see if there is any problem with avr-objdump.

Erik






reply via email to

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