🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.lang.asm
Article #446

Re: NASM and GCC flat binary

#446
From: cr88192
Date: Sun, 02 Jun 2002 12:25
25 lines
1822 bytes
Richard Hayden wrote:

> Hi,
> 
> I am trying to use NASM and GCC to create a flat binary output file (where
> the part of the program in assembly is assembled using NASM and the C part
> is compiled using GCC), but am unsure how to do this. Any help, anyone
> could give would be very gratefully received.
> 
consider gcc on linux:
produces elf format on output.

thus:
nasm -f elf -o outfile infile
gcc is just: gcc -c (whatever else)... -o outfile infile
and: ld --oformat binary -o (kernel) -Ttext/-Tdata/-Tbss (whatever address 
per section) (objects...)

ok, there is probably a better way to operate ld, but I don't know about it 
right now. the problem is that all the sections are generally fixed length 
(though right now I don't have much of a problem with this...).

-- 
<cr88192@hotmail.spam.com>
<http://bgb1.hypermart.net/>
Technical Details
Message-ID: <ufkdusrjh28q75@corp.supernews.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
References: <adda3d$ajq$1@news6.svr.pol.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,78e1f6e4ec7bb6e4
X-Google-Attributes: gid11318c,public
X-Google-Thread: f7d8d,78e1f6e4ec7bb6e4
X-Google-Attributes: gidf7d8d,public
X-Google-Thread: 11174e,78e1f6e4ec7bb6e4
X-Google-Attributes: gid11174e,public
X-Google-ArrivalTime: 2002-06-02 08:21:44 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
From: cr88192 <cr88192@hotmail.com>
Newsgroups: alt.lang.asm,alt.os.development,gnu.gcc.help
Subject: Re: NASM and GCC flat binary
Date: Sun, 02 Jun 2002 08:25:27 -0400
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <ufkdusrjh28q75@corp.supernews.com>
References: <adda3d$ajq$1@news6.svr.pol.co.uk>
User-Agent: KNode/0.6.1
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
X-Complaints-To: newsabuse@supernews.com
Lines: 26