ld: EXTERN/--unresolved & unresolved Symbols
Ramana
ramana.venkat83@gmail.com
Mon Aug 2 09:11:00 GMT 2010
> 2) I can use --unresolved-symbols=ignore-all to simply ignore unresolved
> symbols. But is there _some_ way to resolve them later by linking a
> second time? Basically I link an executable 'foo' that has an unresolved
> symbol 'sym'. Now I want to link a second time and use something like
> --defsym=sym=0x200 to define 'sym'. When looking at the resulting
> executable with nm, 'sym' is shown there to be defined correctly as
> 0x200, however when executing 'foo' 'sym' is simply 0 (-> undefined).
You probably have to force the linker to generate relocations (-q or
--emit-relocs) into the executable image you are creating otherwise
linker doesn't know how to fix the unresolved symbol 'foo' correctly
even if it finds a definition of it.
Ram
Freescale Semiconductor, Inc
More information about the Binutils
mailing list