News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

duplicate symbol error

Started by bushpilot, October 12, 2005, 09:37:21 PM

Previous topic - Next topic

bushpilot

Hi Jeremy,

From the GoAsm helpfile:

QuoteUse single object files only
Currently GoAsm does not support calling the same library functions from more than one module (source script). If you do this you will see "duplicate symbol" errors from the linker. Instead you need to concentrate all library calls to the same function in a library in one source script. In later versions of GoAsm and GoLink support will be added for calls to the same library function in more than one source script if this would be helpful to users.

I would find this change very helpful, when you are able to do it.  For now I am using MS link (or polink) instead for certain projects.

Greg

jorgon

Noted, Greg.

I'll put this request in one of my "to-do" lists.

You will appreciate that the reason for the restriction is that GoAsm deals with library calls at the time of assembly rather than at the time of linking, hence calling a library function from two source scripts results in the code for that function (and its label) being in two diferent object files.  The solution is for GoAsm to mark for the linker all those functions, sub-functions and data labels which originate from library calls.  Duplicates can then be ignored.

For the time being I suppose you could concentrate all your internal functions requiring library function calls in one source script.  Then from other source scripts just call the internal function instead of calling the library function.
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

bushpilot

Yeah, that might work.  Thanks.

Greg