Author Topic: A compile problem.  (Read 29919 times)

Offline Cyrill Gorcunov

  • NASM Developer
  • Full Member
  • *****
  • Posts: 179
  • Country: 00
Re: A compile problem.
« Reply #15 on: November 22, 2010, 03:37:45 PM »
FWIW, I don't have any problem with not specifying an output file name, nor specifying a map file (funky old Linux, nasm-2.10rc2-20101108). That 16,730 bytes is still another different size!

Here's a potential "test" file:

Thanks a lot Frank for test-case! I'll try to take a look into it as soon as I can.

Offline stanleylai

  • Jr. Member
  • *
  • Posts: 2
Re: A compile problem.
« Reply #16 on: November 27, 2010, 09:51:48 AM »

It's me again.

I compiled the source code with nasm-2.09.04. It still generated a large size.
Last time I didn't mention the size. It's not just large. It is huge.
It's over 1 GB.
My environment is the following:
OS is Windows vista.
CPU is Intel core 2 duo.
The DRAM is 4 GB.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: A compile problem.
« Reply #17 on: November 27, 2010, 06:54:37 PM »
Holy ohmygoodness!!! Over 1 GB! I think that's the "best" yet!

Well... "align" is definitely broken (duh!). Besides exploding the file size, I don't think it's aligning stuff where you want. Replacing it with "align=32" (etc.) in the section declarations seems to work better. Here's the output with "[map]":

Code: [Select]
- NASM Map file ---------------------------------------------------------------

Source file:  pmtest3a.asm
Output file:

-- Program origin -------------------------------------------------------------


-- Sections (summary) ---------------------------------------------------------

Vstart            Start             Stop              Length    Class     Name
             100               100               103  00000003  progbits  .text
             104               104               14A  00000046  progbits  .gdt
             160               160               196  00000036  progbits  .data1
             1A0               1A0               3A0  00000200  progbits  .gs
             3A0               3A0               4AA  0000010A  progbits  .s16
             4AC               4AC               50C  00000060  progbits  .s32
             520               520               53A  0000001A  progbits  .s16code
             540               540               548  00000008  progbits  .ldt
             560               560               57A  0000001A  progbits  .la

"[map all]" gives more info - might prove useful for debugging. By default, this spews to stdout - easily redirected. You can do "[map all]", too. Read all about it in the Friendly Manual.

Rather than (re)post your original code with the substitutions, I'll attach it. (I've been editing it in Linux - might have screwed up some line-endings - I think it's okay) See if it's producing what you had in mind...


Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: A compile problem.
« Reply #18 on: March 01, 2011, 04:00:26 PM »
UPDATE: This particular ALIGN bug has been fixed as of 2.09.06/2.10rc4.

For specifics, read this nasm-devel list message.