Hi, I am programming in assembler and when compiling it shows me the error of the title, this is all the error that generates me
/ usr / bin / ld: /tmp/ccbjmJPt.o: relocation R_X86_64_32S against '.data' can not be used when making a shared object; recompile with -fPIC / usr / bin / ld: the final link failed: Section not shown in the output collect2: error: ld returned the exit status 1
I use the functions of the c library. To compile I occupy
gcc hello.s -o hello
I have also tried the following
gcc -c hello.s
which generates a hello.o file and then I link it with
ld -share -fpic -s -o hello hello.o
and I get the same error, in other machines I compile perfectly, but in which I am currently working, not
And the code
.global main
.text
main:
mov $msg, %rdi
call puts
ret
msg:
.asciz "holaa"