Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-28-2005, 01:16 AM   #1
Senior Member
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 9.2
Posts: 1,207

Rep: Reputation: 51
NASM linker

I have set up a small environment for writing and testing assembly programs. I use shortcuts through aliases in ".bashrc".

The problem I have is that when assemble j1.asm and type:
[rene@lt cgi-bin]$ n ;line 3
[rene@lt cgi-bin]$ l ;line 4
I get a message:
ld: try.o: No such file: No such file or directory
because the previous commands were:
[rene@lt cgi-bin]$ nn ;line 11
[rene@lt cgi-bin]$ ld ;line 12
and try.o has been deleted.
(Why does the linker look for a file not included in the command?)

I have these aliases: (excluding the line number that's only there for clarity)
1 alias c="cd /var/www/cgi-bin"
2 alias j="cd /var/nobla/j1"
3 alias n="nasm -f elf j1.asm"
4 alias l="ld -s -o j1 j1.o"
5 alias s="strace ./j1"
6 alias e="emacs /var/files/memb"
7 alias d="ls -la /var/files/memb"
8 alias r="rm /var/files/memb"
9 alias t="touch /var/files/memb"
10 alias j1="/var/www/cgi-bin/j1"
11 alias nn="nasm -f elf try.asm"
12 alias ld="ld -s -o j1 try.o"

Could anyone help me solve this problem? Even rebooting doesn't fix it.

Thank you for your help.
Old 06-28-2005, 07:13 AM   #2
Registered: Jun 2005
Posts: 75

Rep: Reputation: 15
Hi rblampain,

You've told bash that

l="ld -s -o j1 j1.o"

and that

ld="ld -s -o j1 try.o".

I don't know much about how bash figures aliases out, but I would say that "l" is resolving to:

ld -s -o j1 try.o -s -o j1 j1.o

Hope that helps.

Old 06-29-2005, 05:56 AM   #3
Senior Member
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 9.2
Posts: 1,207

Original Poster
Rep: Reputation: 51
Thanks to sind for the tip, it seems the linker was confused by " l" and "ld". I renamed "ld" as "y" and everything works finenow.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
nasm Question Whiteghost Programming 2 09-11-2005 04:40 PM
Help with NASM macros? 95se Programming 0 04-02-2005 06:12 PM
nasm vs. masm irfanhab Programming 3 10-31-2004 01:28 AM
problems with linking objects -- must know some nasm\ASM\linker Paul6253 Programming 1 10-26-2004 08:33 PM
Nasm essoft478 Linux - Software 2 09-13-2004 04:33 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration