diff options
Diffstat (limited to 'backends')
| -rw-r--r-- | backends/ChangeLog | 20 | ||||
| -rw-r--r-- | backends/Makefile.am | 2 | ||||
| -rw-r--r-- | backends/libebl_CPU.h | 22 | ||||
| -rw-r--r-- | backends/ppc64_init.c | 15 | ||||
| -rw-r--r-- | backends/ppc64_symbol.c | 3 | ||||
| -rw-r--r-- | backends/ppc_symbol.c | 16 |
6 files changed, 45 insertions, 33 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog index a3dd59bc..6a862487 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,23 @@ +2014-12-18 Ulrich Drepper <[email protected]> + + * Makefile.am: Suppress output of textrel_check command. + +2014-11-22 Mark Wielaard <[email protected]> + + * ppc64_symbol.c (ppc64_bss_plt_p): Remove ehdr argument. + * ppc_symbol.c (find_dyn_got): Likewise. Use elf_getphdrnum. + (ppc_check_special_symbol): Call find_dyn_got without ehdr. + (ppc_bss_plt_p): Remove ehdr argument. + +2014-11-17 Mark Wielaard <[email protected]> + + * ppc64_init.c (ppc64_init): Check section name is not NULL. + +2014-10-06 Mark Wielaard <[email protected]> + + * libebl_CPU.h (dwarf_peel_type): Removed. + (dwarf_peeled_die_type): Use libdw dwarf_peel_type. + 2014-07-18 Kyle McMartin <[email protected]> Mark Wielaard <[email protected]> diff --git a/backends/Makefile.am b/backends/Makefile.am index 5b49108b..5ab9f9fd 100644 --- a/backends/Makefile.am +++ b/backends/Makefile.am @@ -120,7 +120,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \ -Wl,--version-script,$(@:.so=.map) \ -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) - $(textrel_check) + @$(textrel_check) libebl_i386.so: $(cpu_i386) libebl_x86_64.so: $(cpu_x86_64) diff --git a/backends/libebl_CPU.h b/backends/libebl_CPU.h index fa0d4f2d..ef2b922b 100644 --- a/backends/libebl_CPU.h +++ b/backends/libebl_CPU.h @@ -53,23 +53,6 @@ extern bool (*generic_debugscn_p) (const char *) attribute_hidden; if (_die == NULL) return -1; \ dwarf_tag (_die); }) -/* Follow typedefs and qualifiers to get to the actual type. */ -static inline int -dwarf_peel_type (Dwarf_Die *typediep, Dwarf_Attribute *attrp) -{ - int tag = DWARF_TAG_OR_RETURN (typediep); - while (tag == DW_TAG_typedef - || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type - || tag == DW_TAG_restrict_type) - { - attrp = dwarf_attr_integrate (typediep, DW_AT_type, attrp); - typediep = dwarf_formref_die (attrp, typediep); - tag = DWARF_TAG_OR_RETURN (typediep); - } - - return tag; -} - /* Get a type die corresponding to DIE. Peel CV qualifiers off it. */ static inline int @@ -84,7 +67,10 @@ dwarf_peeled_die_type (Dwarf_Die *die, Dwarf_Die *result) if (dwarf_formref_die (attr, result) == NULL) return -1; - return dwarf_peel_type (result, attr); + if (dwarf_peel_type (result, result) != 0) + return -1; + + return DWARF_TAG_OR_RETURN (result); } #endif /* libebl_CPU.h */ diff --git a/backends/ppc64_init.c b/backends/ppc64_init.c index 7ea2b236..56e1828e 100644 --- a/backends/ppc64_init.c +++ b/backends/ppc64_init.c @@ -90,13 +90,16 @@ ppc64_init (elf, machine, eh, ehlen) if (opd_shdr != NULL && (opd_shdr->sh_flags & SHF_ALLOC) != 0 && opd_shdr->sh_type == SHT_PROGBITS - && opd_shdr->sh_size > 0 - && strcmp (elf_strptr (elf, ehdr->e_shstrndx, - opd_shdr->sh_name), ".opd") == 0) + && opd_shdr->sh_size > 0) { - eh->fd_addr = opd_shdr->sh_addr; - eh->fd_data = elf_getdata (scn, NULL); - break; + const char *name = elf_strptr (elf, ehdr->e_shstrndx, + opd_shdr->sh_name); + if (name != NULL && strcmp (name, ".opd") == 0) + { + eh->fd_addr = opd_shdr->sh_addr; + eh->fd_data = elf_getdata (scn, NULL); + break; + } } } } diff --git a/backends/ppc64_symbol.c b/backends/ppc64_symbol.c index 5a020d8d..0feddcee 100644 --- a/backends/ppc64_symbol.c +++ b/backends/ppc64_symbol.c @@ -108,8 +108,7 @@ ppc64_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, /* Check if backend uses a bss PLT in this file. */ bool -ppc64_bss_plt_p (Elf *elf __attribute__ ((unused)), - GElf_Ehdr *ehdr __attribute__ ((unused))) +ppc64_bss_plt_p (Elf *elf __attribute__ ((unused))) { return true; } diff --git a/backends/ppc_symbol.c b/backends/ppc_symbol.c index 220f243e..c17ab374 100644 --- a/backends/ppc_symbol.c +++ b/backends/ppc_symbol.c @@ -1,5 +1,5 @@ /* PPC specific symbolic name handling. - Copyright (C) 2004, 2005, 2007 Red Hat, Inc. + Copyright (C) 2004, 2005, 2007, 2014 Red Hat, Inc. This file is part of elfutils. Written by Ulrich Drepper <[email protected]>, 2004. @@ -81,9 +81,13 @@ ppc_dynamic_tag_check (int64_t tag) /* Look for DT_PPC_GOT. */ static bool -find_dyn_got (Elf *elf, GElf_Ehdr *ehdr, GElf_Addr *addr) +find_dyn_got (Elf *elf, GElf_Addr *addr) { - for (int i = 0; i < ehdr->e_phnum; ++i) + size_t phnum; + if (elf_getphdrnum (elf, &phnum) != 0) + return false; + + for (size_t i = 0; i < phnum; ++i) { GElf_Phdr phdr_mem; GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem); @@ -127,7 +131,7 @@ ppc_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym, { /* In -msecure-plt mode, DT_PPC_GOT is present and must match. */ GElf_Addr gotaddr; - if (find_dyn_got (elf, ehdr, &gotaddr)) + if (find_dyn_got (elf, &gotaddr)) return sym->st_value == gotaddr; /* In -mbss-plt mode, any place in the section is valid. */ @@ -154,8 +158,8 @@ ppc_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym, /* Check if backend uses a bss PLT in this file. */ bool -ppc_bss_plt_p (Elf *elf, GElf_Ehdr *ehdr) +ppc_bss_plt_p (Elf *elf) { GElf_Addr addr; - return ! find_dyn_got (elf, ehdr, &addr); + return ! find_dyn_got (elf, &addr); } |
