When do symbols remain undefined in an object?
Symbols can also remain undefined when a symbol reference in a relocatable object is bound to a symbol definition in an implicitlydefined shared object. For example, continuing with the files main.cand foo.cused in the previous example:
What happens if a weak symbol is not bound?
Weak symbol references that are not bound during a link-edit do not result in a fatal error condition, no matter what output file type is being generated. If a static executable is being generated, the symbol is converted to an absolute symbol and assigned a value of zero.
What happens to a symbol in a dynamic executable?
If a static executable is being generated, the symbol is converted to an absolute symbol and assigned a value of zero. If a dynamic executable or shared object is being produced, the symbol will be left as an undefined weak reference.
Symbols can also remain undefined when a symbol reference in a relocatable object is bound to a symbol definition in an implicitly defined shared object. For example, continuing with the files main.cand foo.cused in the previous example.
Where can I find the symbol’inflateend’?
$ objdump -TC /lib/libz.so.1 | grep End 0000000000005f00 g DF .text 00000000000000cf Base deflateEnd 000000000000a050 g DF .text 0000000000000067 Base inflateEnd 0000000000007800 g DF .text 0000000000000036 ZLIB_1.2.0 inflateBackEnd ….
How to get rid of undefined symbols in linker?
This default behavior allows the shared object to import symbols from a dynamic executable that defines the shared object as a dependency. The link-editor’s -z defsoption can be used to force a fatal error if any undefined symbols remain.
What happens if a symbol reference is unavailable?
If an unavailable symbol reference is required during the execution of a process, a fatal runtime relocation error occurs. This error might be detected during the initial execution and testing of an application.