This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Section (.sdata2) being omitted but SIZEOF(.sdata2) is not zero?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]