[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: Dave N6NZ
Subject: Re: [avr-gcc-list] how do I pass --defsym to avr-ld?
Date: Tue, 30 Sep 2008 13:15:10 -0700
User-agent: Thunderbird 1.5 (X11/20051201)

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 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 @@
+    *(.entryjumps)
     /* For data that needs to reside in the lower 64k of progmem.  */
@@ -145,6 +146,7 @@
   }  > text
   .data          : AT (ADDR (.text) + SIZEOF (.text))
+     . += DEFINED (__libdatareserve) ? __libdatareserve : 0 ;
      PROVIDE (__data_start = .) ;
@@ -176,6 +178,7 @@
   }  > data
   .eeprom  :
+    . += DEFINED(__libeepromreserve) ? __libeepromreserve : 0 ;
      __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.


AVR-GCC-list mailing list

reply via email to

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