Answer the question
In order to leave comments, you need to log in
Why does assembler code (GNU assembler) compile on one machine but not on another?
.hello_str:
.string "Hello, GAS!"
.globl main
.type main, @function
main:
movl $.hello_str, %edi
call [email protected]
movl $0, %edi
call [email protected]
gcc -o a.out ./1_1.s
gcc -o a.out ./1_1.s
/usr/bin/ld: /tmp/ccTxc4Ax.o: relocation R_X86_64_32 against `.text' can not be used when making a PIE object; перекомпилируйте с параметром -fPIC
/usr/bin/ld: final link failed: Раздел, непредставимый для вывода
collect2: error: ld returned 1 exit status
$ gcc -fPIC -o a.out ./1_1.s
/usr/bin/ld: /tmp/ccbz8Upi.o: relocation R_X86_64_32 against `.text' can not be used when making a PIE object; перекомпилируйте с параметром -fPIC
/usr/bin/ld: final link failed: Раздел, непредставимый для вывода
collect2: error: ld returned 1 exit status
Answer the question
In order to leave comments, you need to log in
$ gcc -fPIC -o a.out ./1_1.s
The -fPIC option doesn't help
-fPIC
changes the assembler output of the compiler, this key does not affect the finished assembler file in any way.-m32
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question