[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] how do I pass --defsym to avr-ld?
From: |
Schwichtenberg, Knut |
Subject: |
RE: [avr-gcc-list] how do I pass --defsym to avr-ld? |
Date: |
Wed, 1 Oct 2008 08:13:42 +0200 |
Dave,
you are using the avr-gcc to pass the parameter to the linker. Did you
try to use the linker directly with
avr-ld --script=avr5.x --defsym=__libdatareserve=0x4 -o user user.o
bootlibentries.o
I'm not sure if the command line is okay :-(.
Knut
> -----Original Message-----
> From:
> address@hidden
> g
> [mailto:address@hidden
ongnu.org] On Behalf Of Dave N6NZ
> Sent: Tuesday, September 30, 2008 10:15 PM
> To: address@hidden
> Cc: AVR-GCC
> Subject: Re: [avr-gcc-list] how do I pass --defsym to avr-ld?
>
> Now I'm even more confused.
>
> I pass the symbol __libdatareserve in through a .o file.
> and it shows up in avr-nm output for both the .o and the resulting
> output file. But it still seems to be ignored by the
> DEFINED() function.
>
> avr-nm shows the symbol -- why doesn't DEFINED() see it????
>
> badly need a clue here...
>
> -dave
>
> Dave N6NZ wrote:
> > After making many threats, I'm finally attacking the
> problem of doing
> > separately compiled libraries in a robust fashion. (I can't bring
> > myself to call them dll's since being flashed they are hardly very
> > dynamic :)
> >
> > I have patched the avr5.x ld script as follows, which is a
> total of 3
> > additional lines, all upward compatible:
> >
> > diff -u /usr/local/atmel/avr/lib/ldscripts/avr5.x avr5.x
> > --- /usr/local/atmel/avr/lib/ldscripts/avr5.x 2007-07-27
> > 23:12:51.000000000 -0700
> > +++ avr5.x 2008-09-30 11:53:10.000000000 -0700
> > @@ -71,6 +71,7 @@
> > {
> > *(.vectors)
> > KEEP(*(.vectors))
> > + *(.entryjumps)
> > /* For data that needs to reside in the lower 64k of
> progmem. */
> > *(.progmem.gcc*)
> > *(.progmem*)
> > @@ -145,6 +146,7 @@
> > } > text
> > .data : AT (ADDR (.text) + SIZEOF (.text))
> > {
> > + . += DEFINED (__libdatareserve) ? __libdatareserve : 0 ;
> > PROVIDE (__data_start = .) ;
> > *(.data)
> > *(.data*)
> > @@ -176,6 +178,7 @@
> > } > data
> > .eeprom :
> > {
> > + . += DEFINED(__libeepromreserve) ? __libeepromreserve : 0 ;
> > *(.eeprom*)
> > __eeprom_end = . ;
> > } > eeprom
> >
> > My current problem revolves around the DEFINED() operator
> in avr-ld. It
> > does not seem to recognize my definitions, invoked as follows:
> >
> > avr-gcc -Wl,--script=avr5.x,--defsym=__libdatareserve=0x4 -o user \
> > user.o bootlibentries.o
> >
> > No matter what I do, it appears as if the DEFINED() is
> being ignored.
> > Perhaps I misunderstand how DEFINED() is supposed to work,
> or perhaps I
> > misunderstand --defsym.
> >
> > If I could solve this, then I believe I have the
> gold-plated solution
> > for calling separately flashed libraries (ie: reusing bootloader
> > functions.) I'll write that up fully after resolving this
> annoyance.
> >
> > -dave
> >
> >
> >
> > _______________________________________________
> > AVR-GCC-list mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> >
>
>
>
> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>
- RE: [avr-gcc-list] how do I pass --defsym to avr-ld?,
Schwichtenberg, Knut <=