linker unresolved makes an executable?

linker unresolved makes an executable?

Post by Marty Leisn » Sun, 11 Oct 1992 06:16:53



I have a Sun Sparc (running 4.1.2).

When I have undefined externals, the linker is making an executable.
So rerunning make says: nothing to do.

What am I doing wrong?  I remember undefined externals didn't make executables...


          Member of the League for Programming Freedom
 The Feynman Problem Solving Algorithm:
 1) Write down the problem
 2) Think very hard
 3) Write down the answer     -- Murray Gell-mann

 
 
 

linker unresolved makes an executable?

Post by d.. » Wed, 14 Oct 1992 04:45:43



>I have a Sun Sparc (running 4.1.2).

>When I have undefined externals, the linker is making an executable.
>So rerunning make says: nothing to do.

>What am I doing wrong?  I remember undefined externals didn't make executables...

  If you look at the permissions of the executable, you should see that the
application DOES NOT have execute permissions.  If the linker succeeded, then
execute permission would have been assigned to the application, but since it
failed, it wasn't assigned.  I suppose some linkers still give it execute
permissions even if it failed but it shouldn't.  As for make not rebuilding it
the second time - it will not because as far as make is concerned, the file
(a.out or whatever) exists with the proper date stamp relative to all of the
object code/library.  You'll need to update your make file with the following;

a.out : dependencies for a.out here
   -cc -o a.out .... linker command here // put a - as the first letter on line

   then \
      rm a.out \
   fi

Now, when the linker is called (in this example the linker is cc) it will fail
due to the unresolved externals.  However, since we put a - as the first letter
on this line, make will not quit ( it supresses make from quiting from such
errors ).  Then on the next four lines, we check to see if the application that
was created has execute permission.  If it does not then we will delete it

silently ).  The next time you run make, the application will not exist so make
will attempt to relink it.

--

post += disclaimer;                   Sadtler Research Labs, Philadelphia
-------------------------------------------------------------------------

 
 
 

1. xlC - linker error: unresolved system call BUT it is in libc

Hi,

I have a problem trying to use the system call getprocs().  There is no
declaration of this anywhere in /usr/include although the header file
procinfo.h is present with declarations for the data structures passed
as parameters to getprocs.  I have tried declaring getprocs as extern in
my source which gets past the compiler but the linker gives the error:

ld: 0711-317 ERROR: Undefined symbol:
.getprocs(procsinfo*,int,fdsinfo*,int,int*,int)

nm of libc.a gives the following references to getprocs:

getprocs             d     276512       4
getprocs             U          -
.getprocs            T    1219264
.getprocs            t    1219264      40

Can anyone help please.

Brian.

2. Does bash support arrays?

3. linker (ld) and executable sizes

4. ObjectStore code verification Problems !

5. Getting symbol table from executable, or linker...

6. TrueType fonts server ???

7. Making AIX bizarro Linker work with GNU?

8. tcpdump packet matcher broken

9. Making emacs file executable

10. making txt files executable?

11. Making an executable shared object

12. Making a binary executable memory resident

13. Making ppp-on executable