[PATCH]: Fix ld bug triggered in arm-*-pe (?)

Pedro Alves pedro_alves@portugalmail.pt
Tue Aug 15 00:30:00 GMT 2006


Hi all,

While doing the arm-pe/arm-wince-pe split, I noticed that
the ld/ld-scripts/script.exp [script] test would fail for arm-wince-pe 
but not for arm-epoc-pe.

Here is the script.t file for reference (with minor editing for better 
mail reading):

SECTIONS
{
  .text 0x100 : { text_start = .;  *(.text)  *(.pr)  text_end = .; }
  . = 0x1000;
  .data : { data_start = .; *(.data) *(.rw) data_end = .; }
}

Without the attached patch, I am getting a data_start == 0x00000104, 
that is, the dot assignment
is being lost.

nm output:
         U .bss
00000104 d .data
00000100 t .text
(...)

I traced it to the fact that the default section alignment for 
arm-wince-pe/arm-pe is 0x1000
while for arm-epoc-pe it is 0x400.
If I change 0x1000 to something else, say 0x1010, and retest in 
arm-wince-pe,
the dot assign is *not* ignored. If I change the 0x1000 to 0x400 and 
test with arm-epoc-pe,
I get the same bug.
I tried reproducing with i686-pc-cygwin, but I couldn't.
This may have something to do with the ".glue_7*" sections not being 
present there.

The attached patch fixes the problem, but I am not sure if I'm not fixing
the symptom instead.

Tested on arm-pe, arm-wince-pe, arm-epoc-pe and i686-pc-cygwin for 
regressions.

Cheers,
Pedro Alves

---
ld/ChangeLog

2006-08-14  Pedro Alves  <pedro_alves@portugalmail.pt>

    * ldlang.c (lang_size_sections_1, lang_assignment_statement_enum):
    Adjust the current address of DEFAULT_MEMORY_REGION even
    when dot hasn't changed.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ldlang.c.diff
URL: <https://sourceware.org/pipermail/binutils/attachments/20060815/2b4a2203/attachment.ksh>


More information about the Binutils mailing list