bug-gnu-utils
[Top][All Lists]
Advanced

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

arm-aout-ld .data header bug


From: Quality Quorum
Subject: arm-aout-ld .data header bug
Date: Thu, 4 Oct 2001 19:50:34 -0400

Hi,

When linker calculates the length of .data section for the aout header
it rounds it up to the nearest page.

At the same time it puts .bss right after .data end without any
additional alignment in the image.

So, information in the header contains and incorrect value for the
length of data section and hence the location of .bss .

It is a minor but annoying bug, because some loaders do depend upon
header information to locate and zero .bss.

I do not know how to fix header generation, so I fixed link script
to match current header generation practice, it is appended to
this mail. I do not think that this is the right way to address
this problem, however, I do not know a better way to solve it.

The version I am using is 'GNU objdump 2.11.2'.

Thanks,

Aleksey

========================================================================
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   Thu Oct  4
13:04:58 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 = .};






reply via email to

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