public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ld script problems: tagging a section (NOLOAD)
@ 2001-10-19 18:22 Jack Tihon
  2001-10-22 18:42 ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Jack Tihon @ 2001-10-19 18:22 UTC (permalink / raw)
  To: binutils

Hi,

I seem to have problems with the "NOLOAD" language construct in an ld 
script. The script works with binutils-2.10, but not with 2.11.2.

Here's a snippet of salient information:

here's some code that tags the CSTACKS section NOLOAD.

CSTACKS (NOLOAD) : { *(CSTACKS) }


here's part of the  output of readelf -a from 2.11.2 (not working):

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg 
Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      
0   0  0
  [ 1] .init             PROGBITS        00400000 029000 00001c 00  AX  
0   0  1
  [ 2] .text             PROGBITS        0040001c 02901c 007980 00  AX  
0   0  4
  [ 3] .fini             PROGBITS        0040799c 03099c 00001c 00  AX  
0   0  1
  [ 4] .rodata           PROGBITS        004079b8 0309b8 0003c0 00   A  
0   0  8

    .....snipped....

 [19] CSTACKS           PROGBITS        00200000 009000 020000 00  WA  
0   0  4


And from 2.10 (working):

  [ 0]                   NULL            00000000 000000 000000 00       
0   0 0
  [ 1] _crt0_section     PROGBITS        00400000 029000 0000fc 00  AX   
0   0 1
  [ 2] .text             PROGBITS        004000fc 0290fc 008bb8 00  AX   
0   0 4
  [ 3] .rodata           PROGBITS        00408cb8 031cb8 0003b8 00   A   
0   0 8
  [ 4] .data             PROGBITS        00800000 033000 000734 00  WA   
0   0 8

  ....snipped.....

  [16] CSTACKS           NOBITS          00200000 009000 020000 00  WA   
0   0 4


Any ideas?

I'm running on a redhat-7.1 system. the config host triple is: 
i686-pc-linux-gnu
and the target triple is more or less a mipsel-elf target (with minor 
cosmetic changes)

thanks,

-jack


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ld script problems: tagging a section (NOLOAD)
  2001-10-19 18:22 ld script problems: tagging a section (NOLOAD) Jack Tihon
@ 2001-10-22 18:42 ` Alan Modra
  2001-10-23 11:41   ` Jack Tihon
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2001-10-22 18:42 UTC (permalink / raw)
  To: Jack Tihon; +Cc: binutils

On Fri, Oct 19, 2001 at 06:22:08PM -0700, Jack Tihon wrote:
> 
> I seem to have problems with the "NOLOAD" language construct in an ld 
> script. The script works with binutils-2.10, but not with 2.11.2.

readelf doesn't give enough detail to know whether you really have
lost "NOLOAD".  What does "objdump -h" show you?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ld script problems: tagging a section (NOLOAD)
  2001-10-22 18:42 ` Alan Modra
@ 2001-10-23 11:41   ` Jack Tihon
  2001-10-23 19:48     ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Jack Tihon @ 2001-10-23 11:41 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

Alan,

Judging from the output of objdump -h, it still doesn't look like NOLOAD 
is doing anything.
The section should not have the LOAD flag set.
 
Here's the output of "objdump -h":

hello:     file format elf32-littlemips

Sections:
Idx Name          Size      VMA               LMA               File 
off  Algn
  0 .init         0000001c  0000000000400000  0000000000400000  
00006000  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .text         00007ae0  000000000040001c  000000000040001c  
0000601c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE

    ...skipping a bit...

  8 .sbss         00000010  0000000000801cc8  0000000000801cc8  
0000fcc8  2**2
                  ALLOC
  9 .bss          00000120  0000000000801ce0  0000000000801ce0  
0000fcd0  2**4
                  ALLOC

    ...skipping some more...

 17 CSTACKS       00020000  0000000000fd0000  0000000000fd0000  
00010000  2**2
                  CONTENTS, ALLOC, LOAD, DATA


thanks,

-jack


Alan Modra wrote:

>On Fri, Oct 19, 2001 at 06:22:08PM -0700, Jack Tihon wrote:
>
>>I seem to have problems with the "NOLOAD" language construct in an ld 
>>script. The script works with binutils-2.10, but not with 2.11.2.
>>
>
>readelf doesn't give enough detail to know whether you really have
>lost "NOLOAD".  What does "objdump -h" show you?
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ld script problems: tagging a section (NOLOAD)
  2001-10-23 11:41   ` Jack Tihon
@ 2001-10-23 19:48     ` Alan Modra
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2001-10-23 19:48 UTC (permalink / raw)
  To: Jack Tihon; +Cc: binutils

On Tue, Oct 23, 2001 at 11:41:53AM -0700, Jack Tihon wrote:
> Judging from the output of objdump -h, it still doesn't look like NOLOAD 
> is doing anything.
> The section should not have the LOAD flag set.

OK, just wanted to check.  It is possible for you to put together a small
testcase so that we can debug this problem?

Alan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-10-23 19:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-19 18:22 ld script problems: tagging a section (NOLOAD) Jack Tihon
2001-10-22 18:42 ` Alan Modra
2001-10-23 11:41   ` Jack Tihon
2001-10-23 19:48     ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).