🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6240

SCO (iBCS2 COFF) binutils-2.6/ld won't link gcc-2.7.2 when -g

#6240
From: Rodney Brown
Date: Thu, 21 Dec 1995 00:00
68 lines
3795 bytes
On SCO3.2v4.1 building gcc-2.7.2 with gcc, CFLAGS=-g and using binutils-2.6
ld failed linking cc1 because the line number count (s_nlnno) overflowed
the unsigned short allocated in the COFF section header (struct scnhdr).
(/usr/include/sys/coff.h)
Using the SCO linker, cc1 built with the line number count wrapped.
gcc-2.7.2 built without problems with binutils-2.6 when the debug option
-g was removed.
This means that gcc-2.7.2 cannot be built with -g when targetting
Intel 386 iBSC2 COFF binaries, without either building some objects
without -g or accepting truncation of the line number list by vendor
linkers.

Otherwise, bouquets to binutils-2.6 ld for compressing COFF debugging info
- the resultant filesizes are smaller than from SCO's cprs for gcc-compiled
binaries.

binutils-2.6/ld could set s_nlnno to 0xFFFF and issue a warning, so that
the link could complete, since the COFF section header will be intact even
if s_nlnno is wrong. A clearer error message could be useful.
ie "Too many debug line numbers %d for COFF section header count."
With SCO moving to ELF in OpenServer 5, fixing this should be of low priority.


ld version 2.6 (with BFD 2.6)

Reading specs from /usr/local/lib/gcc-lib/i486-unknown-sco3.2v4.1/2.7.2/specs
gcc version 2.7.2
 /usr/local/lib/gcc-lib/i486-unknown-sco3.2v4.1/2.7.2/ld -o cc1 /lib/crt1.o \
 /usr/local/lib/gcc-lib/i486-unknown-sco3.2v4.1/2.7.2/crtbegin.o \
 -L/usr/local/lib/gcc-lib/i486-unknown-sco3.2v4.1/2.7.2 \
 -L/usr/local/i486-unknown-sco3.2v4.1/lib -L/usr/local/lib c-parse.o c-lang.o \
 c-lex.o c-pragma.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o \
 c-iterate.o toplev.o version.o tree.o print-tree.o stor-layout.o \
 fold-const.o function.o stmt.o expr.o calls.o expmed.o explow.o optabs.o \
 varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o real.o dbxout.o sdbout.o \
 dwarfout.o xcoffout.o integrate.o jump.o cse.o loop.o unroll.o flow.o \
 stupid.o combine.o regclass.o local-alloc.o global.o reload.o reload1.o \
 caller-save.o insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o \
 insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o \
 insn-attrtab.o i386.o getpwd.o convert.o bc-emit.o bc-optab.o obstack.o \
 -lmalloc -lPW -lgcc -lc -lgcc \
 /usr/local/lib/gcc-lib/i486-unknown-sco3.2v4.1/2.7.2/crtend.o /lib/crtn.o
cc1: line number overflow: 0x10eef > 0xffff
cc1: final close failed: File truncated

SCO dump -h cc1 as linked by SCO ld
NB 3823 == 0xeef

			***SECTION HEADER***
	Name        Paddr       Vaddr       Scnptr      Relptr     Lnnoptr
	            Flags                    Size       Nreloc      Nlnno

cc1:
	.text     0x000000d0  0x000000d0  0x000000d0  0x00000000  0x001a5bd8
	          0x00000020              0x0019f178        0        3823
								     ^^^^ *****

	.data     0x00400248  0x00400248  0x0019f248  0x00000000  0x00000000
	          0x00000040              0x00006904        0           0

	.bss      0x00406b4c  0x00406b4c  0x00000000  0x00000000  0x00000000
	          0x00000080              0x00010fe0        0           0

	.comment  0x00000000  0x00000000  0x001a5b4c  0x00000000  0x00000000
	          0x00000200              0x0000008c        0           0

-- 
Rodney Brown,  Co-Cam Computer Group,  ACSNet: RBrown@cocam.com.au
Technical Details
Message-ID: <199512220151.LAA19066@cocamrd.cmutual.com.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,1452b4fb83af2e7d,start
X-Google-Attributes: gid113d02,public
From: RBrown@cmutual.com.au (Rodney Brown)
Subject: SCO (iBCS2 COFF) binutils-2.6/ld won't link gcc-2.7.2 when -g
Date: 1995/12/21
Message-ID: <199512220151.LAA19066@cocamrd.cmutual.com.au>
X-Deja-AN: 122498330
distribution: gnu
sender: daemon@cis.ohio-state.edu
organization: GNUs Not Usenet
newsgroups: gnu.gcc.bug