Questions tagged [relocation]

Relocation is the adaptation of a piece of code assembled on a certain address in memory to another address It is a typical task of dynamic linkers and program loaders, and thus last step in a standard development toolchain.

Relocation is the adaptation of a piece of code assembled on a certain address in memory to another address. It is a typical task of dynamic linkers and program loaders, and thus last step in a standard development toolchain. (typically make - preprocessor - compiler - assembler - archiver - linker - loader)

Relocations can be symbolic or by just adding the base load address of the module (binary/library), the latter is often called a fixup. The object code of some executable formats is assembled to start at 0, making the normal linking process have some relocation aspects also.

The standard book about this subject is "Linkers and Loaders" by John R. Levine.

247 questions
195
votes
5 answers

What do linkers do?

I've always wondered. I know that compilers convert the code you write into binaries but what do linkers do? They've always been a mystery to me. I roughly understand what 'linking' is. It is when references to libraries and frameworks are added to…
Kristina
  • 15,859
  • 29
  • 111
  • 181
77
votes
18 answers

Wordpress keeps redirecting to install-php after migration

Here's my situation. I have followed the exact instructions on wordpress codex page about moving a site to another server. Here are the step's i have taken. Export a copy of my database Make a new database in the new server Import the database I…
Hiilo
  • 2,381
  • 2
  • 15
  • 14
62
votes
6 answers

What do R_X86_64_32S and R_X86_64_64 relocation mean?

Got the following error when I tried to compile a C application in 64-bit FreeBSD: relocation R_X86_64_32S can not be used when making a shared object; recompile with -fPIC What is R_X86_64_32S relocation and what is R_X86_64_64? I've googled…
Raj
  • 4,342
  • 9
  • 40
  • 45
46
votes
1 answer

32-bit absolute addresses no longer allowed in x86-64 Linux?

64 bit Linux uses the small memory model by default, which puts all code and static data below the 2GB address limit. This makes sure that you can use 32-bit absolute addresses. Older versions of gcc use 32-bit absolute addresses for static arrays…
A Fog
  • 4,360
  • 1
  • 30
  • 32
31
votes
3 answers

Processing ELF relocations - understanding the relocs, symbols, section data, and how they work together

TL;DR I tried to make this a short question but it's a complicated problem so it ended up being long. If you can answer any part of this or give any suggestions or tips or resources or anything at all, it would be extremely helpful (even if you…
thehelix
  • 578
  • 1
  • 6
  • 10
21
votes
4 answers

What is Relocatable and Absolute Machine Code?

While studying Assemblers, I came across these terms.The idea I got is like this, in Relocatable machine code, the code is not dependent on static RAM location. The assembler specifies RAM needs for my program. The memory can be placed wherever the…
Shakib Ahmed
  • 781
  • 2
  • 10
  • 24
21
votes
4 answers

SVN Switch Relocate - is not the root of the repository

I'm trying to move a working copy folder from it's old dedicated svn server, to a new svn server where it is contained within a sub-folder. Using the following relocate command: svn switch --relocate https://oldserver/svn/repos…
Jon Hadley
  • 5,196
  • 8
  • 41
  • 65
17
votes
6 answers

How to modify repository settings in Redmine?

It might sound like a dumb question but I can't for the life of me find the answer to this one. We have a project set up in Redmine and linked to an SVN repository. Everything is working fine, but we recently did a repository relocation and we…
Danita
  • 2,464
  • 4
  • 23
  • 29
17
votes
1 answer

What does the concept of relocation mean?

I'm new to assembly and hence want to understand more about the concept of relocation. Why exactly do we need to relocate programs, data? How exactly is it done? It would be great if someone could explain with a beginner level example.
Shivaji_Vidhale
  • 393
  • 1
  • 5
  • 14
12
votes
3 answers

Find function's start offset in ELF

Suppose I have function fn somewhere within the .text section of an ELF64 executable. Is there a way to know at which offset (in bytes) from the start of the ELF file the fn function is located? Note that I don't need to know at which VA it was…
pr0gma
  • 577
  • 3
  • 8
  • 18
12
votes
1 answer

AArch64 relocation prefixes

I noticed a GNU asm relocation syntax for ARM 64-bit assembly. What are those pieces like #:abs_g0_nc: and :pg_hi21:? Where are they explained? Is there a pattern to them or are they made up on the go? Where can I learn more?
Jeenu
  • 2,109
  • 2
  • 20
  • 27
12
votes
3 answers

Disable GOT in GCC

Global Offset Table (GOT): Is used for relocation of ELF symbols (implemented GCC), It helps in sharing of same binary without any specific linking for each process. Thus reduces copies of same binary image in the memory. My question is, is there…
amaneureka
  • 1,150
  • 11
  • 26
12
votes
3 answers

Dynamic relocation of code section

Just out of curiosity I wonder if it is possible to relocate a piece of code during the execution of a program. For instance, I have a function and this function should be replaced in memory each time after it has been executed. One idea that came…
Phil
  • 121
  • 1
  • 3
11
votes
1 answer

How to write dynamic loader for bare-metal arm-application

I'm working on a project based on arm9 processor. We use only bare-metal without any operating system, so unfortunately we have no support for shared libraries / dynamic loader yet. I would like to be able to have libraries loaded for example from…
Honza
  • 1,734
  • 3
  • 16
  • 22
10
votes
1 answer

Cmake: Exporting subproject targets to main project

I currently have a project called LIBS with a structure like this: ├── Lib1 │ ├── CMakeLists.txt │ ├── lib1-class.cpp │ └── lib1-class.h ├── lib2 │ └── CMakeLists.txt │ ├── lib2-class.cpp │ ├── lib2-class.h ├── cmake │ └──…
Maths noob
  • 1,684
  • 20
  • 42
1
2 3
16 17