Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!psuvax1!gondor.psu.edu!schwartz From: schwartz@gondor.psu.edu (Scott E. Schwartz) Newsgroups: comp.lang.c Subject: Loader features (was Re: bug (?) in 4.(2,3)?) Message-ID: <2974@psuvax1.psu.edu> Date: Sun, 4-Oct-87 01:36:14 EDT Article-I.D.: psuvax1.2974 Posted: Sun Oct 4 01:36:14 1987 Date-Received: Wed, 7-Oct-87 04:48:29 EDT References: <462@eplrx7.UUCP> <896@mcgill-vision.UUCP> Sender: netnews@psuvax1.psu.edu Reply-To: schwartz@gondor.psu.edu (Scott E. Schwartz) Organization: Penn State University, University Park, PA Lines: 22 Keywords: external declaration of a system call, loader behavior In article <896@mcgill-vision.UUCP> mouse@mcgill-vision.UUCP (der Mouse) writes:+--- |In article <462@eplrx7.UUCP>, lad@eplrx7.UUCP (Lawrence Dziegielewski) writes: |> [re conflict between a variable "fstat" and the syscall] |> [program with fstat variable dies: stdio uses fstat() the syscall] | |Why? You haven't redeclared fstat. The *loader* should warn, but |currently can't because all it sees in stdio is "reference to external |undefined" which it can't check against "definition of external data" - |it doesn't know it should be "...external text". If the compiler and |loader cooperated, the loader could complain about satisfying a text |segment reference with a data segment symbol. | | der Mouse +--- How about if the loader made sure that each undefined external resolves to exactly one defined object? In other words if ld is working on resolving `fstat' and finds an `int fstat' in the object file and an `int fstat()' in a library it should flag this with a warning. -- Scott Schwartz schwartz@gondor.psu.edu