[Top][All Lists]

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

Re: [avr-gcc-list] Fixed, external function "pointers"

From: Erik Walthinsen
Subject: Re: [avr-gcc-list] Fixed, external function "pointers"
Date: Thu, 12 Jan 2006 15:03:45 -0800
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)

Erik Christiansen wrote:
The easiest way to do this is in the linker script. e.g. taking Dave's
as a basis, modify

  .data    : AT (ADDR (.text) + SIZEOF (.text))


  .data  0x800068  : AT (ADDR (.text) + SIZEOF (.text))

and you've moved the vma up 8 bytes. (check with objdump -h)
Yeah, I'm probably going to have to write a linker script to simplify the compilation of application code. Right now I add this to the cmdline:

        -Wl,-Tdata=0x800180 \
        -Wl,--section-start=.appsig=0x17fc \
        -Wl,--just-symbols=bootloader \

I'm completely unfamiliar with linker scripts, can I have a short linker script that contains *just* the above information and tacks onto / replaces the normal parameters just by listing it on the linker cmdline? Or do I have to snapshot the entire linker script from a given version of ld and modify it slightly (and keep it up to date etc)?

There's no compile-time data that needs to go into those 8 bytes, is
Nope, initialized by the bootloader code. One of the big reasons for switching to pure ASM was to eliminate the rather significant chunk of code dedicated to just copying stuff around, even if it was never initialized in the C...

Speaking of redundancy, I haven't been able to find any documentation on the register-level ABI that avr-gcc expects, and thus what registers I do and don't need to save when writing my own ASM functions. I see conflicting info in the compiler output, with the interrupt handlers saving almost all of the upper 16 even if they aren't all used, and others apparently not even saving registers they clobber (esp r30:r31).

Where can I find that info?

   aka Erik Walthinsen

reply via email to

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