Mail Archives: djgpp/2000/06/27/03:02:50
From: | "Marp" <marp AT 0 DOT 0 DOT 0 DOT 0>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Modifying ld for standalone binaries
|
Date: | Tue, 27 Jun 2000 02:33:10 -0400
|
Organization: | MindSpring Enterprises
|
Lines: | 37
|
Message-ID: | <8j9hua$c1k$1@slb3.atl.mindspring.net>
|
References: | <envflscd08chm650chapqv64s38o3etn1c AT 4ax DOT com>
|
NNTP-Posting-Host: | 04.30.99.96
|
X-Server-Date: | 27 Jun 2000 06:34:50 GMT
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 5.00.2919.6600
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2919.6600
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
I think what you're looking for is this example:
gcc filename.c -o filename.bin -Wl,--oformat,binary
I think this will give you the result you're looking for. Beware that there
are probably a lot of functions in the C library you won't be able to use
because they make calls to DPMI. Another alternative is to write your
program in assembly using NASM with output format binary. Also note that the
command line above will also produce filename.exe with the go32 stub, but
filename.bin won't have it. You will get a warning from stubify because the
output isn't COFF. You can probably ignore that warning.
"Ben Chong" <bluesky6 AT ix DOT netcom DOT com> wrote in message
news:envflscd08chm650chapqv64s38o3etn1c AT 4ax DOT com...
> Hi folks,
>
> I posted a question about using DJGPP to build for standalone binaries
> : there is no operating system. Binary put into an EPROM for embedded
> x86 system.
>
> Some of the answers (thanks to those who responded) indicated that I
> needed to modify ld (the linker).
>
> After looking at the a.out file, I noticed that there is a huge go32
> stub. Now, this is what I DONT'T want. Since the system will have no
> OS, there's no DPMI driver or what ever. The system will already be in
> some sort of 32-bit mode, so all I would like is that the first
> instruction be in location 0 of the binary file and so on.
>
> So what can I do to ld or the linker scripts to NOT pull in the go32
> stuff?
>
> Thanks!
>
> Ben
- Raw text -