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
0
votes
0 answers

relocation truncated, R_X86_64_PC32 against undefined symbol

In this C program, I needed to make a a queue applciation in a structured approach. As I was trying to run this program in netbeans, i saw that i was getting a relocation truncated error. My professor told me to run it in Clion and I'm still getting…
Doe J.
  • 9
  • 2
0
votes
3 answers

How can I relocate firmware for stm32?

I have built firmware for stm32f4, so I have *.elf an *.bin files. If I load *.bin file into internal flash it runs correctly. But if I want load this firmware to another address different from default (0x08000000) and run it from my bootloader, of…
Konstantin T.
  • 994
  • 8
  • 22
0
votes
1 answer

R_386_32 Relocations in shared library

Trying to understand how the relocation happens in the situation below I have a shared library libbigshr.so which uses another shared library libfunlib.so. In the latter I have declared this global variable foo. To compile the former I had to do…
ultimate cause
  • 2,264
  • 4
  • 27
  • 44
0
votes
0 answers

ELF programmatically resolving function names

Given that the below disassembly is of the start function, and that the address referenced by call at 0x4009d4 is some location in the .plt, how can we programmatically determine the name the function that the call references? Is there a type of…
user7183233
0
votes
0 answers

Relocation overflows with common section

I have a project in which I have a main program main.f95 which uses a bunch of modules: each subroutine called by main.f95 is contained in its own module. I've done this to avoid interface blocks. There are two additional modules: global.f95 which…
DrG
  • 151
  • 1
  • 7
0
votes
0 answers

Why can't I link a static object with .rodata section to a shared library in 64-bit systems?

I have created a static library (libar.a), which contains a function foo. I have a shared object (compiled with -fPIC flag) file that calls foo. If the object file containing foo has a .rodata section (e.g. a call to printf or a string literal),…
0
votes
1 answer

I don't understand meaning of this: +"a function to be evaluated during reloc processing"

I don't understand meaning of this: +"a function to be evaluated during reloc processing" - it is from flags of objdump. How function can be evaluated during reloc processing? Is it sequence of cpu opcodes (subrotinue) that must be called? Or what?
rcm
  • 1
  • 4
0
votes
1 answer

llc: unsupported relocation on symbol

Problem llc is giving me the following error: LLVM ERROR: unsupported relocation on symbol Detailed compilation flow I am implementing an LLVM frontend for a middle-level IR (MIR) of a compiler, and after I convert various methods to many bitcode…
Paschalis
  • 11,929
  • 9
  • 52
  • 82
0
votes
2 answers

Relocation error

#include #define MAX 1000000 int dp[MAX]; int P[MAX], C[MAX], K[MAX], child[MAX][1000], index[MAX]; int mod = 1000000007; void dfs(int i) { int j = 1; while (j <= index[i]) { dfs(child[i][j]); if ((C[child[i][j]]…
Shanif Ansari
  • 239
  • 2
  • 9
0
votes
0 answers

Android: MailCore library has text relocation error

The MailCore Library seems to be working fine on the android device but crashes while loading the MailCore lib on the emulator, with the following exception. AndroidRuntime: FATAL EXCEPTION: main …
0
votes
1 answer

relocation R_X86_64_32S against `.text' can not be used when making a shared object

I am compiling a static library, which leverages some inline assembly code. I notice that when I use labels for the jmp instruction: int foo(){ asm volatile ( "mov 0x60(%r8),%r11d\n\t" "jmp *S_401a70\n\t" ... "S_401a70: xor…
lllllllllllll
  • 8,519
  • 9
  • 45
  • 80
0
votes
1 answer

Subversion SVN: Repository has been moved Repository moved permanently to XXX please relocate

I dont understand SVN right now. When I change a file and try to update, it gives me the following error: Repository has been moved Repository moved permanently to 'http://myIpAdress/svn/'; please relocate As far As I know I didnt change the adress…
Pascal Klein
  • 23,665
  • 24
  • 82
  • 119
0
votes
1 answer

Can I build only glibc malloc as a shared library?

I want to build glibc malloc as a shared library instead of it being part of libc.so I'm not using any chroot but directly trying to build it. When I make glibc as a normal build, it outputs the command that is being used to build malloc…
sha
  • 614
  • 6
  • 16
0
votes
0 answers

why is .text section on disc and in ram different?

I have a program lets call it "SampleApplication" (only 1 exe file). I'm going through this program's .text section in 2 ways Openinig the file "SampleApplication.exe" from other program, going through headers, locating .text section and writting…
Marcin K.
  • 683
  • 1
  • 9
  • 20
0
votes
1 answer

Is it possible to relocate a binary?

I have created a raw binary created from an elf file by using objcopy -o binary. Is it possible to relocate it by a given offset? I believe the effect that I'm searching for would be similar to use --change-addresses option and then convert it to…
josecm
  • 413
  • 3
  • 15