dbfn@debian:~/Scripts$ cat teste2.asm
%macro exit 1
mov eax,1
mov ebx,%1
int 80h
%endmacro
section .text
global main
section .data
msg1 db "teste", 0Ah
len1 equ $ - msg1
main:
mov ecx,msg1
mov edx,len1
mov eax,4
mov ebx,1
int 80h
exit 0
dbfn@debian:~/Scripts$ nasm -f elf -g -F stabs teste2.asm
dbfn@debian:~/Scripts$ ld -e main -o teste2 teste2.o
dbfn@debian:~/Scripts$ file teste2
teste2: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped
dbfn@debian:~/Scripts$ readelf -s -g teste2
There are no section groups in this file.
Symbol table '.symtab' contains 11 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 08049054 0 SECTION LOCAL DEFAULT 1
2: 00000000 0 SECTION LOCAL DEFAULT 2
3: 00000000 0 SECTION LOCAL DEFAULT 3
4: 00000000 0 FILE LOCAL DEFAULT ABS teste2.asm
5: 08049054 1 OBJECT LOCAL DEFAULT 1 msg1
6: 00000006 0 NOTYPE LOCAL DEFAULT ABS len1
7: 0804907c 0 NOTYPE GLOBAL DEFAULT ABS __bss_start
8: 0804905a 0 NOTYPE GLOBAL DEFAULT 1 main
9: 0804907c 0 NOTYPE GLOBAL DEFAULT ABS _edata
10: 0804907c 0 NOTYPE GLOBAL DEFAULT ABS _end
dbfn@debian:~/Scripts$ objdump -M intel -g -e -G teste2
objdump: teste2: no recognized debugging information
dbfn@debian:~/Scripts$ gdb teste2
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(no debugging symbols found)
(gdb) r
Starting program: /home/dbfn/Scripts/teste2
(no debugging symbols found)
teste
Program exited normally.
(gdb) l 20
No symbol table is loaded. Use the "file" command.
(gdb) q
dbfn@debian:~/Scripts$ nasm -v
NASM version 2.03.01 compiled on Jun 18 2008
dbfn@debian:~/Scripts$