DynamoRIO / DynamoRIO/dynamorio

remove fixed from elf_loader_map_phdrs

Open
#1,183 1 comment 0 reactions 0 assignees View on GitHub
Migrated OpSys-Linux Priority-Medium Type-Feature
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

_From [zhao...@google.com](https://code.google.com/u/106321947286816917100/) on June 07, 2013 10:56:33_

elf_loader_map_phdrs(elf_loader_t *elf, bool fixed, map_fn_t map_func,
unmap_fn_t unmap_func, prot_fn_t prot_func, bool reachable)
is used to load a ELF object into memory.

fixed is to indicate if the object should be loaded into a fixed memory only.
It is set true for executable and false for shared libraries, which causes issue #1001 where a PIE with preferred base at 0.
So now fixed is only a hint and can be overwritten, but we will still enforce the addr for PIE with non-0 preferred base.

Do we really need fixed?
It seems that MAP_FIXED is not that necessary, it basically means if there is a conflict, what should we do.
MAP_FIXED will replace the target memory blindly, which might not be good as it kick-out some other memory.
On the other hand, no MAP_FIXED will cause an executable shifted, which is not good either.
I am not sure which one is better, maybe no fixed?

So the real question is, if there is a memory overlap and the elf object is not relocatable, what should we do?

_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=1183_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.