windows 64bit linker and yasm error: LNK1234

Programming, for all ages and all languages.
Post Reply
HJED
Member
Member
Posts: 61
Joined: Tue Sep 04, 2007 4:18 am
Location: the world wide web
Contact:

windows 64bit linker and yasm error: LNK1234

Post 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
.................................. um what should i put here .............................?..........................................
..... :D................
HJED
Member
Member
Posts: 61
Joined: Tue Sep 04, 2007 4:18 am
Location: the world wide web
Contact:

Post 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
.................................. um what should i put here .............................?..........................................
..... :D................
User avatar
kmcguire
Member
Member
Posts: 120
Joined: Tue Nov 09, 2004 12:00 am
Location: United States
Contact:

Post 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.
HJED
Member
Member
Posts: 61
Joined: Tue Sep 04, 2007 4:18 am
Location: the world wide web
Contact:

Post 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
.................................. um what should i put here .............................?..........................................
..... :D................
HJED
Member
Member
Posts: 61
Joined: Tue Sep 04, 2007 4:18 am
Location: the world wide web
Contact:

Post by HJED »

dose anyone know how to fix this?
.................................. um what should i put here .............................?..........................................
..... :D................
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

HJED wrote:dose anyone know how to fix this?
euhm, use ELF? :roll:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
HJED
Member
Member
Posts: 61
Joined: Tue Sep 04, 2007 4:18 am
Location: the world wide web
Contact:

Post by HJED »

the Microsoft linker only excepts win64 files.
and my c++ files are also compiled in the win64 format
.................................. um what should i put here .............................?..........................................
..... :D................
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Post 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.
HJED
Member
Member
Posts: 61
Joined: Tue Sep 04, 2007 4:18 am
Location: the world wide web
Contact:

Post 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
.................................. um what should i put here .............................?..........................................
..... :D................
Post Reply