Linux Online Advertisement
[ Register ]

[ Applications ]
[ Documentation ]
[ Distributions ]
[ Download Info ]
[ General Info ]
[ Book Store ]

Advertisement

[ Courses ]
[ News ]
[ People ]
[ Hardware ]
[ Vendors ]
[ Projects ]
[ Events ]
[ User Groups ]
[ User Area ]

Red Hat Linux Bible: Fedora and Enterprise Edition

[ About Us ]
[ Home Page ]
[ Advertise ]

Building an executable

6.3. Building an executable

6.3.1. Producing object code

First step of building an executable is compiling (or assembling) object file from the source:

For nasm example:

$ nasm -f elf hello.asm

For gas example:

$ as -o hello.o hello.S

This makes hello.o object file.

6.3.2. Producing executable

Second step is producing executable file itself from the object file by invoking linker:

$ ld -s -o hello hello.o

This will finally build hello executable.

Hey, try to run it... Works? That's it. Pretty simple.



Comments: feedback (at) linux.org
Advertising: banners (at) linux.org
Copyright Linux Documentation Project.
Compilation ©1994-2008 Linux Online, Inc.
All rights reserved.