avr-chat
[Top][All Lists]
Advanced

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

[Fwd: Re: [avr-chat] Embedding a 'foreign' file in my object code]


From: Robert von Knobloch
Subject: [Fwd: Re: [avr-chat] Embedding a 'foreign' file in my object code]
Date: Mon, 29 Mar 2010 10:35:20 +0200
User-agent: Thunderbird 1.5.0.14 (X11/20060911)

Thanks for the tip Jörg, it now seems obvious (after your help and the weekend).
I now have the problem that the section-rename seems not to work as I expect.

In makefile:
===================================
LDFLAGS       = -Wl,-Map,$(PRG).map \
                ........<snip>........
                -Wl,--section-start=.testuut7=0x6b00 \
                -Wl,--section-start=.text7=0x6c80 \
                -Wl,--section-start=.testparms7=0x6d80 \
                ........<snip>........

obj7: uut7.o

uut7.o: uut7.bin
        $(OBJCOPY) -I binary -O elf32-avr --rename-section 
.data=.testuut7,contents,alloc,load,readonly,data uut7.bin uut7.o
===================================
Which I expected (and wanted) to create an 'image' of the binary file in my 
.testuut7 section (at 0x6b00 absolute)
But I get this:

avr-gcc -g -Wall -Os -fno-inline -mmcu=atmega644p -DF_CPU=20000000         -c 
-o main.o main.c
avr-objcopy -I binary -O elf32-avr --rename-section 
.data=.testuut7,contents,alloc,load,readonly,data uut7.bin uut7.o
/opt/cross/lib/gcc/avr/4.3.2/../../../../avr/bin/ld: section .testuut7.1 
[0000117e -> 00001243] overlaps section .data [0000117e -> 00001197]
make: *** [main.elf] Error 1

Which indicates 1) that it wants to create a section called .testuut7.1 (??)
and 2) that it tries to put the data into the .data section but overlaps it 
with other, existing code.
I know this is not avr bur would appreciate it if anyone could point me in the 
right direction.

Many thanks,

Robert


Robert von Knobloch <address@hidden> wrote:

> I have got the makefile to convert the uut7.bin to uut7.o OK, (using
> the info from the avr-libc FAQ) but how do I get this uut7.o
> incorporated into the elf file so that objcopy can do the
> extraction?

You have to link it together with the remaining .o files into one
final ELF file.  If I understand your snippet correctly, it might
suffice to include uut7.o into the list of files in your OBJ macro.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)


_______________________________________________
AVR-chat mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-chat







reply via email to

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