D
D
Danil Tunev2019-01-04 18:24:33
assembler
Danil Tunev, 2019-01-04 18:24:33

How to put a label in a register in system V amd64 abi?

If I want to put the label "L0" into the register %rbx. For example: movq $L0,%rbx;. The compiler complains:
/usr/bin/ld: /home/mm/function.o: relocation R_X86_64_32S against `.text' can not be used when making a shared object;
As I understand it, somewhere in the data it needs to be designated, how to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2019-01-04
@lada-guy

I want to place the label "L0" in the %rbx register.
relocation R_X86_64_32S against `.text' can not be used when making a shared object

If it is a local label, then by offset from PC:
If it is a label from another dynamic library, then via plt:
movq [email protected](%rip), %rbx

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question