🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50831

how to get S-records from GNU ld?

#50831
From: Eric Smith
Date: Thu, 05 Aug 1993 07:36
37 lines
2209 bytes
I recently build GCC 2.4.5 and Binutils 2.2.1 to cross-develop from BSDI-386
to a 68k embedded target.  I think I've finally gotten everything built
correctly with some help from people on the net.  Especially valuable was a
posting to comp.sys.m68k on July 7, 1993 by Gerd Truschinski,
gt@prosun.first.gmd.de), detailing how to configure and build the tools
for cross development.  Now I'd like to get S-records from the linker.

For my first compile of my test program, I had the following in my Makefile:

LDFLAGS = -M -Ttext 402000

which seems to work fine, generating an a.out-format file.  I tried setting
the environment variable GNUTARGET to "srec", but I still got an a.out-format
file.  Next I tried:

LDFLAGS = -M -Ttext 402000 { OUTPUT_FORMAT\(\"srec\"\) }

and I get complaints like "ld: Can't open OUTPUT_FORMAT".  I thought maybe
I had a quoting problem, so I tried a bunch of variations with no luck.
Then I tried creating a file test.sc containing the single line:

OUTPUT_FORMAT("srec")

and changed my Makefile to:

LDFLAGS = -M -T test.sc -Ttext 402000

Which gives the message "ld can't set the address of undefined section .text".
If I leave off the -Ttext 402000, It links fine and I get my S-records, but
not at the address I want.

Is there some simple way to get S-record format output, preferrably from the
command line without using a script?  I've tried writing a script and can't
seem to get that right either.

Thanks!
Eric
Technical Details
Message-ID: <ERIC.93Aug4233622@iceland.telebit.com>
Path: arc1-ca.pugleaf.net!gmd.de!rrz.uni-koeln.de!news.dfn.de!darwin.sura.net!haven.umd.edu!uunet!nntp.telebit.com!news

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,f86e43a8f013d0b3,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: feb3e,f86e43a8f013d0b3,start
X-Google-Attributes: gidfeb3e,public
X-Google-ArrivalTime: 1993-08-05 11:03:01 PST
Newsgroups: gnu.gcc.help,comp.sys.m68k
Path: arc1-ca.pugleaf.net!gmd.de!rrz.uni-koeln.de!news.dfn.de!darwin.sura.net!haven.umd.edu!uunet!nntp.telebit.com!news
From: eric@telebit.com (Eric Smith)
Subject: how to get S-records from GNU ld?
Message-ID: <ERIC.93Aug4233622@iceland.telebit.com>
X-Disclaimer: Everything I write is false.
Sender: news@telebit.com
Nntp-Posting-Host: iceland
Organization: Telebit Corporation
Date: Thu, 5 Aug 1993 07:36:22 GMT
Lines: 37