delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/06/18/06:30:05

From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: linking kernel
Date: 18 Jun 2002 10:01:06 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 36
Message-ID: <aen0d2$t54$1@antares.lu.erisoft.se>
References: <df0595a2 DOT 0206180149 DOT 7e15e53c AT posting DOT google DOT com>
NNTP-Posting-Host: lws256.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Dylan (dylanmarsh AT yahoo DOT com) wrote:
: Ive been playing around with grub and a small kernel using djgpp and
: its AT&T syntax style assembly language. gcc version is 2.953, ld
: version is 2.11.2.

: nasm -o start.o -f elf start.asm
: gcc -o kernel.o -c kernel.c

: gcc -Wall -o asm.o -c asm.S

DJGPP's gcc is generating COFF.

: ld-elf -T kernel.ls asm.o start.o kernel.o -o kernel // <<< problem
: line

This looks like an ELF linker.

: the nasm file compiles and links and so does the C file. The asm.S

No it doesn't. It compiles fine. Linking is what you're attempting in
the line starting with "ld-elf".

: file compiles but doesn't link it says it can't recognize the file.

: Do I need a different linker?

No. If you mean to use ELF (ld-elf) you need a differently compiled
gcc.

Yes. Use ld which comes with DJGPP and change your nasm line from "-f
elf" to "-f coff".


Right,

						MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019