aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-addr.c12
-rw-r--r--elf/elf.h17
2 files changed, 19 insertions, 10 deletions
diff --git a/elf/dl-addr.c b/elf/dl-addr.c
index 66cec39eb4..e560c74ab5 100644
--- a/elf/dl-addr.c
+++ b/elf/dl-addr.c
@@ -60,14 +60,12 @@ _dl_addr (const void *address, Dl_info *info)
/* Now we know what object the address lies in. */
info->dli_fname = match->l_name;
- info->dli_fbase = (void *) match->l_addr;
+ info->dli_fbase = (void *) match->l_map_start;
/* If this is the main program the information is incomplete. */
- if (__builtin_expect (info->dli_fbase == NULL, 0))
- {
- info->dli_fname = _dl_argv[0];
- info->dli_fbase = (void *) match->l_map_start;
- }
+ if (__builtin_expect (l->l_name[0], 'a') == '\0'
+ && l->l_type == lt_executable)
+ info->dli_fname = _dl_argv[0];
symtab = (const void *) D_PTR (match, l_info[DT_SYMTAB]);
strtab = (const void *) D_PTR (match, l_info[DT_STRTAB]);
@@ -81,7 +79,7 @@ _dl_addr (const void *address, Dl_info *info)
dynamic symbol table and no hash table is present. The ELF
binary is ill-formed but what shall we do? Use the beginning of
the string table which generally follows the symbol table. */
- symtabend = strtab;
+ symtabend = (const ElfW(Sym) *) strtab;
/* We assume that the string table follows the symbol table, because
there is no way in ELF to know the size of the dynamic symbol table!! */
diff --git a/elf/elf.h b/elf/elf.h
index b664c5d279..2d79be2f65 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -2294,7 +2294,7 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */
#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */
#define R_X86_64_RELATIVE 8 /* Adjust by program base */
-#define R_X86_64_GOTPCREL 9 /* 32 bit signed pc relative
+#define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative
offset to GOT */
#define R_X86_64_32 10 /* Direct 32 bit zero extended */
#define R_X86_64_32S 11 /* Direct 32 bit sign extended */
@@ -2302,8 +2302,19 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */
#define R_X86_64_8 14 /* Direct 8 bit sign extended */
#define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */
-
-#define R_X86_64_NUM 16
+#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */
+#define R_X86_64_DTPOFF64 17 /* Offset in module's TLS block */
+#define R_X86_64_TPOFF64 18 /* Offset in initial TLS block */
+#define R_X86_64_TLSGD 19 /* 32 bit signed PC relative offset
+ to two GOT entries for GD symbol */
+#define R_X86_64_TLSLD 20 /* 32 bit signed PC relative offset
+ to two GOT entries for LD symbol */
+#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */
+#define r_x86_64_GOTTPOFF 22 /* 32 bit signed PC relative offset
+ to GOT entry for IE symbol */
+#define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */
+
+#define R_X86_64_NUM 24
__END_DECLS