Google Groups unterstützt keine neuen Usenet-Beiträge oder ‑Abos mehr. Bisherige Inhalte sind weiterhin sichtbar.

How do we find out which object file is pulled in by the linker?

6 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Pritam

ungelesen,
20.11.2009, 20:51:2320.11.09
an
Hi,
Two object files foo_1.o and foo_2.o each have the same function a()
defined and they
have no other functions. foo_1.o is in a library specified prior to
the library including
foo_2.o

The linker would pull in only foo_1.o in this case. What option can I
give to gcc / ld to verify the above statement?

I looked at
http://stackoverflow.com/questions/715502/how-do-linkers-decide-what-...

and


http://www.lurklurk.org/linkers/linkers.html#staticlibs


I understand the theory behind it, I am looking at how to get the
visible proof w.r.t. what the linker is actually doing w.r.t. pulling
in the object
files.

Pritam

Jan Seiffert

ungelesen,
20.11.2009, 21:00:4220.11.09
an
Pritam schrieb:

This is not a GCC problem, but a problem with the linker.
You propably use the GNU binutils linker.
Please have a look at the Manual.
Maybe the --trace option helps.

(when invoking gcc as the linker driver pass it with -Wl,--trace to the linker)

> Pritam

Greetings
Jan

--
If you're sending someone Styrofoam, what do you pack it in?

Pritam

ungelesen,
20.11.2009, 21:25:4620.11.09
an
> If you're sending someone Styrofoam, what do you pack it in?- Hide quoted text -
>
> - Show quoted text -

Excellent! That's exactly what I was looking for.
Cheers,
Pritam

0 neue Nachrichten