Age | Commit message (Collapse) | Author | Files | Lines |
|
augmentation data.
PR 22386
* dwarf.c (read_cie): Use bfd_size_type for
augmentation_data_len.
(display_augmentation_data): New function.
(display_debug_frames): Use it.
Check for integer overflow when testing augmentation_data_len.
|
|
when run on a 32-bit host.
PR 22384
* readelf.c (print_gnu_property_note): Improve overflow checks so
that they will work on a 32-bit host.
|
|
requires the use of linker relaxations. The change is quite large, so submission is in several parts.
Part 2 adds a relaxation pass, which actually implements the code compression scheme.
bfd * archures.c: Add bfd_mach_ft32b.
* cpu-ft32.c: Add arch_info_struct.
* elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
DIFF32. (ft32_elf_relocate_section): Add clauses
for R_FT32_SC0, SC1, DIFF32. (ft32_reloc_shortable,
elf32_ft32_is_diff_reloc, elf32_ft32_adjust_diff_reloc_value,
elf32_ft32_adjust_reloc_if_spans_insn,
elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target,
ft32_elf_relax_section): New function.
* reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
gas * config/tc-ft32.c (md_assemble): add relaxation reloc
BFD_RELOC_FT32_RELAX. (md_longopts): Add "norelax" and
"no-relax". (md_apply_fix): Add reloc BFD_RELOC_FT32_DIFF32.
(relaxable_section, ft32_validate_fix_sub, ft32_force_relocation,
ft32_allow_local_subtract): New function.
* config/tc-ft32.h: remove unused MD_PCREL_FROM_SECTION.
* testsuite/gas/ft32/insnsc.s: New test exercising all FT32B
shortcodes.
include * elf/ft32.h: Add R_FT32_RELAX, SC0, SC1, DIFF32.
|
|
ELF archive with --no-keep-memory enabled.
PR 22369
* coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
file.
* cofflink.c (coff_link_check_archive_element): Skip non-COFF
members of an archive.
|
|
relocations.
* readelf.c (process_relocs): Tell users if no static relocs were
found, but if they had added --use-dynamic to the command line
then relocs would have been displayed.
|
|
PR 22361
* readelf.c (process_archive_index_and_symbols): Ensure ar_size
field is zero terminated for strtoul.
(setup_archive, get_archive_member_name): Likewise.
|
|
When displaying the .debug_frame section, the register numbers in the
DW_CFA_def_cfa* statements are read as signed numbers. I have come
across a target that has register 121, encoded as 0x79 in unsigned LEB128.
Interpreting this as signed results in -7, which makes readelf display
"r-7".
The DWARF5 standard (6.4.2.2) states that the register numbers should be
treated as unsigned LEB128.
Simply replacing READ_SLEB with READ_ULEB resulted in warnings like
these:
/home/emaisin/src/binutils-gdb/binutils/dwarf.c: In function ‘display_debug_frames’:
/home/emaisin/src/binutils-gdb/binutils/dwarf.c:355:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
if ((var) != _val) \
^
/home/emaisin/src/binutils-gdb/binutils/dwarf.c:7866:8: note: in expansion of macro ‘READ_ULEB’
READ_ULEB (fc->cfa_reg);
^
... so I also changed Frame_Chunk::cfa_reg to an unsigned int.
binutils/ChangeLog:
* dwarf.c (struct Frame_Chunk) <cfa_reg>: Change type to
unsigned int.
(display_debug_frames): Read CFA reg as an unsigned number.
|
|
Some targets prefix global symbols with "_".
bfd/
* archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
optionally prefixed with "_".
* linker.c (_bfd_generic_link_add_one_symbol): Likewise.
binutils/
* nm.c (filter_symbols): Match "__gnu_lto_slim" optionally prefixed
with "_".
gold/
* symtab.cc (Symbol_table::add_from_relobj): Match "__gnu_lto_slim"
optionally prefixed with "_".
ld/
* testsuite/ld-plugin/lto-3r.d: Match "__gnu_lto_v" optionally
prefixed with "_".
* testsuite/ld-plugin/lto-5r.d: Likewise.
|
|
binutils/
* MAINTAINERS: Add myself as Visium maintainer.
opcodes/
* visium-dis.c (disassem_class1) <case 0>: Print the operands.
|
|
the files in the tarball.
* README-how-to-make-a-release: A note about checking file and
directory permissions.
|
|
* MAINTAINERS: Move Svein Seldal to Past Maintainers section.
|
|
The print_core_note change here fixes the PR, the rest is making
readelf a little more bombproof against maliciously crafted binaries.
PR 22303
* readelf.c (print_core_note): Ensure "count" sanity check
calculation doesn't overflow.
(process_notes_at): Perform note namesz and descsz checks
using unsigned comparisons against data remaining. Catch
alignment overflow of namesz and descsz too. Don't allocate a
temp for terminating "name" when there is space available
before descdata.
|
|
In https://sourceware.org/ml/binutils/2017-10/msg00160.html, Nick said I
should update MAINTAINERS to mention that I'm the dwarf-mode.el
maintainer. So, I'm checking this in.
2017-10-17 Tom Tromey <tom@tromey.com>
* MAINTAINERS: Add myself as dwarf-mode.el maintainer.
|
|
DW_AT_defaulted and DW_AT_discr_list DWARF attributes.
* dwarf.c (read_and_display_attr_value): Handle DW_AT_endianity,
DW_END_default, DW_END_big, DW_END_little, DW_ATE_UCS,
DW_ATE_ASCII, DW_CC_pass_by_reference, DW_CC_pass_by_value,
DW_CC_GNU_renesas_sh, DW_CC_GNU_borland_fastcall_i386,
DW_AT_decimal_sign, DW_AT_defaulted, DW_AT_discr_list.
(get_TAG_name): Report user generated tag values.
* testsuite/binutils-all/dwarf-attributes.S: New test.
* testsuite/binutils-all/dwarf-attributes.W. Expected output from
readelf.
* testsuite/binutils-all/readelf.exp: Run the new test.
|
|
Bump the dwarf-mode version number, so it can be installed by package.el
users who installed an earlier verision.
2017-10-10 Tom Tromey <tom@tromey.com>
* dwarf-mode.el: Bump to version 1.4.
|
|
I was recently examining a very large .debug file. I tried to use
dwarf-mode, but it blocked Emacs for a very long time while reading
output.
This patch changes dwarf-mode to run the objdump process asynchronously.
This way, I can still do other things in Emacs while waiting for the
dumping to finish.
2017-10-10 Tom Tromey <tom@tromey.com>
* dwarf-mode.el (dwarf--process, dwarf--deletion-region): New
defvar.
(dwarf--check-running, dwarf--sentinel, dwarf--invoke)
(dwarf--filter): New functions.
(dwarf-do-insert-substructure, dwarf-do-refresh): Call
dwarf--check-running, dwarf--invoke.
(dwarf-browse): Initialize new variables.
|
|
Emacs has had lexical binding for a while, and it's a good practice to
use it; so enable it in dwarf-mode.el.
2017-10-10 Tom Tromey <tom@tromey.com>
* dwarf-mode.el: Set lexical-binding.
|
|
It's bad Emacs style to define keys from a top-level form. Instead, one
should define a mode map separately and binding keys in the definition.
This lets users completely override the map by defining it before
loading the mode.
2017-10-10 Tom Tromey <tom@tromey.com>
* dwarf-mode.el (dwarf-mode-map): New defvar.
|
|
comp unit that ends before the specified start address.
PR 22249
* dwarf.c (process_debug_info): Skip any comp unit that ends
before dwarf_start_die.
|
|
This patch tidies DWARF header checks, consolidating the "negative"
checks (which are really overflow checks) with the section size
check. In a number of cases this also ensures that small negative
lengths are caught. For instance
hdrptr = start + arange.ar_length + initial_length_size;
if (hdrptr < start || hdrptr > end)
does not detect ar_length in the range [-initial_length_size,-1].
* dwarf.c (process_debug_info): Consolidate header length checks.
(display_debug_pubnames_worker): Use "start" to read header.
Properly check header length and report errors earlier.
Simplify loop printing pubnames.
(get_line_filename_and_dirname): Catch small negative "length"
values.
(display_debug_aranges): Likewise. Report header errors
earlier using standardized message.
(display_debug_names): Likewise.
|
|
readelf.c:decode_arm_unwind has a variable res that is used as a
return value, with FALSE meaning unsuccessful and TRUE meaning
successful. This is initialized to FALSE (and then various code in
the function sets it to FALSE again on error), meaning that when the
function is successful, if it reaches returning res is still returns
FALSE, resulting eventually in exit status 1 from readelf without any
error message to indicate an error.
This patch fixes the initialization to use TRUE, so avoiding those
spurious errors. I don't have a self-contained test for this issue;
it was observed as many prelink tests failing without the patch and
passing with it.
* readelf.c (decode_arm_unwind): Initialize res to TRUE.
|
|
PR 22260
* objcopy.c (strip_main): Add 'M' character to short options list
when calling getopt_long.
|
|
displayed.
PR 22262
binutils* readelf.c (dump_relocations): Do not truncate reloc names when
displaying output in wide mode.
ld * testsuite/ld-powerpc/relocsort.d: Update expected output (for
longer reloc names).
|
|
the source tarball.
* README-how-to-make-a-release: Merge steps 3, 4 and 5, and insert
the git tag operation at the correct location.
|
|
Pointer comparisons have traps for the unwary. After adding a large
unknown value to "start", the test "start < end" depends on where
"start" is originally in memory.
PR 22239
* dwarf.c (read_cie): Don't compare "start" and "end" pointers
after adding a possibly wild length to "start", compare the length
to the difference of the pointers instead. Remove now redundant
"negative" length test.
|
|
Also refer to global maintainers for branch release approval.
|
|
PR 22232
PR 22230
* objdump.c (load_specific_debug_section): Introduce a temp to
stop bfd_get_full_section_contents NULLing out section->start.
|
|
PR 22230
* objdump.c (load_specific_debug_section): Allocate an extra byte
for a terminating NUL.
|
|
Same line but different file ought to display file and line.
PR 21978
* objdump.c: Formatting.
(show_line): Reset prev_line when function name changes.
|
|
structure with a small negative size.
PR 22219
* dwarf.c (process_debug_info): Add a check for a negative
cu_length field.
|
|
This should make readelf bombproof given a fuzzed DT_HASH. Also
removes a bogus check that would have resulted in wrong histograms.
PR 22216
* readelf.c (process_symbol_table): Check that DT_HASH symbol
chains are only visited once, and report an error if not. Display
invalid symbol index if chain is out of range. Use the same logic
when calculating histograms rather than the PR 17531 fix. Delete
bogus check that chained index is less than number of buckets.
|
|
PR 22154
* dwarf.c (get_line_filename_and_dirname): Add extra checks for
buffer overruns.
|
|
|
|
Preprocessor tokens like DWARF_VMA_FMT and BFD_VMA_FMT are not
understood by gettext, and cause the translation string to be
truncated. Even if it were not truncated, we wouldn't want a value
that changes depending on host or configure options to be put in a
translation string.
PR 21732
* dwarf.c (READ_ULEB): Don't use DWARF_VMA_FMT in translated string.
(READ_SLEB): Likewise.
* readelf.c (bfd_vmatoa): New function.
(get_data, get_dynamic_data): Use it for printing error messages.
|
|
PR binutils/22203
* nm.c (display_rel_file): Free memory returned from
bfd_get_synthetic_symtab.
|
|
When dumping location lists, also dump locview lists that may be
interspersed with them, and bring view pairs next to the corresponding
location list entries.
This patch supports DW_AT_GNU_locviews as a separate attribute for
DWARF4- loc_lists and split (dwo) loclists, as well as DWARF5
loclists.
It also supports, in DWARF5 loclists, the proposed
DW_LLE_GNU_view_pair loclist entry type proposed for DWARF6.
The tests use 32-bit DWARF, even on 64-bit targets, resolving offsets
to constants so as to reduce the risk that relocations be created for
them, or that the offsets be rejected as nonconstants.
The patch also adds an xfail to an unrelated test, namely dw5, so that
no unexpected fails remain on nds32*-elf, one of the tested targets.
Reviewed-by: Alan Modra <amodra@gmail.com>
for include/ChangeLog
* dwarf2.def (DW_AT_GNU_locviews): New.
* dwarf2.h (enum dwarf_location_list_entry_type): Add
DW_LLE_GNU_view_pair.
(DW_LLE_view_pair): Define.
for binutils/ChangeLog
* dwarf.h (debug_info): Add loc_views and num_loc_views.
* dwarf.c (vm1): New constant.
(print_dwarf_view): New function.
(read_and_display_attr_value): Support DW_AT_GNU_locviews.
(process_debug_info): Keep num_loc_offsets and num_loc_views
in sync.
(display_view_pair_list): New function.
(display_loc_list_dwo): Take vstart_ptr; update it. Dump
location view pairs before the range they apply to, when a
viewlist augments the loc list.
(display_loc_list): Likewise. Check view numbers in range
tests.
(display_loclists_list): Likewise. Handle view pair entries,
and warn on trailing ones.
(loc_views): New variable.
(loc_offsets_compar): Compare loc_views if loc_offsets are the
same.
(display_debug_loc): Check and sort loc_views too. Accept
loc_view as expected_start. Skip if lists and views are the
same. Dump locview list separately in order, and pass the
locview list base to each list dump function. Warn and skip
overlap and hole checking if we find loclists and locviews to
not be adjacent.
* testsuite/binutils-all/locview-1.s: New.
* testsuite/binutils-all/readelf.locview-1: New.
* testsuite/binutils-all/locview-2.s: New.
* testsuite/binutils-all/readelf.locview-2: New.
* testsuite/binutils-all/readelf.exp: Run new tests. Fix
option spelling in pr18374 fail message. XFAIL dw5 test on
nds32*-elf.
|
|
We have multiple tests that report failure to assemble without saying
exactly what test is failing.
* testsuite/binutils-all/readelf.exp: Don't perror and exit on
bintest.s assembly failure. Report tests unresolved instead.
Likewise for version note test, pr18374, decompress, and dw5
tests.
(readelf_test): Set testname to include both option and binary
file name. Use for pass/fail.
|
|
Fix commit e407c74b5b60 ("Support for MIPS R5900 (Sony Playstation 2)"),
<https://sourceware.org/ml/binutils/2012-12/msg00240.html>, and add the
handling of E_MIPS_MACH_5900, correctly showing `5900' among `Flags:' in
the output of `-h' rather than `unknown CPU'.
binutils/
* readelf.c (get_machine_flags) <E_MIPS_MACH_5900>: New case.
gas/
* testsuite/gas/mips/elf_mach_5900.d: New test.
* testsuite/gas/mips/mips.exp: Run it.
|
|
PR 21995
* readelf.c (process_mips_specific): Add checks for a NULL data
pointer.
|
|
include/
* elf/ppc.h (R_PPC_VLE_ADDR20): New relocation.
bfd/
* elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
(ppc_elf_check_relocs): Handle it.
(ppc_elf_vle_split20): New function.
(ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
binutils/
* readelf.c (get_elf_section_flags): Add VLE.
(process_section_headers): Add VLE key to details.
gas/
* config/tc-ppc.c (md_parse_option): Handle "mno-vle" flag.
(ppc_elf_section_letter): New function.
* config/tc-ppc.h (md_elf_section_letter): New.
* testsuite/gas/elf/section10.d: Adjust for VLE.
|
|
PR 21994
* readelf.c (process_version_sections <SHT_GNU_verdef>): Check
vd_aux and vda_next for sanity. Delete "end". Correct overflow
checks.
(process_version_sections <SHT_GNU_verneed>): Correct overflow
check. Don't report invalid vna_next on overflow. Do report
invalid vna_next on size less than aux info.
|
|
This tidies some of the overflow checking when processing verneed
and verdef sections.
PR 21990
* readelf.c (process_version_sections <SHT_GNU_verneed>): Check
for invalid vn_next field before adding to idx. Use unsigned
long for index vars. Move index checks.
<SHT_GNU_verdef>: Likewise for vd_next.
|
|
* testsuite/binutils-all/note-3-64.s: New test. Checks assembly
and decoding of version2 GNU build attribute notes.
* testsuite/binutils-all/note-3-32.s: New test. 32-bit version of
the above test.
* testsuite/binutils-all/note-3-64.d: New test driver.
* testsuite/binutils-all/note-3-32.d: New test driver.
* testsuite/binutils-all/objcopy.exp: Run the new test.
* readelf.c (is_64bit_abs_reloc): Add R_SPARC_64.
|
|
Add new note types available since Linux 4.8 to elf/common.h and
make the 'readelf' tool aware of it.
include/
* elf/common.h (NT_PPC_TAR): New macro.
(NT_PPC_PPR): Likewise.
(NT_PPC_DSCR): Likewise.
(NT_PPC_EBB): Likewise.
(NT_PPC_PMU): Likewise.
(NT_PPC_TM_CGPR): Likewise.
(NT_PPC_TM_CFPR): Likewise.
(NT_PPC_TM_CVMX): Likewise.
(NT_PPC_TM_CVSX): Likewise.
(NT_PPC_TM_SPR): Likewise.
(NT_PPC_TM_CTAR): Likewise.
(NT_PPC_TM_CPPR): Likewise.
(NT_PPC_TM_CDSCR): Likewise.
binutils/
* readelf.c (get_note_type): Handle PPC note types available
since Linux 4.8.
|
|
* readelf.c (process_note): Qualify NT_GNU_BUILD_ATTRIBUTE notes
by name data.
|
|
PR 21909
* prdbg.c (pr_int_type): Increase size of local string buffer.
(pr_float_type): Likewise.
(pr_bool_type): Likewise.
|
|
PR 21702
* arsup.c (ar_addmod): Add plugin support for the MRI ADDMOD
command.
|
|
gas * testsuite/gas/all/gas.exp: Add am33 to the skip lists of tests
passed over by the mn10300 target.
* testsuite/gas/elf/elf.exp: Likewise.
* testsuite/gas/elf/dwarf2-11.d: Correct skip of am33 target.
* testsuite/gas/elf/dwarf2-12.d: Likewise.
* testsuite/gas/elf/dwarf2-13.d: Likewise.
* testsuite/gas/elf/dwarf2-14.d: Likewise.
* testsuite/gas/elf/dwarf2-15.d: Likewise.
* testsuite/gas/elf/dwarf2-16.d: Likewise.
* testsuite/gas/elf/dwarf2-17.d: Likewise.
* testsuite/gas/elf/dwarf2-18.d: Likewise.
* testsuite/gas/elf/dwarf2-5.d: Likewise.
* testsuite/gas/elf/dwarf2-6.d: Likewise.
* testsuite/gas/elf/dwarf2-7.d: Likewise.
binutils * testsuite/binutils-all/objdump.exp (cpus_expected): Add am33-2.
|
|
* readelf.c (is_32bit_abs_reloc): Add R_IA64_SECREL32MSB and
R_IA64_DIR32MSB.
(is_64bit_abs_reloc): Add R_IA64_DIR64MSB.
(is_64bit_pcrel_reloc): Add R_IA64_PCREL64MSB.
|
|
* po/sv.po: Updated Swedish translation.
|