position-independent-code Questions
1
I need a position independent code (PIC) working on STM32F401. But i have problem with pointers to functions used e.g. in struct.
Short example:
struct process {
struct process *next;
const ch...
Glycoside asked 17/10, 2017 at 8:24
2
Solved
I've been trying to get a better grasp of how shared libraries work but I just can't rap my head around two things.
1- Each process has its own virtual memory space and page table, so If a shared l...
Brenna asked 29/10, 2018 at 6:55
1
Solved
In the RISC-V Unpriviliged spec V20191213, the following is stated, (page 21)
The unconditional jump instructions all use PC-relative addressing to help support position-independent
code.
Loo...
Nit asked 20/3, 2020 at 14:54
2
Solved
I have a library I am building. All of my objects compile and link successively when I run either one of:
ar rcs lib/libryftts.a $^
gcc -shared $^ -o lib/libryftts.so
in my Makefile. I also am ab...
Lublin asked 29/12, 2015 at 21:41
2
I need to get base address of stack inside my running process. This would enable me to print raw stacktraces that will be understood by addr2line (running binary is stripped, but addr2line has acce...
Anatomist asked 8/3, 2019 at 15:55
1
ADRP
Address of 4KB page at a PC-relative offset.
ADRL
Load a PC-relative address into a register. It is similar to the ADR
instruction. ADRL can load a wider range of addresses than ADR b...
Ridgway asked 28/1, 2017 at 5:35
1
First I tried to reverse engineer it a bit:
printf '
#include <stdio.h>
int main() {
puts("hello world");
}
' > main.c
gcc -std=c99 -pie -fpie -ggdb3 -o pie main.c
echo 2 | sudo tee /pro...
Wonted asked 14/7, 2018 at 21:42
2
Solved
How will it change the code, e.g. function calls?
Gelya asked 17/3, 2010 at 14:43
1
Solved
I have one interesting compilation problem.
At first, please see code to be compiled.
$ ls
Makefile main.c sub.c sub.h
$ gcc -v
...
gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
## Makefi...
Cymbal asked 7/12, 2017 at 12:40
2
Solved
Consider the following function:
extern void test1(void);
extern void test2(void) {
test1();
}
This is the code gcc generates without -fpic on amd64 Linux:
test2:
jmp test1
When I compile w...
Roveover asked 1/4, 2016 at 10:41
1
Solved
If a trivial program is compiled with the following command:
arm-none-eabi-gcc -shared -fpic -pie --specs=nosys.specs simple.c -o simple.exe
and the relocation entries are printed with the comma...
Smokejumper asked 12/5, 2016 at 22:24
3
Solved
I'm studying for a test in assembly and in the subject of "Position-Independent-Code" I find the difference between a relative jump and an absolute jump confusing.
How can I tell what kind of jump ...
Incitement asked 21/7, 2015 at 15:59
1
© 2022 - 2024 — McMap. All rights reserved.