Page 1 of 1

windows 64bit linker and yasm error: LNK1234

Posted: Tue May 27, 2008 1:36 am
by HJED
hi
for some reason I get the following error whenever I try to link my code

Code: Select all

Processed /NODEFAULTLIB (suppressing all default libs)

Starting pass 1
start.obj : fatal error LNK1234: corrupt or invalid public symbols
could someone please tell me how to fix this
start.obj is assembled in yasm using win64 format with Bits 64 set inside the file
the linker is the windows SDK v6.1 x64 linker
multipull c++ .obj compiled by the windows sdk compiler are also supposed to be linked at the same time.
but the linker dose not complain about them
i am assembling the yasm code with the following options

Code: Select all

 yasm -Xvc -f win64 -m amd64 --force-strict  -o \intermediate\start.obj -rnasm -pnasm start.asm
i have checked the Microsoft help files it says that error 1234 is a corrupt public symbol table. but this dose not help me as i do not know what this is or how to fix it

thanks in advance for any help

Posted: Wed May 28, 2008 2:51 pm
by HJED
Please help me i have no idea what is causing the error

YASM dose output a few warnings:

Code: Select all

C:\Documents and Settings\HandE\My Documents\harry house data\HSim\OSstuff\HIGHL
ONGMODEKERNAL\HIGHLONGMODEKERNAL\start.asm(252) : warning: `ds' segment register
 ignored in 64-bit mode
C:\Documents and Settings\HandE\My Documents\harry house data\HSim\OSstuff\HIGHL
ONGMODEKERNAL\HIGHLONGMODEKERNAL\start.asm(253) : warning: `es' segment register
 ignored in 64-bit mode
C:\Documents and Settings\HandE\My Documents\harry house data\HSim\OSstuff\HIGHL
ONGMODEKERNAL\HIGHLONGMODEKERNAL\start.asm(429) : warning: `ds' segment register
 ignored in 64-bit mode
C:\Documents and Settings\HandE\My Documents\harry house data\HSim\OSstuff\HIGHL
ONGMODEKERNAL\HIGHLONGMODEKERNAL\start.asm(430) : warning: `es' segment register
 ignored in 64-bit mode
i do not see how this affects the error though

Posted: Wed May 28, 2008 6:59 pm
by kmcguire
May I see the command line when you invoke the linker.

From my reading it appears that you are doing everything correct so far. I have read that the AMD64 linker in the SDK will link object files produced by Yasm using the WIN64 format.

Posted: Thu May 29, 2008 1:41 am
by HJED
the command line for the linker is
link.exe /VERBOSE /OUT:.\HIGHLONGMODEKERNAL.exe /FORCE:UNRESOLVED /OPT:ICF /FIXED:No /NOLOGO /ALIGN:4096 /filealign:0x1000 /MANIFEST:NO /NODEFAULTLIB /DEBUG /MACHINE:x64 /MAP:.\MAPS\Map.txt /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DRIVER /OPT:ICF /LTCG /ENTRY:"start" /ERRORREPORT:PROMPT ./intermediate/*.obj
yasm version is 0.7.1
thanks for any help

Posted: Fri May 30, 2008 4:05 pm
by HJED
dose anyone know how to fix this?

Posted: Sat May 31, 2008 10:16 am
by Combuster
HJED wrote:dose anyone know how to fix this?
euhm, use ELF? :roll:

Posted: Sat May 31, 2008 7:10 pm
by HJED
the Microsoft linker only excepts win64 files.
and my c++ files are also compiled in the win64 format

Posted: Sun Jun 01, 2008 1:49 am
by jnc100
If you're determined to try and use yasm and the win64 linker together then I'm probably right in saying that there is very little experience with the combination. My only suggestion is to compile a binutils that targets the win64 format (I think we established in another thread somewhere that binutils does support this) and then use objdump to examine this supposed invalid symbol table and check for any obvious problems.

Regards,
John.

Posted: Sun Jun 01, 2008 2:56 am
by HJED
using microsofts DUMPBIN tool which i think is the equvilant of dumpobj (i hate bulding cross compilers that is why i was using visual c++ in the first place!)
i found that one of my methods had been incorrectly globlized ( i had put global .foo insted of global _foo):oops:



Thanks for the help :D