aboutsummaryrefslogtreecommitdiff
path: root/binutils
AgeCommit message (Collapse)AuthorFilesLines
2020-02-10Allow objcopy's --set-section-flags options to add or remove the SHF_EXCLUDE ↵Fangrui Song3-5/+11
flag of ELF sections. * objcopy.c (parse_flags): Handle "exclude". * doc/binutils.texi: Document the support.
2020-02-10More debuginfod tests fixes.Aaron Merey2-15/+30
Start server before setting environment variable. Specify tmpdir as the location of the server's database. Check additional server metrics at start-up.
2020-02-10Fix potential problem with binutils debuginfod tests.Aaron Merey2-3/+8
* binutils/testsuite/binutils-all/debuginfod.exp: Replace set ::env with setenv.
2020-02-07Update release making notes.Nick Clifton2-0/+8
* README-how-to-make-a-release: Add note about updating the GAS/NEWS URL in the next release.
2020-02-07Add support for the GBZ80 and Z80N variants of the Z80 architecture, and add ↵Sergey Belyashov2-0/+7
DWARF debug info support to the Z80 assembler. PR 25469 bfd * archures.c: Add GBZ80 and Z80N machine values. * reloc.c: Add BFD_RELOC_Z80_16_BE. * coff-z80.c: Add support for new reloc. * coffcode.h: Add support for new machine values. * cpu-z80.c: Add support for new machine names. * elf32-z80.c: Add support for new reloc. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. binutils* readelf.c (get_machine_flags): Add support for Z80N machine number. gas * config/tc-z80.c: Add -gbz80 command line option to generate code for the GameBoy Z80. Add support for generating DWARF. * config/tc-z80.h: Add support for DWARF debug information generation. * doc/c-z80.texi: Document new command line option. * testsuite/gas/z80/gbz80_all.d: New file. * testsuite/gas/z80/gbz80_all.s: New file. * testsuite/gas/z80/z80.exp: Run the new tests. * testsuite/gas/z80/z80n_all.d: New file. * testsuite/gas/z80/z80n_all.s: New file. * testsuite/gas/z80/z80n_reloc.d: New file. include * coff/internal.h (R_IMM16BE): Define. * elf/z80.h (EF_Z80_MACH_Z80N): Define. (R_Z80_16_BE): New reloc. ld * emulparams/elf32z80.sh: Use z80 emulation. * emultempl/z80.em: Make generic to both COFF and ELF Z80 emulations. * emultempl/z80elf.em: Delete. * testsuite/ld-elf/pr22450.d: Expect to fail for the Z80. * testsuite/ld-elf/sec64k.exp: Fix Z80 assembly. * testsuite/ld-unique/pr21529.s: Avoid register name conflict. * testsuite/ld-unique/unique.s: Likewise. * testsuite/ld-unique/unique_empty.s: Likewise. * testsuite/ld-unique/unique_shared.s: Likewise. * testsuite/ld-unique/unique.d: Updated expected output. * testsuite/ld-z80/arch_z80n.d: New file. * testsuite/ld-z80/comb_arch_z80_z80n.d: New file. * testsuite/ld-z80/labels.s: Add more labels. * testsuite/ld-z80/relocs.s: Add more reloc tests. * testsuite/ld-z80/relocs_f_z80n.d: New file opcodes * z80-dis.c: Add support for GBZ80 opcodes.
2020-02-07Silcence a compile time warning message building the binutils with gcc-10 on ↵Nick Clifton2-0/+10
an s390 host. * dwarf.c (display_debug_lines_decoded): Force a NUL termination of the truncated file name.
2020-02-06Fix attributation of previous deltaNick Clifton1-1/+1
2020-02-06Jump visualization: Handle the case where the disassembled bytes occupy two ↵Thomas Troeger2-37/+53
lines. * objdump.c (print_jump_visualisation): New function. (disassemble_bytes): Call new function.
2020-02-06mbind gas tests and supports_gnu_osabi testsuite infrastructureAlan Modra2-18/+49
With the addition of section16 tests we have multiple tests advertising themselves as "mbind sections" and "mbind section contents". This patch fixes that, and fails on quite a few targets that force an OSABI value. It's a pain specifying all the relevant arm targets on an xfail line, so I wrote supports_gnu_osabi. binutils/ * testsuite/lib/binutils-common.exp (match_target): Accept '!' before TCL procedure. (supports_gnu_osabi): New procedure. (is_generic): New, from ld-lib.exp. (supports_gnu_unique): Use the above. gas/ * testsuite/gas/elf/section12a.d: Use supports_gnu_osabi in xfail, and rename test. * testsuite/gas/elf/section12b.d: Likewise. * testsuite/gas/elf/section16a.d: Likewise. * testsuite/gas/elf/section16b.d: Likewise. ld/ * testsuite/lib/ld-lib.exp (is_generic): Delete. * testsuite/ld-unique/unique.exp: Exclude tic6x.
2020-02-04Missing objdump dependency od-elf32_avrAlan Modra4-2/+10
* Makefile.am (CFILES): Add od-elf32_avr.c. * Makefile.in: Regenerate. * po/POTFILES.in: Regenerate.
2020-02-03readelf: add missing newlines to error messagesAndreas Schwab2-6/+16
* readelf.c (dump_relocations, dump_relocations) (decode_arm_unwind_bytecode, process_dynamic_section) (get_symbol_visibility, get_alpha_symbol_other): Add newline to error message.
2020-02-03binutils: drop redundant 'program_name' definition (-fno-common)Sergei Trofimovich4-6/+6
* coffdump.c (program_name): Drop redundant definition. * srconv.c (program_name): Likewise * sysdump.c (program_name): Likewise Signed-off-by: Sergei Trofimovich <siarheit@google.com>
2020-02-02ELF: Add support for unique section ID to assemblerH.J. Lu2-0/+13
Clang's integrated assembler supports multiple section with the same name: .section .text,"ax",@progbits,unique,1 nop .section .text,"ax",@progbits,unique,2 nop "unique,N" assigns the number, N, as the section ID, to a section. The valid values of the section ID are between 0 and 4294967295. It can be used to distinguish different sections with the same section name. This is useful with -fno-unique-section-names -ffunction-sections. -ffunction-sections by default generates .text.foo, .text.bar, etc. Using the same string can save lots of space in .strtab. This patch adds section_id to bfd_section and reuses the linker internal bit in BFD section flags, SEC_LINKER_CREATED, for assmebler internal use to mark valid section_id. It also updates objdump to compare section pointers if 2 sections comes from the same file since 2 different sections can have the same section name. bfd/ PR gas/25380 * bfd-in2.h: Regenerated. * ecoff.c (bfd_debug_section): Add section_id. * section.c (bfd_section): Add section_id. (SEC_ASSEMBLER_SECTION_ID): New. (BFD_FAKE_SECTION): Add section_id. binutils/ PR gas/25380 * objdump.c (sym_ok): Return FALSE if 2 sections are in the same file with different section pointers. gas/ PR gas/25380 * config/obj-elf.c (section_match): Removed. (get_section): Also match SEC_ASSEMBLER_SECTION_ID and section_id. (obj_elf_change_section): Replace info and group_name arguments with match_p. Also update the section ID and flags from match_p. (obj_elf_section): Handle "unique,N". Update call to obj_elf_change_section. * config/obj-elf.h (elf_section_match): New. (obj_elf_change_section): Updated. * config/tc-arm.c (start_unwind_section): Update call to obj_elf_change_section. * config/tc-ia64.c (obj_elf_vms_common): Likewise. * config/tc-microblaze.c (microblaze_s_data): Likewise. (microblaze_s_sdata): Likewise. (microblaze_s_rdata): Likewise. (microblaze_s_bss): Likewise. * config/tc-mips.c (s_change_section): Likewise. * config/tc-msp430.c (msp430_profiler): Likewise. * config/tc-rx.c (parse_rx_section): Likewise. * config/tc-tic6x.c (tic6x_start_unwind_section): Likewise. * doc/as.texi: Document "unique,N" in .section directive. * testsuite/gas/elf/elf.exp: Run "unique,N" tests. * testsuite/gas/elf/section15.d: New file. * testsuite/gas/elf/section15.s: Likewise. * testsuite/gas/elf/section16.s: Likewise. * testsuite/gas/elf/section16a.d: Likewise. * testsuite/gas/elf/section16b.d: Likewise. * testsuite/gas/elf/section17.d: Likewise. * testsuite/gas/elf/section17.l: Likewise. * testsuite/gas/elf/section17.s: Likewise. * testsuite/gas/i386/unique.d: Likewise. * testsuite/gas/i386/unique.s: Likewise. * testsuite/gas/i386/x86-64-unique.d: Likewise. * testsuite/gas/i386/i386.exp: Run unique and x86-64-unique. ld/ PR gas/25380 * testsuite/ld-i386/pr22001-1c.S: Use "unique,N" in .section directives. * testsuite/ld-i386/tls-gd1.S: Likewise. * testsuite/ld-x86-64/pr21481b.S: Likewise.
2020-02-01Update release making documentationNick Clifton2-20/+48
2020-01-31Updated translations for some of the binutils sub-directoriesNick Clifton2-1827/+2171
2020-01-28Improve warning message from debuginfod support in readelf.Nick Clifton2-21/+21
* readelf.c (get_build_id): Simplify warning message about corrupt notes encountered whilst scanning for the build-id.
2020-01-27Fix objcopy --merge-notes dependency on qsort implementation behavior.users/roland/objcopy-merge-notes-qsortRoland McGrath2-16/+23
binutils/ * objcopy.c (compare_gnu_build_notes): Fix comparison results for overlapping ranges so that (A == B) == (B == A) holds.
2020-01-27Replace deprecated tcl case statements with switch statementsAlan Modra2-3/+20
binutils/ * testsuite/lib/binutils-common.exp (big_or_little_endian): Replace case statement with switch statement. gas/ * testsuite/gas/all/gas.exp: Replace case statements with switch statements. * testsuite/gas/elf/elf.exp: Likewise. * testsuite/gas/macros/macros.exp: Likewise. * testsuite/lib/gas-defs.exp: Likewise. ld/ * testsuite/ld-elfvers/vers.exp: Replace case statements with switch statements. * testsuite/ld-ifunc/ifunc.exp: Likewise. * testsuite/ld-unique/unique.exp: Likewise.
2020-01-24Fix issue with warning messages about corrupt debuginfod notes.Nick Clifton2-2/+7
* readelf.c (get_build_id): Fix warning messages about corrupt notes.
2020-01-23Updated translations for various binutils sub-directories.Nick Clifton2-1831/+2227
2020-01-22PR25417, Fix minor typosYuri Chornoivan2-1/+6
PR 25417 binutils/ * readelf.c (get_alpha_symbol_other): Fix error message typo. ld/ * ldlang.c (ldlang_open_ctf): Fix error message typo. * emultempl/z80elf.em (z80_elf_after_open): Likewise.
2020-01-20Updated translations for various binutils sub-directoriesNick Clifton3-3678/+4469
2020-01-18Update the notes on how to create a branch prior to a new release.Nick Clifton2-18/+24
2020-01-18Update version to 2.34.50. Regenerate configure and .pot files.Nick Clifton4-1063/+1094
2020-01-18Add markers for 2.34 branch to the NEWS files and ChangeLogs.Nick Clifton4-6/+13
2020-01-17Improve the performance of the ascii art jump visualizer.Thomas Troeger2-27/+46
* objdump.c (jump_info_visualize_address): Discard jumps that are no longer needed. (disassemble_bytes): Only compute the maximum level if jumps were detected.
2020-01-13Moev declaration of loop variable outside of the loop.Nick Clifton2-1/+3
* objdump.c (disassemble_bytes): Remove C99-ism.
2020-01-13Add test driver for the debuginfod support in the binutils sub-directory.Nick Clifton2-0/+193
* testsuite/binutils-all/debuginfod.exp: New tests.
2020-01-13Add an option to objdump's disassembler to generate ascii art diagrams ↵Thomas Troeger4-5/+764
showing the destinations of flow control instructions. binutils* objdump.c (visualize_jumps, color_output, extended_color_output) (detected_jumps): New variables. (usage): Add the new jump visualization options. (option_values): Add new option value. (long_options): Add the new option. (jump_info_new, jump_info_free): New functions. (jump_info_min_address, jump_info_max_address): Likewise. (jump_info_end_address, jump_info_is_start_address): Likewise. (jump_info_is_end_address, jump_info_size): Likewise. (jump_info_unlink, jump_info_insert): Likewise. (jump_info_add_front, jump_info_move_linked): Likewise. (jump_info_intersect, jump_info_merge): Likewise. (jump_info_sort, jump_info_visualize_address): Likewise. (disassemble_jumps): New function - used to locate jumps. (disassemble_bytes): Add ascii art generation. (disassemble_section): Add scan to locate jumps. (main): Parse the new visualization option. * doc/binutils.texi: Document the new feature. * NEWS: Mention the new feature. opcodes * arm-dis.c (print_insn_arm): Fill in insn info fields for control flow instructions. (print_insn_thumb16, print_insn_thumb32): Likewise. (print_insn): Initialize the insn info. * i386-dis.c (print_insn): Initialize the insn info fields, and detect jumps.
2020-01-13Re: PR23560, PR23561, readelf memory leaksAlan Modra1-2/+2
PR 25360 PR 25361 Dyslexia strikes again. Fix git commit a788aedd86da983faf0afef3cb41461118a2e9f2 ChangeLog.
2020-01-13PR23560, PR23561, readelf memory leaksAlan Modra3-12/+44
PR 23560 PR 23561 * dwarf.c (display_debug_frames): Move fde_fc earlier. Free fde_fc col_type and col_offset. * readelf.c (apply_relocations): Move symsec check earlier. (free_debug_section): Free reloc_info. (process_notes_at): Free pnotes on error path. (process_object): Free dump_sects here.. (process_archive): ..not here.
2020-01-13PR25362, memory leak in nmAlan Modra2-0/+7
PR 25362 * nm.c (display_rel_file): Free dyn_syms.
2020-01-09Fix an attempt to free a static pointer when using objcopy's symbol addition ↵Nick Clifton2-5/+18
feature. PR 25220 * objcopy.c (empty_name): New variable. (need_sym_before): Prevent an attempt to free a static variable. (filter_symbols): Avoid strcmp test by checking for pointer equality.
2020-01-09Update Traditional Chinese translation for the binutils sub-directory.Nick Clifton2-335/+34
* po/zh_TW.po: Updated Traditional Chinese translation.
2020-01-09Add support for debuginfod to the binutils (disable by default, enabled via ↵Aaron Merey13-59/+468
a configure time option). debuginfod is a lightweight web service that indexes ELF/DWARF debugging resources by build-id and serves them over HTTP. This patch enables objdump and readelf to query debuginfod servers when they are otherwise not able to find separate debug files. Binutils can be built with debuginfod using the --with-debuginfod configure option. This requires that libdebuginfod be installed and found at configure time. debuginfod is packaged with elfutils, starting with version 0.178. For more information see https://sourceware.org/elfutils/. toplevel* config/debuginfod.m4: New file. Add macro AC_DEBUGINFOD. Adds new configure option --with-debuginfod. * configure: Regenerate. * configure.ac: Call AC_DEBUGINFOD. binutils* Makefile.am (readelf_LDADD, objdump_LDADD): Add libdebuginfod. * Makefile.in: Regenerate. * NEWS: Update. * config.in: Regenerate. * configure: Regenerate. * configure.ac: Call AC_DEBUGINFOD. * doc/Makefile.in: Regenerate. * doc/binutils.texi: Add section on using binutils with debuginfod. * dwarf.c (debuginfod_fetch_separate_debug_info): New function. Query debuginfod servers for the target debug file. (load_separate_debug_info): Call debuginfod_fetch_separate_debug_info if configured with debuginfod. (load_separate_debug_files): Add file argument to load_separate_debug_info calls. * dwarf.h (get_build_id): Add declaration. * objdump.c (get_build_id): New function. Get build-id of file. * readelf.c (get_build_id): Likewise. * testsuite/binutils-all/debuginfod.exp: New tests. * testsuite/binutils-all/linkdebug.s: Add .note.gnu.build-id section.
2020-01-03Mach-O: misc build adjustmentsJan Beulich1-1/+1
Oldish gcc warns about local variables shadowing outer scope ones. Additionally %lx is not (always) suitable to print the result of bfd_get_32().
2020-01-02Add support for the GBZ80, Z180, and eZ80 variants of the Z80 architecure. ↵Sergey Belyashov3-1785/+2110
Add an ELF based target for these as well. PR 25224 bfd * Makefile.am: Add z80-elf target support. * configure.ac: Likewise. * targets.c: Likewise. * config.bfd: Add z80-elf target support and new arches: ez80 and z180. * elf32-z80.c: New file. * archures.c: Add new z80 architectures: eZ80 and Z180. * coffcode.h: Likewise. * cpu-z80.c: Likewise. * bfd-in2.h: Likewise plus additional Z80 relocations. * coff-z80.c: Add new relocations for Z80 target and local label check. gas * config/tc-z80.c: Add new architectures: Z180 and eZ80. Add support for assembler code generated by SDCC. Add new relocation types. Add z80-elf target support. * config/tc-z80.h: Add z80-elf target support. Enable dollar local labels. Local labels starts from ".L". * testsuite/gas/all/fwdexp.d: Fix failure due to symbol conflict. * testsuite/gas/all/fwdexp.s: Likewise. * testsuite/gas/z80/suffix.d: Fix failure on ELF target. * testsuite/gas/z80/z80.exp: Add new tests * testsuite/gas/z80/dollar.d: New file. * testsuite/gas/z80/dollar.s: New file. * testsuite/gas/z80/ez80_adl_all.d: New file. * testsuite/gas/z80/ez80_adl_all.s: New file. * testsuite/gas/z80/ez80_adl_suf.d: New file. * testsuite/gas/z80/ez80_isuf.s: New file. * testsuite/gas/z80/ez80_z80_all.d: New file. * testsuite/gas/z80/ez80_z80_all.s: New file. * testsuite/gas/z80/ez80_z80_suf.d: New file. * testsuite/gas/z80/r800_extra.d: New file. * testsuite/gas/z80/r800_extra.s: New file. * testsuite/gas/z80/r800_ii8.d: New file. * testsuite/gas/z80/r800_z80_doc.d: New file. * testsuite/gas/z80/z180.d: New file. * testsuite/gas/z80/z180.s: New file. * testsuite/gas/z80/z180_z80_doc.d: New file. * testsuite/gas/z80/z80_doc.d: New file. * testsuite/gas/z80/z80_doc.s: New file. * testsuite/gas/z80/z80_ii8.d: New file. * testsuite/gas/z80/z80_ii8.s: New file. * testsuite/gas/z80/z80_in_f_c.d: New file. * testsuite/gas/z80/z80_in_f_c.s: New file. * testsuite/gas/z80/z80_op_ii_ld.d: New file. * testsuite/gas/z80/z80_op_ii_ld.s: New file. * testsuite/gas/z80/z80_out_c_0.d: New file. * testsuite/gas/z80/z80_out_c_0.s: New file. * testsuite/gas/z80/z80_reloc.d: New file. * testsuite/gas/z80/z80_reloc.s: New file. * testsuite/gas/z80/z80_sli.d: New file. * testsuite/gas/z80/z80_sli.s: New file. ld * Makefile.am: Add new target z80-elf * configure.tgt: Likewise. * emultempl/z80.em: Add support for eZ80 and Z180 architectures. * emulparams/elf32z80.sh: New file. * emultempl/z80elf.em: Likewise. * testsuite/ld-z80/arch_ez80_adl.d: Likewise. * testsuite/ld-z80/arch_ez80_z80.d: Likewise. * testsuite/ld-z80/arch_r800.d: Likewise. * testsuite/ld-z80/arch_z180.d: Likewise. * testsuite/ld-z80/arch_z80.d: Likewise. * testsuite/ld-z80/comb_arch_ez80_z80.d: Likewise. * testsuite/ld-z80/comb_arch_z180.d: Likewise. * testsuite/ld-z80/labels.s: Likewise. * testsuite/ld-z80/relocs.s: Likewise. * testsuite/ld-z80/relocs_b_ez80.d: Likewise. * testsuite/ld-z80/relocs_b_z80.d: Likewise. * testsuite/ld-z80/relocs_f_z80.d: Likewise. * testsuite/ld-z80/z80.exp: Likewise. opcodes * z80-dis.c: Add support for eZ80 and Z80 instructions.
2020-01-01Re: Update year range in copyright notice of binutils filesAlan Modra1-0/+4
Add the ChangeLog entry.
2020-01-01Update year range in copyright notice of binutils filesAlan Modra140-141/+141
2020-01-01ChangeLog rotationAlan Modra2-1513/+1527
2019-12-30Re: Revise sleb128 and uleb128 readerAlan Modra2-21/+28
A missing part of git commit cd30bcef4a685. * od-macho.c: Include elfcomm.h. (dump_dyld_info_rebase, dump_dyld_info_bind): Fix read_leb128 args. (dump_dyld_info_export_1, dump_segment_split_info): Likewise.
2019-12-23Fix build 32-bit-host build error last for last binutils/dwarf2.c change.Hans-Peter Nilsson2-1/+6
* dwarf.c (display_debug_lines_decoded): Cast printf parameter to format type to correct last change.
2019-12-23Revise sleb128 and uleb128 readerAlan Modra4-1065/+833
This patch catches and reports errors when reading leb128 values, addressing a FIXME in read_leb128. * dwarf.h (read_leb128): Update prototype. (report_leb_status): New inline function. (SKIP_ULEB, SKIP_SLEB, READ_ULEB, READ_SLEB): Define. * dwarf.c: Use above macros throughout file. Formatting. (read_leb128): Reorder params. Add status return param. Don't stop reading until finding terminator or end of data. Detect loss of significant bits. Sign extend only on terminating byte. (read_sleb128, read_uleb128): Delete functions. (SKIP_ULEB, SKIP_SLEB, READ_ULEB, READ_SLEB): Delete macros. (read_and_print_leb128): Rewrite. (process_extended_line_op): Return a size_t. Use size_t vars. Adjust to suit new macros. Add proper name size to "data" when processing DW_LNE_define_file. (process_abbrev_section): Adjust to suit new macros. (decode_location_expression, skip_attr_bytes): Likewise. (get_type_signedness): Likewise. (read_and_display_attr_value): Likewise. Consolidate block code. (process_debug_info): Adjust to suit new macros. (display_formatted_table, display_debug_lines_raw): Likewise. (display_debug_lines_decoded): Likewise. Properly check for end of DW_LNS_extended_op. (display_debug_macinfo): Adjust to suit new macros. (get_line_filename_and_dirname, display_debug_macro): Likewise. (display_view_pair_list): Likewise. Don't back off when hitting end of data. (display_loc_list): Adjust to suit new macros. (display_loclists_list, display_loc_list_dwo): Likewise. (display_debug_rnglists_list, read_cie): Likewise. (display_debug_frames): Likewise. * readelf.c: Use new ULEB macros throughout file. (read_uleb128): Delete. (decode_arm_unwind_bytecode): Use read_leb128. (decode_tic6x_unwind_bytecode): Likewise. (display_tag_value): Adjust to suit new macros. (display_arc_attribute, display_arm_attribute): Likewise. (display_gnu_attribute, display_power_gnu_attribute): Likewise. (display_s390_gnu_attribute, display_sparc_gnu_attribute): Likewise. (display_mips_gnu_attribute, display_tic6x_attribute): Likewise. (display_msp430x_attribute, display_msp430_gnu_attribute): Likewise. (display_riscv_attribute, process_attributes): Likewise.
2019-12-17Prefer object over notype symbols when disassemblingAlan Modra2-16/+47
Changing objdump disassembly output like this always requires some testsuite changes, with the avr and x64_64 changes simply due to picking up better symbols, the whole point of the patch. The mips changes are due to mips-sgi-irix changing STT_NOTYPE symbols to STT_OBJECT, which objdump now chooses in preference to script symbols. The problem is that objdump looks at the first symbol in the section being disassembled, and if object type, just dumps out bytes rather than disassembling. This results in new failures: FAIL: JAL overflow 2 FAIL: undefined weak symbol overflow FAIL: undefined weak symbol overflow (n32) FAIL: undefined weak symbol overflow (n64) So for mips-sgi-irix function symbols really do need to be function type. I fixed a few more than just the required minimum to avoid the above test fails. binutils/ * objdump.c (compare_section): New static var. (compare_symbols): Sort by current section only. Don't access symbol name out of bounds when checking for file symbols. Sort section symbols and object symbols. (find_symbol_for_address): Remove bogus debugging and section symbol test. (disassemble_data): Move symbol sort from here.. (disassemble_section): ..to here. Set compare_section. ld/ * testsuite/ld-avr/lds-mega.d: Adjust symbols to suit objdump change. * testsuite/ld-avr/lds-tiny.d: Likewise. * testsuite/ld-x86-64/load2.d: Likewise. * testsuite/ld-mips-elf/compact-eh1.s: Give function symbols function type. * testsuite/ld-mips-elf/compact-eh1a.s: Likewise. * testsuite/ld-mips-elf/compact-eh1b.s: Likewise. * testsuite/ld-mips-elf/compact-eh2.s: Likewise. * testsuite/ld-mips-elf/compact-eh3.s: Likewise. * testsuite/ld-mips-elf/compact-eh3a.s: Likewise. * testsuite/ld-mips-elf/eh-frame5.s: Likewise. * testsuite/ld-mips-elf/ehdr_start-new.s: Likewise. * testsuite/ld-mips-elf/ehdr_start-o32.s: Likewise. * testsuite/ld-mips-elf/emit-relocs-1a.s: Likewise. * testsuite/ld-mips-elf/jaloverflow-2.s: Likewise. * testsuite/ld-mips-elf/jaloverflow.s: Likewise. * testsuite/ld-mips-elf/mips16-call-global-1.s: Likewise. * testsuite/ld-mips-elf/mips16-intermix-1.s: Likewise. * testsuite/ld-mips-elf/mips16-pic-1b.s: Likewise. * testsuite/ld-mips-elf/mips16-pic-4c.s: Likewise. * testsuite/ld-mips-elf/no-shared-1-n64.s: Likewise. * testsuite/ld-mips-elf/no-shared-1-o32.s: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-1b-micromips.s: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-1b.s: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-2a.s: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-3b.s: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-4b.s: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-5a.s: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-6-n32c.s: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-6-n64c.s: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-6-o32c.s: Likewise. * testsuite/ld-mips-elf/pie.s: Likewise. * testsuite/ld-mips-elf/relax-jalr.s: Likewise. * testsuite/ld-mips-elf/reloc-1a.s: Likewise. * testsuite/ld-mips-elf/reloc-2a.s: Likewise. * testsuite/ld-mips-elf/reloc-4.s: Likewise. * testsuite/ld-mips-elf/reloc-5.s: Likewise. * testsuite/ld-mips-elf/reloc-6b.s: Likewise. * testsuite/ld-mips-elf/textrel-1.s: Likewise. * testsuite/ld-mips-elf/undefweak-overflow.s: Likewise. * testsuite/ld-mips-elf/undefweak-overflow.d: Adjust.
2019-12-17Remove tic80 supportAlan Modra3-2/+6
This is one way of fixing ubsan bug reports, just delete the code. The assembler support was removed back in 2005 along with other non-BFD assemblers, but somehow the remainder of the port stayed in. bfd/ * coff-tic80.c: Delete file. * cpu-tic80.c: Delete file. * archures.c: Remove tic80 support. * coffcode.h: Likewise. * coffswap.h: Likewise. * targets.c: Likewise. * config.bfd: Likewise. * configure.ac: Likewise. * Makefile.am: Likewise. * Makefile.in: Regenerate. * bfd-in2.h: Regenerate. * configure: Regenerate. * po/SRC-POTFILES.in: Regenerate. binutils/ * testsuite/binutils-all/objcopy.exp: Remove tic80 support. * testsuite/binutils-all/objdump.exp: Likewise. gas/ * doc/as.texi: Remove mention of tic80. include/ * coff/tic80.h: Delete file. * opcode/tic80.h: Delete file. ld/ * emulparams/tic80coff.sh: Delete file. * scripttempl/tic80coff.sc: Delete file. * configure.tgt: Remove tic80 support. * Makefile.am: Likewise. * Makefile.in: Regenerate. * po/BLD-POTFILES.in: Regenerate. opcodes/ * tic80-dis.c: Delete file. * tic80-opc.c: Delete file. * disassemble.c: Remove tic80 support. * disassemble.h: Likewise. * Makefile.am: Likewise. * configure.ac: Likewise. * Makefile.in: Regenerate. * configure: Regenerate. * po/POTFILES.in: Regenerate.
2019-12-11Make bfd_get_8 return a bfd_vma like other bfd_get_* functionsAlan Modra2-2/+8
And similarly for bfd_get_signed_8. bfd/ * libbfd.c (bfd_get_8): Return a bfd_vma. (bfd_get_signed_8): Return a bfd_signed_vma. * bfd-in2.h: Regenerate. binutils/ * od-xcoff.c (dump_dumpx_core): Adjust for bfd_h_get_8 change.
2019-12-10PR24960, Memory leak from disassemblerAlan Modra2-0/+6
PR 24960 include/ * dis-asm.h (disassemble_free_target): Declare. opcodes/ * disassemble.c (disassemble_free_target): New function. binutils/ * objdump.c (disassemble_data): Call disassemble_free_target.
2019-12-10Delete duplicate struct objdump_disasm_info fieldAlan Modra2-6/+12
objdump_disasm_info.sec duplicates disassemble_info.section * objdump.c (struct objdump_disasm_info): Delete "sec". (find_symbol_for_address): Use inf->section rather than aux->sec. (objdump_print_addr, disassemble_bytes): Likewise. (disassemble_section): Don't set aux->sec.
2019-12-08Optional matching for run_dump_testAlan Modra2-0/+23
This adds an alternative to using #... in dump files, useful where we only want to allow specific extra output. DW_CFA_nop in CIEs and FDEs to pad out to required alignment (larger for 64-bit than 32-bit) is an example where these optional match patterns are useful. binutils/ * testsuite/lib/binutils-common.exp (regexp_diff): Support #?REGEXP. ld/ * testsuite/ld-elf/eh4.d: Match optional padding DW_CFA_nop in FDEs. * testsuite/ld-elf/eh5.d: Likewise, and extra CIEs emitted on embedded targets.
2019-11-28binutils/gas/riscv: Add DWARF register numbers for CSRsAndrew Burgess2-3/+43
This commit gives DWARF register numbers to the RISC-V CSRs inline with the RISC-V ELF specification here: https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md The CSRs are defined being numbered from 4096 to 8191. This adds support to the assembler, required in order to reference CSRs in, for example .cfi directives. I have then extended dwarf.c in order to support printing CSR names in the dumped DWARF output. As the CSR name space is quite large and only sparsely populated, I have provided a new function to perform RISC-V DWARF register name lookup which uses a switch statement rather than the table base approach that other architectures use. Any CSR that does not have a known name will return a name based on 'csr%d' with the %d being replaced by the offset of the CSR from 4096. gas/ChangeLog: * config/tc-riscv.c (tc_riscv_regname_to_dw2regnum): Lookup CSR names too. * testsuite/gas/riscv/csr-dw-regnums.d: New file. * testsuite/gas/riscv/csr-dw-regnums.s: New file. binutils/ChangeLog: * dwarf.c (regname_internal_riscv): New function. (init_dwarf_regnames_riscv): Use new function. Change-Id: I3f70bc24fa8b3c75744e6775eeeb87db70c7ecfb