This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: Section (.sdata2) being omitted but SIZEOF(.sdata2) is not zero?
- From: Douglas Graham <douglas dot graham at ericsson dot com>
- To: Douglas Graham <douglas dot graham at ericsson dot com>, Alan Modra <amodra at gmail dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 20 Jan 2014 00:44:24 +0000
- Subject: RE: Section (.sdata2) being omitted but SIZEOF(.sdata2) is not zero?
- Authentication-results: sourceware.org; auth=none
- References: <E36F5062C1BCFC48B8230995895548DF02C35784 at eusaamb109 dot ericsson dot se> <E36F5062C1BCFC48B8230995895548DF02C357A9 at eusaamb109 dot ericsson dot se> <20140119092749 dot GJ5390 at bubble dot grove dot modra dot org> <E36F5062C1BCFC48B8230995895548DF02C359DC at eusaamb109 dot ericsson dot se>
Maybe this is a clue. As far as I can tell, this problem only occurs when .text ends 0x200 bytes short of a 4KB page boundary. And in that case, if I replace the expression
. = ((__end_of_sdata2 + 4095) & ~ 4095) - __start_of_sdata2 ;
With a harcoded value:
. = 0x200
It works. The value of the two symbols use in the expression are this:
01c79e00 A __end_of_sdata2
01c79e00 A __start_of_sdata2
With the original expression, objdump shows this:
Idx Name Size VMA LMA File off Algn
0 .header 00000040 01640000 01640000 00010000 2**2
CONTENTS, ALLOC, LOAD, DATA
1 .text 00639dc0 01640040 01640040 00010040 2**5
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .data 00045698 01c7a000 01c7a000 0064a000 2**3
CONTENTS, ALLOC, LOAD, DATA
With the hardcoded 0x200, objdump shows this:
Idx Name Size VMA LMA File off Algn
0 .header 00000040 01640000 01640000 00010000 2**2
CONTENTS, ALLOC, LOAD, DATA
1 .text 00639dc0 01640040 01640040 00010040 2**5
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .sdata2 00000200 01c79e00 01c79e00 00649e00 2**0
ALLOC
3 .data 00045698 01c7a000 01c7a000 0064a000 2**3
CONTENTS, ALLOC, LOAD, DATA
--Doug