This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

stupid ld tricks


I'm trying to use the -Bstatic -Bdynamic flags to ld to link certain
libraries statically to my application and others dynamically.

I had hoped something like this would work:

    cc -o app.o -c app.c
    ld -o app app.o -Bstatic -la -Bdynamic -lb -lc

Unfortunately, I get this error:

    ld: warning: cannot find entry symbol _start; defaulting to 08048184

and although the application is produced, trying to run it results in
this error message:

    bash: ./app: No such file or directory

Even though it *is* there:

    -rwxrwxr-x    1 msterret prog         7582 Jun 21 18:06 app*

This is all happening on a pretty stock RedHat 6.2 system with binutils
2.9.5.0.22 (RedHat release 6 if that matters).  cc is egcs-1.1.2 (RedHat
release 30).

If I use cc instead of ld to link, I get a good executable file,
but then I lose the abiltiy to individually indicate which libraries
are statically linked and which ones are dynamically linked I think.
When using -Bstatic/-Bdynamic with cc, cc seems to just ignore the flags.

Can someone please tell me what I'm doing wrong?  I'm getting a little
desperate and certainly frustrated.  This is not working at all the way
I think it should.

Michael Sterrett
  -Mr. Bones.-
michael.sterrett@coat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]