Bug 000370

When Created: 04/23/2005 08:01:23
Against DJGPP version: 2.00
By whom:
Abstract: The file's size is not right
I am a Chinese studio in middle school.Perhaps Some mistake on Grammer or  
 word spending will be wrote in this letter.

I use gcc 3.3.4 to build a file.

the file is shown below.


.globl start
        movw $0x0000,%ax

.org 510
.word 0xAA55

I build it with the command below.

gcc -traditional -c -nostdinc -o boot.o boot.s
ld -Ttext 0x0000 -s --oformat binary -o boot.bin boot.o

When I built it,I found the size of boot.bin is not 512byte,is 1024byte.

I think it is some error in this.


I thinke the code before is like this.


.global _start
        movw $0x0000,%ax

.org 510
.word 0xAA55

but I couldn't buld it success by Djgpp in Windows XP

Thank you for your reading.
I wait for your return.


Note added: 05/03/2005 06:44:15
By whom:
This is not a problem with DJGPP.

Tell ld to generate a link map file (-Map option) to understand the

(You need to provide your own link script file.)



Note added: 05/11/2005 08:13:55
By whom:
But how can I do?

Can you give me an example?

Note added: 06/01/2007 19:30:08
By whom:
The -Map option to ld?

  webmaster     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010