Hi all,
I'm learning GAS assmbler, and I've written the following test program:


.section .data
    .int 1,2,3,4,5,6,7,8,9
    .asciz "current value %d"

.section .text
    .globl _start
    movl $10, %edi
    movl values(,%edi,4),%eax
    pushl %eax
    pushl $output
    call printf
    addl $8, %esp
    dec %edi
    jnz loop
    pushl $0
    call exit

Since I'm on x64, but the code is for 32bit asm, I've assembled it using this command:
as --32 -o test.o test.asm
This command seems to produce a valid obj file.
The problem is that I'm not able to link this file to produce a valid elf32...
I'm using this command:
ld -dynamic-linker /lib/ld-linker.so.2 -lc -o stampa stampa.o -melf_i386
but it says that /usr/lib64/libc.so is not compatible with -lc

How should I link my test program ?? Thank you very much!

You need to install the 32 bit libraries:
With your package manager or:

sudo apt-get install ia32-libs