I copied the sample program on assembler and compiled it using gcc, but I got the following output:
gcc hello.s -o hello1
/usr/bin/ld: /tmp/ccPs5dcq.o: relocation R_X86_64_32 against `.data' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
Code:
.data
hello_str:
        .string "Hello, world!\n"
        .set hello_str_length, . - hello_str - 1
.text 
.globl  main
.type   main, @function       
main:
        movl    $4, %eax      
        movl    $1, %ebx      
        movl    $hello_str, %ecx  
        movl    $hello_str_length, %edx 
        int     $0x80         
        movl    $1, %eax      
        movl    $0, %ebx      
        int     $0x80         
        .size   main, . - main    
What am i doing wrong?
P.S. I'm absolutely beginner in assembler, just trying to parse the example
 
     
    