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

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

[avr-gcc-list] how do I pass --defsym to avr-ld?


From: Dave N6NZ
Subject: [avr-gcc-list] how do I pass --defsym to avr-ld?
Date: Tue, 30 Sep 2008 12:07:10 -0700
User-agent: Thunderbird 1.5 (X11/20051201)

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





reply via email to

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