All Questions
Tagged with relocation c++
24 questions
0
votes
0
answers
14
views
Managing Relocation Order Dependencies in ELF Shared Libraries [duplicate]
When you link an application let's call it main_program with a shared library message_library on a Linux device, there's a scenario to consider. This shared library contains a global variable message ...
18
votes
1
answer
2k
views
Where is the order in which ELF relocations are applied specified?
Consider the following two files on a Linux system:
use_message.cpp
#include <iostream>
extern const char* message;
void print_message();
int main() {
std::cout << message << '\...
5
votes
1
answer
268
views
Calculation of relative offset in small code model
I am trying to understand the RIP relative offset used in small-code model. Perhaps the only approachable resource on the internet on this topic is: https://eli.thegreenplace.net/2012/01/03/...
0
votes
0
answers
304
views
Cmake - Relocation error at runtime when running in server
I started with C and C++ a few days ago and I'm losing my mind with this problem. I wrote and compiled a program in C++ using cmake in a Windows Subsystem for Linux (WSL, Ubuntu). The program opens a ...
0
votes
1
answer
214
views
Does removing relocation data using `-s` affect a position dependent executable
I need to know if using -s in GCC (g++) will have any effects on the PIE. I also want to know its effects on a position-dependent executable. As far as I know, not using any linking option (like -pie ...
1
vote
1
answer
2k
views
Executable Without .RELOC Section
I am using MSVC 2019. I have compiled a simple C++ code (Hello World...). When I compile it in release mode in x86 architecture, there is a .reloc section, but when I compile it in x64 architecture, ...
3
votes
1
answer
2k
views
How are external symbols of a shared library resolved in the main program?
I've been reading a lot about the semantics of load-time linking of shared libraries and one thing that I'm having trouble understanding is how can the main program make references to functions ...
1
vote
0
answers
438
views
Relocatable code for .SO and .DLL libraries
I am developing a C++ library that requires some external assembly functions to be included.
Currently, the C/C++ functions are being declared this way (generic format, not the exact code):
#if ...
0
votes
0
answers
188
views
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 ...
2
votes
1
answer
2k
views
PE injection image relocation
All,
I have been trying to figure this out for a couple of days now and I need some help.
For a research project for work I have written some custom malware, the malware itself is not the issue here ...
1
vote
0
answers
36
views
is there a equivalent to llvm3.6's RuntimeDyldELF::findGOTentries in llvm4.0?
While trying to adapt the patch for LLVM 4.0 i noticed that
RuntimeDyldELF::findGOTentries has been removed.
How can i implement RuntimeDyldELF::findGOTentries using the 4.0 api ?
2
votes
1
answer
1k
views
Runtime error in c++. Relocation protocol version %d
Please help me with following problem of transforming expression of spoj here is the link. It is giving runtime error.
#include <iostream>
#include <stack>
#include <string&...
10
votes
1
answer
9k
views
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
│ ...
2
votes
1
answer
8k
views
How to resolve "relocation truncated to fit: R_X86_64_PC32 against undefined symbol `xercesc_3_1::AbstractDOMParser::adoptDocument()'"
I am trying to build a C++ program in Eclipse that uses a library xerces-c-3.1.1-x86_64-linux-gcc-3.4 (binary). I see the below errors ...
relocation truncated to fit: R_X86_64_PC32 against undefined ...
1
vote
0
answers
485
views
what does "Symbol `_ZTISt16invalid_argument' causes overflow in R_X86_64_32 relocation" mean?
I've compiled a C++11 application under Scientific Linux 6.4 (64bit), using a self-compiled GCC 4.8.2. The application can be compiled fine, but when running it (with LD_LIBRARY_PATH set to include ...