This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/26699] LD doesn't link in an object from an archive when the object has only public variables



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-03-15 16:16 -------
First this is not a bug.

Lets look at your link line:
cc -o main -L. -ldata main.o

What is saying to the linker is look at libdata first for symbols that are
required already and then look at main.o.  Since main.o has a reference to
libdata, this fails as the linker are one pass linkers when looking for
symbols.  Change the order of the link line and it will work.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
          Component|c                           |other
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26699


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