🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #978

Mix'n match with GLD/binutils-2.0

#978
From: Andrew Smith
Date: Wed, 30 Sep 1992 20:29
52 lines
2661 bytes
I am trying to mix architectures and file formats as input to GLD and
have some problems.

I want to persuade GLD to link a "coff-a29k-big" file containing only
a .data section into a 68k program which is otherwise 
"a.out-sunos-big"/"m68k:68020" input files. e.g.

gld -o test m68k.o -b coff-a29k.big a29kdata.o  -T memmap.sc etc.

"memmap.sc" script file specifies OUTPUT_FORMAT("a.out-sunos-big") 
and OUTPUT_ARCH("m68k:68020"). 

GLD is perfectly happy with this and it produces an output file and
link map (with -M). The link map looks fine - GLD seems to have done
the correct thing with relocations, and has placed my 29k .data input
file into the output with the correct address/size.
In fact, everyone is happy with this, including nm,objdump and my own
utilities which use BFD to read binary files.

But, I need m68k-coff output files and I normally use 
OUTPUT_FORMAT("m68k-coff") in my .sc file. This works fine normally 
(except a bunch of debug info is lost, but that is another story) 
except when I link in my 29k data file. 
Then, the file output by GLD is bad: all the other binutils 
(nm,objdump etc.) as well as my own tools which use BFD complain 
that the output file is "not an object file". 

It seems that GLD has written the wrong (or illegal) file type 
into the output file when it got confused 
about the OUTPUT_FORMAT/TARGET formats. Any "-b" input switches
specified on the command line seem also to affect the OUTPUT_FORMAT
currently being generated which is wrong - the documentation says
that "-b" applies to input file format, not output format.


Any ideas? I think the problem is in the A.OUT -> COFF mapping.
Does anyone have a newer binutils/BFD version which fixes this
problem (Ian?). Or a GAS which correctly produces COFF output for m68k?
Does the new hot-off-the-press/super-vintage-shrink-wrapped Cygnus
release have any improvements in this area?

I think it is a reasonable thing to want to do: it is only
.data from different processor architectures that I am trying to mix,
not .text.


Also, minor gripe, GLD sends warning messages to stdout, not to stderr.
Is this a bug or a feature?


Andrew Smith
SynOptics Communications Inc.
Technical Details
Message-ID: <9209302029.AA25776@milliways>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!synoptics.com!asmith

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!synoptics.com!asmith
From: asmith@synoptics.com (Andrew Smith)
Subject: Mix'n match with GLD/binutils-2.0
Message-ID: <9209302029.AA25776@milliways>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 30 Sep 1992 20:29:56 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 53