Author Topic: Turbo link reports "Bad object"  (Read 8402 times)

nobody

  • Guest
Turbo link reports "Bad object"
« on: October 11, 2004, 10:30:47 PM »
I have been assembling my sources with

nasm -fobj -g file.asm

and linking them with

tlink /v file.obj

This worked fine and when I needed I could go into Turbo Debugger to check something out. A few days ago, the link step started complaining "Bad object file file.obj" and refusing to create an executable. However, if I removed the "/v" option, the link completed and the executable ran fine. Sometimes, I would "get lucky" and was able to link in debug mode, but not consistently.

I'm afraid this is not something for a beginner to try to investigate, but if somebody has any suggestions, I'd be glad to give them a try. I'm using NASM 0.98.38 on Win XP SP 2 (SP2 must be the problem, right :-) and tlink 3.0.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2373
  • Country: us
Re: Turbo link reports "Bad object"
« Reply #1 on: October 13, 2004, 07:58:40 AM »
I wish we could blame it on SP2... or that storm of "cosmic rays" we had a few days ago, when it started acting up :) But I'm afraid it's a Nasm bug.

The "-g" switch never did work 100% correctly. One bug report we had said it made tlink (and if it linked, TD) "act like a barral of sexed-up monkees" :) Alexei Frounze put some time into it a while ago, and improved it considerably. From what you're seeing, it apparently still isn't right.

You're right that a beginner shouldn't have to investigate this problem... but nobody else uses TD :) If you *can* notice what causes files to go from being "lucky" to being "bad object"s, a report might help us track it down (no guarantees!) If you're able to isolate anything specific, post it here, or to the nasm-devel list, or file a bug report in the tracker, or mail it to me - fbkotler at comcast dot net.

TD with debug info is a *lot* nicer than TD without debug info, so it would be nice to get it working properly.

Best,
Frank

nobody

  • Guest
Re: Turbo link reports "Bad object"
« Reply #2 on: October 13, 2004, 10:33:29 PM »
Hi Frank,

I think the problem may have to do with the size of the .asm file. The file I was working on that went "bad" has over 2700 lines. I reduced the code I was working on to a test program of only 100 lines and I can use TD again. I downloaded the NASM sources and see that there is no Makefile for MinGW or Cygwin gcc. I assume I can start with the Unix Makefile, but I guess I also need Perl. Do you know if anyone has used MinGW or gcc on Windows?

nasm64developer

  • Guest
Re: Turbo link reports "Bad object"
« Reply #3 on: October 14, 2004, 12:57:29 PM »
> I assume I can start with the Unix Makefile,
> but I guess I also need Perl. Do you know if
> anyone has used MinGW or gcc on Windows?

I'm using Cygwin all the time, and MinGW every
now and then. As for Perl, I'm using the Active
State version. With that setup, the stock NASM
Makefile works just fine.