diff options
author | Carlos O'Donell <carlos@systemhalted.org> | 2015-09-18 00:12:22 -0400 |
---|---|---|
committer | Carlos O'Donell <carlos@systemhalted.org> | 2015-09-18 00:12:22 -0400 |
commit | f3f30c9d5cb98fb90fd6dd2e5362b7fe3ace3720 (patch) | |
tree | 06b957bbe6f2b85471697b8341733b162fae9da2 /elf/dl-support.c | |
parent | 8a44513e9ccb271e368b4aa3c9493b94a45e039d (diff) | |
download | glibc-carlos/dlmopen.tar.gz glibc-carlos/dlmopen.tar.xz glibc-carlos/dlmopen.zip |
Initial implemenation of full dlmopen support. carlos/dlmopen
Diffstat (limited to 'elf/dl-support.c')
-rw-r--r-- | elf/dl-support.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/elf/dl-support.c b/elf/dl-support.c index e7b5110b59..93670cf5b5 100644 --- a/elf/dl-support.c +++ b/elf/dl-support.c @@ -305,9 +305,22 @@ void internal_function _dl_non_dynamic_init (void) { + extern const ElfW(Ehdr) __ehdr_start + __attribute__ ((weak, visibility ("hidden"))); + extern const ElfW(Addr) __data_start; + _dl_main_map.l_origin = _dl_get_origin (); _dl_main_map.l_phdr = GL(dl_phdr); _dl_main_map.l_phnum = GL(dl_phnum); + /* Starting from binutils-2.23, the linker will define __ehdr_start + pointing at the ELF header, which is a good enough marker for the + start of main. The start of data (assumed to come after text) is + good enough for l_map_end. We want l_map_start and l_map_end set + to allow _dl_find_dso_for_object to be able to associate + _dl_main_map with a caller's addresses within main. */ + _dl_main_map.l_map_start = (ElfW(Addr)) &__ehdr_start; + _dl_main_map.l_text_end = (ElfW(Addr)) &__data_start; + _dl_main_map.l_map_end = _dl_main_map.l_text_end; if (HP_SMALL_TIMING_AVAIL) HP_TIMING_NOW (_dl_cpuclock_offset); |