From: Mark Wielaard Date: Wed, 25 May 2011 11:45:06 +0000 (+0200) Subject: Merge branch 'master' into robustify X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9802d750ce122fc27bf4515026fe7e138de6267;p=thirdparty%2Felfutils.git Merge branch 'master' into robustify Conflicts: src/strip.c: Change assert to elf_assert. --- e9802d750ce122fc27bf4515026fe7e138de6267 diff --cc libdwfl/ChangeLog index 5a002b15d,abad77b56..4d6e8952a --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@@ -1,8 -1,14 +1,19 @@@ + 2011-04-11 Mark Wielaard + + * linux-kernel-modules.c (vmlinux_suffixes): Guard definition + by check for zlib, bzlib or lzma defines to check it isn't empty. + (try_kernel_name): Use same guard for use of vmlinux_suffixes. + + 2011-03-08 Roland McGrath + + * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL. + Reported by Kurt Roeckx . + +2011-03-23 Petr Machata + + * relocate.c (relocate_section): Use gelf_fsize instead of relying + on shdr->sh_entsize. + 2011-02-11 Roland McGrath * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz diff --cc src/ChangeLog index ead1235c0,007236a4c..d1d62dd87 --- a/src/ChangeLog +++ b/src/ChangeLog @@@ -1,9 -1,118 +1,124 @@@ + 2011-05-23 Mark Wielaard + + * strip.c (relocate): Take new arguments is_rela to indicate + whether the relocation is from a SHT_REL or SHT_RELA section. + Relocate against any debug section symbol, not just STT_SECTION + symbols. For SHT_REL relocations, fetch addend from offset and + add it to symbol value if not zero. + + 2011-05-23 Mark Wielaard + + * strip.c (OPT_RELOC_DEBUG): New option. + (argp_option): Add new --reloc-debug-sections option. + (main): Check new option. + (parse_opt): Likewise. + (handle_elf): Remove any relocations between debug sections + in ET_REL for the debug file when requested. + + 2011-05-18 Mark Wielaard + + * strip.c (handle_elf): Make sure all sections of a removed group + section are removed too. Don't discard SHT_GROUP sections, copy + section table before it gets modified. Section group signature + symbols don't have to be retained. + + 2011-05-16 Jakub Jelinek + + * readelf.c (print_ops): Handle DW_OP_GNU_const_type, + DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert + and DW_OP_GNU_reinterpret. + + 2011-05-17 Mark Wielaard + + * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and + DW_TAG_GNU_call_site_parameter return strings. + + 2011-05-11 Marek Polacek + + * nm.c (show_symbols_sysv): Remove unused if/else, remove + unused `prefix' and `fname' parameters. + + 2011-05-07 Marek Polacek + + * unstrip.c (compare_sections_nonrel): Mark this function as static. + + 2011-04-26 Mark Wielaard + + * readelf.c (handle_notes_data): Call ebl_object_note_type_name + with note name. + + 2011-04-14 Mark Wielaard + + * readelf.c (options): Add gdb_index. + (section_e): Define section_gdb_index. + (parse_opt): Recognize gdb_index debug-dump argument. + (print_gdb_index_section): New function. + (print_debug): Add gdb_index to debug_sections. + + 2011-03-24 Petr Machata + + * readelf.c (print_debug_line_section): Emit initial space for all + opcode lines. Print offset in front of each opcode. + + 2011-03-22 Marek Polacek + + * readelf.c (handle_dynamic): Don't segfault at DT_PLTREL case. + + 2011-03-22 Mark Wielaard + + * readelf.c (dwarf_tag_string): Support DW_TAG_GNU_call_site + and DW_TAG_GNU_call_site_parameter. + (dwarf_attr_string): Support DW_AT_GNU_call_site_value, + DW_AT_GNU_call_site_data_value, + DW_AT_GNU_call_site_target, + DW_AT_GNU_call_site_target_clobbered, + DW_AT_GNU_tail_call, + DW_AT_GNU_all_tail_call_sites, + DW_AT_GNU_all_call_sites, + and DW_AT_GNU_all_source_call_sites. + (print_ops): Handle DW_OP_GNU_entry_value. + (attr_callback): Handle DW_AT_GNU_call_site_value, + DW_AT_GNU_call_site_data_value, + DW_AT_GNU_call_site_target, + and DW_AT_GNU_call_site_target_clobbered. + + 2011-03-10 Mark Wielaard + + * elflint.c (check_symtab): Use ebl_check_st_other_bits. + + 2011-02-27 Jan Kratochvil + + * readelf.c (reset_listptr): Clear TABLE->TABLE. + + 2011-02-25 Mark Wielaard + + * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling. + (dwarf_form_string): Properly format and return unknown form. + + 2011-02-23 Roland McGrath + + * readelf.c (section_name): New function. + (print_debug_abbrev_section): Use it instead of constant. + (print_debug_aranges_section): Likewise. + (print_debug_ranges_section): Likewise. + (print_debug_units): Likewise. + (print_debug_line_section): Likewise. + (print_debug_loc_section): Likewise. + (print_debug_macinfo_section): Likewise. + (print_debug_pubnames_section): Likewise. + (print_debug_str_section): Likewise. + (print_debug) [USE_ZLIB]: Match .zdebug_* sections too. + (print_debug_abbrev_section): Use decoded d_size, not sh_size. + (print_debug_str_section): Likewise. + + * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature. + +2011-03-23 Petr Machata + + * readelf.c (handle_dynamic, handle_relocs_rel) + (handle_relocs_rela, handle_versym, print_liblist): + Use gelf_fsize instead of relying on shdr->sh_entsize. + 2011-02-11 Roland McGrath * elfcmp.c (verbose): New variable. diff --cc src/strip.c index ddf3f1655,cf6bd971a..d2006091e --- a/src/strip.c +++ b/src/strip.c @@@ -735,14 -739,26 +752,30 @@@ handle_elf (int fd, Elf *elf, const cha { /* If a relocation section is marked as being removed make sure the section it is relocating is removed, too. */ - if ((shdr_info[cnt].shdr.sh_type == SHT_REL + if (shdr_info[cnt].shdr.sh_type == SHT_REL || shdr_info[cnt].shdr.sh_type == SHT_RELA) - && shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0) - shdr_info[cnt].idx = 1; + { + if (shdr_info[cnt].shdr.sh_info >= shnum) + goto illformed; + else if (shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0) - shdr_info[cnt].idx = 1; - } ++ shdr_info[cnt].idx = 1; ++ } + + /* If a group section is marked as being removed make + sure all the sections it contains are being removed, too. */ + if (shdr_info[cnt].shdr.sh_type == SHT_GROUP) + { + Elf32_Word *grpref; + grpref = (Elf32_Word *) shdr_info[cnt].data->d_buf; + for (size_t in = 1; + in < shdr_info[cnt].data->d_size / sizeof (Elf32_Word); + ++in) + if (shdr_info[grpref[in]].idx != 0) + { + shdr_info[cnt].idx = 1; + break; + } + } } if (shdr_info[cnt].idx == 1) @@@ -1285,9 -1296,15 +1320,17 @@@ } else if (debug_fname == NULL || shdr_info[cnt].debug_data == NULL) - /* This is a section symbol for a section which has - been removed. */ - elf_assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION); + /* This is a section or group signature symbol + for a section which has been removed. */ + { + size_t sidx = (sym->st_shndx != SHN_XINDEX + ? sym->st_shndx : xshndx); - assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION - || (shdr_info[sidx].shdr.sh_type == SHT_GROUP - && shdr_info[sidx].shdr.sh_info == inner)); ++ elf_assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION ++ || ((shdr_info[sidx].shdr.sh_type ++ == SHT_GROUP) ++ && (shdr_info[sidx].shdr.sh_info ++ == inner))); + } } if (destidx != inner)