> -----Original Message-----
> From: owner-freebsd-questi...@freebsd.org [mailto:owner-freebsd-
> questi...@freebsd.org] On Behalf Of Anton Shterenlikht
> Sent: Tuesday, February 01, 2011 9:08 AM
> To: freebsd-questions@freebsd.org
> Subject: same function name in multiple archives - bad idea?
>
> Is it wrong to have functions with the same name
> in multiple archives? E.g:
>
> % ar -t /usr/local/lib/libslatec.a | grep fdump.o
> fdump.o
> % ar -t /usr/local/lib/libcmlib.a | grep fdump.o
> fdump.o
>
> Which "fdump" function will be used if I then link
> against -larchive1.a -larchive2.a?
>
> And is there an easy way to find functions belonging
> in multiple archives?
>

Anton,

I believe for ELF images the linker will stop looking after finding it, so the
order of -l<library> controls which one will be used.  If you want to see which
one was used during linking, use the ld options '-M -Map <mapfile> --cref' which
will create a map file with cross references.

Patrick

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to