[Info-vax] Linking problem with multiply defined symbols, how to resolve?

chris chris-nospam at tridac.net
Thu Sep 29 11:09:06 EDT 2022


On 9/28/22 08:33, Richard Levitte wrote:
> Hi all!
> 
> I have this problem, that I want to build an app or a shareable image, which is linked with another shared library, but which also implements its own variant of symbols that are defined in that other shared library.
> 
> This is intentional.  It works absolutely fine to do this on the Unixen I've access to, as well as on Windows...  but VMS fails me.
> 
> Is this at all possible, or must I seek another method to get what I want?
> (there is the possibilty to link with a .OLB library instead of a shareable image, but I'd like to explore the possibilities a little more before I resort to that)
> 
> An example below.  legacy-dso-legacyprov.OBJ defines all the ERR symbols that LINK complains about, and they are also defined by OSSL$libcrypto03_shr.EXE.
> 
> ----------8<----------
> OPEN/WRITE/SHARE=READ OPT_FILE [.providers]legacy-components.OPT
> WRITE OPT_FILE "[.crypto]legacy-dso-cpuid.OBJ,-"
> WRITE OPT_FILE "[.crypto]legacy-dso-ctype.OBJ,-"
> WRITE OPT_FILE "[.crypto]legacy-dso-mem_clr.OBJ,-"
> WRITE OPT_FILE "[.providers]legacy-dso-legacyprov.OBJ"
> WRITE OPT_FILE "[.providers]liblegacy.OLB/LIB"
> WRITE OPT_FILE "[.providers]libcommon.OLB/LIB"
> WRITE OPT_FILE "[]OSSL$libcrypto03_shr.EXE/SHARE"
> CLOSE OPT_FILE
> LINK /MAP='F$PARSE(".MAP","[.providers]legacy.EXE")' /NODEBUG/NOTRACEBACK/SHARE=[.providers]legacy.EXE [.providers]legacy.OPT/OPT, [.providers]legacy-components.OPT/OPT
> %ILINK-W-MULDEF, symbol CRYPTO_memcmp multiply defined
> 	module: CPUID
> 	file: USR_DISK:[RICLE.TEST.openssl-3_1_0-dev.crypto]legacy-dso-cpuid.OBJ;1
> %ILINK-W-MULDEF, symbol OPENSSL_cleanse multiply defined
> 	module: MEM_CLR
> 	file: USR_DISK:[RICLE.TEST.openssl-3_1_0-dev.crypto]legacy-dso-mem_clr.OBJ;1
> %ILINK-W-MULDEF, symbol ERR_clear_last_mark multiply defined
> 	module: LEGACYPROV
> 	file: USR_DISK:[RICLE.TEST.openssl-3_1_0-dev.providers]legacy-dso-legacyprov.OBJ;1
> %ILINK-W-MULDEF, symbol ERR_new multiply defined
> 	module: LEGACYPROV
> 	file: USR_DISK:[RICLE.TEST.openssl-3_1_0-dev.providers]legacy-dso-legacyprov.OBJ;1
> %ILINK-W-MULDEF, symbol ERR_pop_to_mark multiply defined
> 	module: LEGACYPROV
> 	file: USR_DISK:[RICLE.TEST.openssl-3_1_0-dev.providers]legacy-dso-legacyprov.OBJ;1
> %ILINK-W-MULDEF, symbol ERR_set_debug multiply defined
> 	module: LEGACYPROV
> 	file: USR_DISK:[RICLE.TEST.openssl-3_1_0-dev.providers]legacy-dso-legacyprov.OBJ;1
> %ILINK-W-MULDEF, symbol ERR_set_error multiply defined
> 	module: LEGACYPROV
> 	file: USR_DISK:[RICLE.TEST.openssl-3_1_0-dev.providers]legacy-dso-legacyprov.OBJ;1
> %ILINK-W-MULDEF, symbol ERR_set_mark multiply defined
> 	module: LEGACYPROV
> 	file: USR_DISK:[RICLE.TEST.openssl-3_1_0-dev.providers]legacy-dso-legacyprov.OBJ;1
> %ILINK-W-MULDEF, symbol ERR_vset_error multiply defined
> 	module: LEGACYPROV
> 	file: USR_DISK:[RICLE.TEST.openssl-3_1_0-dev.providers]legacy-dso-legacyprov.OBJ;1
> ----------8<----------
> 
> Cheers,
> Richard


Can you use the "weak" keyword with one of the sets of symbols, which
automatically gets over ridden at link time in favour of another
conventionally defined same ident symbol at link time ?.

It's typically used in embedded work as a placeholder, say in interrupt
vector tables to a provide a default handler, where the actual handler
has not yet been written...

Chris









More information about the Info-vax mailing list