Author Topic: Can not link with Borland C++ linker(ilink32) ?  (Read 6115 times)

Offline ittechbay

  • New Member
  • Posts: 1
Can not link with Borland C++ linker(ilink32) ?
« on: August 21, 2013, 07:28:11 AM »
my code is:
; file name: test.asm
 USE32
[SECTION .text]
..start:
move ax,1

I use nasm to compile: nasm -f obj  test.asm
when I use ilink32:
ilink32 test.obj
 Fatal: Unsupported 16-bit segment <s> in modle test.asm


how should I use nasm+ilink32 to compile asm?

Offline encryptor256

  • Full Member
  • **
  • Posts: 250
  • Country: lv
  • Win64 .
    • On Youtube: encryptor256
Re: Can not link with Borland C++ linker(ilink32) ?
« Reply #1 on: August 21, 2013, 07:56:11 AM »
Hi!

Maybe you need to give him more parameters, to specify expected result.
For example i use linker ALINK, i feed him like this:

"alink -c -oPE -subsys windows  myfile.obj"

Or maybe like this for segment: "[SECTION .text use32]", might help.

Its all about experimenting. :)

----------------------------------

EDIT: Maybe it cant find end of the .text segment, maybe it needs "ret" at the end of your code, like this:

Code: [Select]
use32
[section .text use32]
..start:
move ax,1
ret
« Last Edit: August 21, 2013, 08:13:06 AM by encryptor256 »
Encryptor256's Investigation \ Research Department.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Can not link with Borland C++ linker(ilink32) ?
« Reply #2 on: August 21, 2013, 08:56:25 AM »
Code: [Select]
section .text use32 class=CODE
... as encryptor256 suggests... "use32" at the top of the file (alias for "bits 32") does not make the individual sections 32-bit.

Nasm's 32-bit extensions to "-f obj" are kinda half-baked. Best bet is to assemble with "-f win32" and convert to OMF using Agner Fog's "objconv" if you want to keep Borland's tools happy.

Best,
Frank