Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is a Relocatable Object Code?

code object relocatable
0
Posted

What is a Relocatable Object Code?

0

Relocatable object code is machine code that is generated by compilers and assemblers and stored in relocatable object files or .o files. A relocatable object file contains symbolic references to locations defined within the compilation unit as well as symbolic references to locations defined outside the compilation unit. The object file also contains relocation information. The linker uses this information to replace the symbolic references with actual addresses. For example, if you write a program that references the external variable errno, the object code created by the compiler contains only a symbolic reference to errno because errno is not defined in your program. Only when the linker links this object code does the reference to errno change (relocate) to an absolute address in virtual memory. If your program defines a global variable, the compiler assigns a relocatable address to that variable. The compiler also marks all references to that variable as relocatable. The linker r

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123