sumary of arm-aout problems
Aleksey Romanov
aromanov@ennovatenetworks.com
Thu Oct 11 11:32:00 GMT 2001
Nick Clifton wrote:
>
> Hi Aleksey,
>
> > 1. BFD assumes that entry_is_text_address on input, however, it does
> > not assume this on output.
>
> If this is still a problem for you, please could you send a *small*
> example that reproduces the problem.
I have an image compiled with -Wl,-N -Wl,-Ttext,0x30000 flags.
arm-aout-objdump -h xxx.gdb:
xxx.gdb: file format a.out-arm-little
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 0004f870 00000000 00000000 00000020 2**2
CONTENTS, ALLOC, LOAD, CODE
1 .data 00002150 0004f870 0004f870 0004f890 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .bss 0008ef04 000519c0 000519c0 00000000 2**2
ALLOC
hexdump -C xxx.gdb:
00000000 07 01 00 00 70 f8 04 00 50 21 00 00 04 ef 08 00
|....p...P!......|
00000010 ac 7e 0b 00 00 00 03 00 00 00 00 00 00 00 00 00
|.~..............|
> > 2. objxxx tools are confused if -N, -n or -Ttext option is specified
> > during link phase.
>
> Please could you elaborate. How are they confused ?
See above.
>
> > 1. Should I just forget about arm-aout and use arm-elf instead ?
>
> Probably. The aout format is very old, and everybody is using ELF
> these days.
I did some further research and I found that there is an inconsistency
between,
image actually generated by ld and header. If I am not using -N, -n and
-Ttext files,
image would not align .bss section on 0x8000 boundary, however, header
information
will round size of .data up to next 0x8000, hence location of .bss in
header will
be incorrect. It is a very minor bug, I found it because the environment
I am using
depends upon correct .bss information in header. I fixed it with the
following patch:
diff -C2 -r binutils-2.11.2/ld/scripttempl/armaout.sc
binutils-2.11.2-patched/ld/scripttempl/armaout.sc
*** binutils-2.11.2/ld/scripttempl/armaout.sc Mon May 3 03:29:08 1999
--- binutils-2.11.2-patched/ld/scripttempl/armaout.sc Tue Oct 9
13:02:15 2001
***************
*** 21,28 ****
*(.data)
${CONSTRUCTING+CONSTRUCTORS}
! ${RELOCATING+_edata = .;}
! ${RELOCATING+__edata = .;}
}
! .bss ${RELOCATING+ SIZEOF(.data) + ADDR (.data)} :
{
${RELOCATING+ __bss_start = .};
--- 21,28 ----
*(.data)
${CONSTRUCTING+CONSTRUCTORS}
! ${RELOCATING+_edata = ${DATA_ALIGNMENT};}
! ${RELOCATING+__edata = ${DATA_ALIGNMENT};}
}
! .bss ${RELOCATING+${DATA_ALIGNMENT}} :
{
${RELOCATING+ __bss_start = .};
>
> Cheers
> Nick
Thanks for your help,
Aleksey
More information about the Binutils
mailing list