[Top][All Lists]

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

Re: [avr-gcc-list] avr-as and the dot "."

From: Torsten Mohr
Subject: Re: [avr-gcc-list] avr-as and the dot "."
Date: Sun, 20 Apr 2003 14:02:59 +0200
User-agent: KMail/1.4.3


> Is there a trick to getting the "." location
> counter to work in avr-as?  I'm using just the

If you take a look at the text section:

objcopy -O binary -j .text a.out text.out
hexdump text.out
0000000 0000 0000 0000

So it seems that there are REALLY only zeroes in
that section, but if you type:

file a.out
a.out: ELF 32-bit LSB relocatable, version 1 (SYSV), not stripped
Ok, this is NOT an executable.

And if you type:
readelf -S .text a.out | grep text
[ 1] .text       PROGBITS     00000000 000034 000006 00  AX  0   0  1
[ 2] .rela.text  RELA         00000000 0001f0 000024 0c      6   1  4

So there is another section with "absolute relocation information",
if i understand correctly, you should link several object files
and generate an executable, the information are put to the
relocations are solved.

        .global qwe

        .section .asd,"a",@progbits
        .word .
        .word .
        .word .

int main() {
        return 0;

avr-gcc -o test.o -c test.s
avr-gcc -o main.o -c main.c
avr-gcc -o a.out main.o test.o
file a.out
a.out: ELF 32-bit LSB executable, version 1 (SYSV), \
statically linked, not stripped

Now it is an EXECUTABLE.

objcopy -O binary -j .asd a.out asd.out
hexdump asd.out
0000000 0064 0066 0068

Best regards,

reply via email to

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