DynamoRIO / DynamoRIO/dynamorio
eliminate text relocations in 32-bit Mac assembly
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 30
Description
_From [derek.br...@gmail.com](https://code.google.com/u/117968039472581148324/) on November 16, 2013 23:18:32_
Mach-O has no GOT: it directly references global variables instead of
indirecting through a table. It is PIC: rip-rel on x64, and via a base
register retrieved via "call next_instr" for 32-bit.
But, I have not found any nasm support for generating Mach-O PIC code.
They have nice ELF support for referencing through the GOT, but nothing for
Mac-O that I've seen.
Plus, the linker by default does not accept text relocs:
ld: illegal text-relocation to _initstack_mutex in
CMakeFiles/dynamorio.dir/dynamo.c.o from _call_switch_stack in
CMakeFiles/dynamorio.dir/x86/x86.asm.o for architecture i386
For now I'm passing "-read_only_relocs suppress" to the linker to suppress
the error, and we've live with text relocs for now.
_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=1322_
Contributor guide
Assessment
This issue has not been assessed yet.