Article View: net.bugs.2bsd
Article #133ld(1) "local symbol botch" bug fix
From: Dave borman
Date: Mon, 02 Jul 1984 15:44
Date: Mon, 02 Jul 1984 15:44
43 lines
1860 bytes
1860 bytes
Subject: V7 ld bug
Newsgroups: net.bugs.2bsd net.bugs.v7
Have you seen the annoying message "local symbol botch" coming from ld?
We recently ran into a program that was consistent in producing this
error, so I was able to track down this instance of it. Seems the
problem is in ld.c where it declares what an a.out header looks like.
About 100 lines down in ld.c we have:
struct {
int fmagic;
int tsize;
int dsize;
int bsize;
int ssize;
int entry;
int pad;
int relflg;
}
This should be changed to:
struct {
int fmagic;
unsigned tsize;
unsigned dsize;
unsigned bsize;
unsigned ssize;
unsigned entry;
unsigned pad;
unsigned relflg;
}
which is how it is declared in a.out.h. The problem occures
when an individual module has a text or data size that wraps
around and goes negative. In load2() we have the line
dseek(&text, loc + filhdr.tsize + filhdr.dsize, filhdr.ssize);
Well, if filhdr.dsize or filhdr.tsize is negative, it will get sign
extended before being added, dseek then gets the wrong value and
eventually you wind up with the "local symbol botch" message.
This problem is known to exist in V7, 2.9BSD (and probably 2.8BSD).
I have no idea if it is in SYSIII or SYSV, I don't have online sources
to look at.
-Dave Borman, Digital UNIX Engineering Group
decvax!borman
Technical Details
Message-ID:
<29@decvax.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!linus!decvax!bormanShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site decvax.UUCP Path: arc1-ca.pugleaf.net!utzoo!linus!decvax!borman From: borman@decvax.UUCP (Dave borman) Newsgroups: net.bugs.2bsd,net.bugs.v7 Subject: ld(1) "local symbol botch" bug fix Message-ID: <29@decvax.UUCP> Date: Mon, 2-Jul-84 11:44:37 EDT Article-I.D.: decvax.29 Posted: Mon Jul 2 11:44:37 1984 Date-Received: Tue, 3-Jul-84 04:39:59 EDT Organization: DEC UNIX Engineering Group Lines: 44