🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50667

Getting .bss to trail .data with linker script

#50667
From: Sam C. Nicholson !!
Date: Thu, 02 Sep 1993 14:43
46 lines
1630 bytes
Greetings;

With the following linker script, the bss section is loaded
at 0.  If load addresses are not specified for text and data, then
bss follows data, as memory is filled, of course.

How does one request the linker to put bss right after data?

Before using linker scripts I used the command line options:
        -T  text 0x1000 -T data -x1fc000
and the bss was loaded right after data.

If someone knows the answer, an email would be most welcome.

Thanks
-sam

-------------------- linker script --------------------------

OUTPUT_FORMAT("a.out-sunos-big")
OUTPUT_ARCH(m68k)

SECTIONS
{
  .text 0x1000 :
  {
    CREATE_OBJECT_SYMBOLS
    _text_start = .;
    _osExecHdr = . - SIZEOF_HEADERS;
    *(.text)
   _etext = .; 
  }
  .data 0x1fc000 :
  {
    _data_start = .;
    *(.data)
    _edata = .;
    
  }
  .bss  :
  {
   *(.bss)
   *(COMMON)
   ;
  }
}
Technical Details
Message-ID: <m8c1koINNj34@utkcs2.cs.utk.edu>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!emory!cs.utk.edu!cs.utk.edu!usenet

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,e2037cab059e9cc6,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-09-02 07:52:24 PST
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!emory!cs.utk.edu!cs.utk.edu!usenet
From: Sam C. Nicholson !! <scion@netimage.com>
Newsgroups: gnu.gcc.help
Subject: Getting .bss to trail .data with linker script
Date: 2 Sep 93 14:43:36 GMT
Organization: Network Imaging Systems -- Herndon, VA
Lines: 46
Distribution: world
Message-ID: <m8c1koINNj34@utkcs2.cs.utk.edu>
NNTP-Posting-Host: utkcs2.cs.utk.edu
Summary: when .data gets loaded not behind .text, .bss reverts to 0
Keywords: gnu linker script