This is the mail archive of the binutils@sources.redhat.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]
Other format: [Raw text]

Re: undefined symbols in shared libraries


Hi Robert,

> -> g++ -Wl,-z,defs -fpic -shared -Wl,-soname,libTestCase_interGNUrt.so
> -o libTestCase_interGNUrt.so testCase_interGNUrt.o
>
> testCase_interGNUrt.o(.text+0x1d8): In function
> `testCase_inter::trigger2()':
> : warning: undefined reference to `testCase_exc::Propagate()'
>
> -> echo $status
> 0

Hmm, this really ought to generate errors...

> -> g++ -Wl,-z,defs -Wl,-no-allow-shlib-undefined -fpic -shared
> -Wl,-soname,libTestCase_interGNUrt.so -o libTestCase_interGNUrt.so
> testCase_interGNUrt.o
> [snip]
> /lib/libc.so.6: undefined reference to
> `_dl_lookup_versioned_symbol_skip@GLIBC_PRIVATE'
> collect2: ld returned 1 exit status

OK - this also looks good.  With -no-allow-shlib-undefined the
unresolved references in the shared library cause the link to fail,
returning an exit status of 1.


> g++ -Wl,-z,defs -Wl,-error-unresolved-symbols -fpic -shared
> -Wl,-soname,libTestCase_interGNUrt.so -o libTestCase_interGNUrt.so
> testCase_interGNUrt.o
>
> testCase_interGNUrt.o(.text+0x1d8): In function
> `testCase_inter::trigger2()':
> : warning: undefined reference to `testCase_exc::Propagate()'
>
> -> echo $status
> 0

This also ought to fail.


> I can supply the code for the test case if that is any help.

Please - unfortunately I am going to be away on vacation for the next
two weeks, so I will not be able to look at this problem until I get
back.

Cheers
        Nick
        


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