So an assembler converts the assembly language code into an object file and a linker would then produce an executable file which we can use to execute the program.
The job of linker is to link the address of functions present in other files in our file.
In foo.asm we invoke a function present in bar.asm. When assembler converts the foo.asm
file into an object file what address would it place where the function of bar.asm
is being invoked?
Asked
Active
Viewed 20 times
0

Peter Cordes
- 328,167
- 45
- 605
- 847

Charan Sai
- 105
- 2
- 9
-
1Related: [Why does global symbol in the same file needed to be relocated?](https://stackoverflow.com/q/46112788) shows some x86-64 examples of `R_X86_64_PC32` symbol relocations for jump targets. [Position independent addressing in GNU assembler with Intel syntax](https://stackoverflow.com/q/19984584) also shows an example of a RIP-relative load with the same relocation type. Also [meaning of an entry in a relocation table of an object file](https://stackoverflow.com/q/52215495) has some stuff. – Peter Cordes Feb 02 '22 at 06:35
-
1[What does a dangerous relocation error mean?](https://stackoverflow.com/q/19532826) has an answer that starts out by explaining what relocations are. (The concept is the same regardless of ISA.) Also [Doubts in executable and relocatable object file](https://stackoverflow.com/q/2784874) has some examples of the placeholders in 32-bit x86 object files. – Peter Cordes Feb 02 '22 at 06:39
-
thanks for the links. it makes sense now – Charan Sai Feb 02 '22 at 06:45