aboutsummaryrefslogtreecommitdiff
path: root/binutils
AgeCommit message (Collapse)AuthorFilesLines
2017-02-15Move Eric Christopher to Past Maintainers list.Nick Clifton2-2/+6
* MAINTAINERS: (MIPS, MN10300): Move Eric Christopher to Past Maintainers section.
2017-02-14Fix invalid memory access displayiing contents of sections.Nick Clifton2-1/+16
PR binutils/21159 * readelf.c (dump_section_as_strings): Reset the start address if no decompression is perfromed. (dump_section_as_bytes): Likewise.
2017-02-14Fix an illegal memory access parsing corrupt STABD debug information.Nick Clifton2-0/+9
PR binutils/21158 * rddbg.c (read_symbol_stabs_debugging_info): Check for a null or empty symbol name.
2017-02-14Fix handling of corrupt STABS enum type strings.Nick Clifton2-1/+20
PR binutils/21157 * stabs.c (parse_stab_enum_type): Check for corrupt NAME:VALUE pairs. (parse_number): Exit early if passed an empty string.
2017-02-14Fix illegal memory access problems with readelf processing corrupt RL78 ↵Nick Clifton2-17/+28
binaries. PR binutils/21155 * readelf.c (IN_RANGE): New macro. Tests for an address + offset being within a given range. (target_specific_reloc_handling): Use macro to test for underflow as well as overflow of reloc offset.
2017-02-13Fix illegal memory access bug in nm when run on a corrupt binary.Nick Clifton2-1/+8
PR binutils/21150 * nm.c (file_symbol): Add test of string length before testing string characters.
2017-02-13Extend previous patch to cover uncompress_section_contents returning FALSE ↵Nick Clifton2-11/+28
to other callers. PR binutils/21135 (dump_section_as_bytes, load_specific_debug_section): Likewise.
2017-02-13Fix invalid read of section contents whilst processing a corrupt binary.Nick Clifton2-4/+18
PR binutils/21135 * readelf.c (dump_section_as_bytes): Handle the case where uncompress_section_contents returns false.
2017-02-13Fix invalid memory access attempting to read the compression header of a ↵Nick Clifton2-5/+29
too-small compressed section. PR binutils/21149 * readelf.c (get_compression_header): Add size parameter. Check size against sizeof compression header before attempting to extract the header. (process_section_headers): Pass size to get_compression_header. (dump_section_as_strings): Likewise. (dump_section_as_bytes): Likewise. (load_specific_debug_section): Likewise.
2017-02-13Fix check for buffer overflow when processing version information.Nick Clifton2-1/+7
PR binutils/21148 * readelf.c (process_version_sections): Include size of auxillary version information when checking for buffer overflow.
2017-02-13Fix access violation when reporting sections that could not be dumped.Nick Clifton2-3/+12
PR binutils/21147 * readelf.c (process_section_contents): Fix off by one error reporting un-dumped sections.
2017-02-13Fix read-after-free error in readelf when processing multiple, relocated ↵Nick Clifton2-25/+94
sections in an MSP430 binary. PR binutils/21139 * readelf.c (target_specific_reloc_handling): Add num_syms parameter. Check for symbol table overflow before accessing symbol value. If reloc pointer is NULL, discard all saved state. (apply_relocations): Pass num_syms to target_specific_reloc_handling. Call target_specific_reloc_handling with a NULL reloc pointer after processing all of the relocs.
2017-02-13Fix readelf writing to illegal addresses whilst processing corrupt input ↵Nick Clifton2-5/+32
files containing symbol-difference relocations. PR binutils/21137 * readelf.c (target_specific_reloc_handling): Add end parameter. Check for buffer overflow before writing relocated values. (apply_relocations): Pass end to target_specific_reloc_handling.
2017-01-27Update description of the -plugin option used by the linker, ar and nm.Dilyan Palauzov2-18/+66
PR 20343 ld * ld.texinfo (Options): Extend documentation of the --plugin option. Include a description of where the plugins should be located. binutils* doc/binutils.texi (ar): Extend documentation of the --plugin option. Include a description of where the plugins should be located. (nm): Likewise.
2017-01-23Fix typo in MAINTAINERS fileNick Clifton1-1/+1
2017-01-23Remove Mei Ligang as SCORE maintainerNick Clifton2-1/+3
2017-01-23Add Bernd Schmidt to Past Maintainers listNick Clifton2-0/+5
2017-01-23 * MAINTAINERS (BFIN): Remove myself as Blackfin maintainer.Bernd Schmidt2-1/+4
2017-01-20objdump: Better objdump section headers in wide modeAndrew Burgess2-8/+54
When displaying the section headers table using objdump (-h), the column containing the section header name is currently fixed at 13 characters. A section name that is longer than 13 characters will overflow the column causing the table to become miss-aligned. In this commit I change the behaviour so that _in wide mode_ (-w -h) the section name column is dynamically resized to fit the longest section name we plan to display. In wide mode the column still retains a minimum width of 13 characters. In non-wide more the behaviour is completely unchanged. While I was changing the dump_headers function I have unified the two printf lines that handled the different address widths into a single printf, the address width is now passed into printf using the '*' field width format character. binutils/ChangeLog: * objdump.c (dump_section_header): Extract max section name length from data parameter, use this when formatting output. (find_longest_section_name): New function. (dump_headers): Calculate longest section name when in wide mode, reformat to unify printing of header line. ld/ChangeLog: * testsuite/ld-elf/eh-frame-hdr.d: Update expected results.
2017-01-18Add support for processing lex source files with flex v 2.6.3Bernhard Rosenkranzer3-10/+8
PR 21059 binutils* arlex.l: Support processing with flex 2.6.3. * deflex.l: Likewise. gas * config/bfin-lex.l: Support processing with flex 2.6.3. * itbl-lex.l: Likewise.
2017-01-18Stop the (optional) dialong control data from being aligned when ↵Dmitry Timoshkov4-5/+34
parsing/writing windows resource files. binutils* resbin.c: Optional dialog control data immediately follow the control description without alignment. * testsuite/binutils-all/windres/controldata.rc: New test. source. * testsuite/binutils-all/windres/controldata.rsd: New test.
2017-01-12Add support for locating separate debug info files via the build-id method.Nick Clifton3-0/+92
PR binutils/20876 bfd * opncls.c (find_separate_debug_file): Add include_dirs parameter. Only include the directory part of the bfd's filename in search paths if include_dirs is true. Add a couple of extra locations for looking for debug files. ( bfd_follow_gnu_debuglink): Update invocation of find_separate_debug_file. (bfd_follow_gnu_debugaltlink): Likewise. (get_build_id): New function: Finds the build-id of the given bfd. (get_build_id_name): New function: Computes the name of the separate debug info file for a bfd, based upon its build-id. (check_build_id_file): New function: Checks to see if a separate debug info file exists at the given location, and that its build-id matches that of the original bfd. (bfd_follow_build_id_debuglink): New function: Finds a separate debug info file for a given bfd by using the build-id method. * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id method of locating a separate debug info file before using the debuglink method. * bfd-in2.h: Regenerate. binutils * NEWS: Mention the new feature. * testsuite/binutils-all/objdump.exp (test_build_id_debuglink): New proc to test the location of separate debug info files using the build-id method.
2017-01-10Fix compile time warning about pointer comparison.Nick Clifton2-1/+7
PR 21034 * stabs.c (parse_stab_members): Fix thinko checking for g++ version 1 stabs information.
2017-01-10Updated Swedish translations for GAS and LDNick Clifton1-1/+1
2017-01-09Speed up objdump when displaying disassembly mixed with line number and ↵Nick Clifton2-4/+26
source code information. bfd * dwarf2.c (lookup_address_in_function_table): Return early if there are no functions in the given comp unit, or if the high address of the last function in the comp unit is less than the desired address. binutils * objdump.c (display_file): Add new parameter 'last_file'. If last_file is true, do not call bfd_close at the end of the function. (main): Set the value of the last_file parameter when calling display_file.
2017-01-09.rela.dyn comment fix and add missing ChangeLog entryAlan Modra3-2/+10
ChangeLog entry missed from commit dd90581873. * readelf.c (process_section_headers): Correct .rel.dyn/.rela.dyn comment.
2017-01-06Retire Paul Brook as an ARM maintainer.Nick Clifton2-1/+5
* MAINTAINERS: Move Paul Brook to the Past Maintainers section.
2017-01-04Use noyywrap option in lex files.Dilan Palauzov2-5/+7
ld PR 20958 * ldlex.l (option): Add noyywrap (yywrap): Delete. * ldlex.h (yywrap): Delete prototype. binutils PR 20958 * syslex.l (option): Add noyywrap (yywrap): Delete.
2017-01-02Update year range in copyright notice of all files.Alan Modra133-133/+137
2017-01-02ChangeLog rotationAlan Modra2-973/+987
2016-12-31PRU Binutils portDimitar Dimitrov2-0/+25
* readelf.c (guess_is_rela): Add EM_TI_PRU. (dump_relocations): Invoke elf_pru_reloc_type. (get_machine_name): Handle EM_TI_PRU. (is_32bit_abs_reloc): Handle R_PRU_BFD_RELOC_32. (is_16bit_abs_reloc): Handle R_PRU_BFD_RELOC_16. (is_none_reloc): Handle PRU_NONE and PRU_DIFF variants. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2016-12-23MIPS16: Add ASMACRO instruction supportMaciej W. Rozycki2-8/+9
Add ASMACRO instruction support as per the MIPS16e ASE architecture specifications [1][2], completing MIPS16e instruction set support. [1] "MIPS32 Architecture for Programmers, Volume IV-a: The MIPS16e Application-Specific Extension to the MIPS32 Architecture", MIPS Technologies, Inc., Document Number: MD00076, Revision 2.63, July 16, 2013, Section 4.1 "MIPS16e Instruction Descriptions", p. 65 [2] "MIPS64 Architecture for Programmers, Volume IV-a: The MIPS16e Application-Specific Extension to the MIPS64 Architecture", MIPS Technologies, Inc., Document Number: MD00077, Revision 2.60, June 25, 2008, Section 1.1 "MIPS16e Instruction Descriptions", p. 66 include/ * opcode/mips.h: Document `0', `1', `2', `3', `4' and `s' operand codes. opcodes/ * mips16-opc.c (decode_mips16_operand): Add `0', `1', `2', `3', `4' and `s' operand codes. (mips16_opcodes): Add "asmacro" entry. binutils/ * testsuite/binutils-all/mips/mips16-extend-insn.d: Update for ASMACRO support. gas/ * testsuite/gas/mips/mips16-asmacro.d: New test. * testsuite/gas/mips/mips16-32@mips16-asmacro.d: New test. * testsuite/gas/mips/mips16-64@mips16-asmacro.d: New test. * testsuite/gas/mips/mips16-asmacro.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests.
2016-12-23MIPS16: Handle non-extensible instructions correctlyMaciej W. Rozycki4-0/+973
Identify non-extensible instructions in the MIPS16 opcode table and disallow their use with the `.e' instruction size suffix in assembly and do not interpret any EXTEND prefix present as a part of the instruction in disassembly. According to all versions of the MIPS16 ASE specifications the following instructions encodings are not extensible [1][2][3][4][5][6]: I8/MOV32R, I8/MOVR32, all RRR minor opcodes, all RR minor opcodes except from DSRA and DSRL, and EXTEND itself, and as from revision 2.50 of the MIPS16e ASE specifications it has been further clarified what was previously implied, that non-extesiable instructions when preceded with an EXTEND prefix must cause a Reserved Instruction exception [3][5]. Therefore in the presence of an EXTEND prefix none of these instructions are supposed to be handled as extended instructions and supporting these forms in disassembly causes confusion, and in the case of the RRR major opcode it also clashes with the ASMACRO encoding. References: [1] "Product Description, MIPS16 Application-Specific Extension", Version 1.3, MIPS Technologies, Inc., 970130, Table 3. "MIPS16 Instruction Set Summary", p. 5 [2] same, Table 5 "RR Minor Opcodes (RR-type instructions)", p.10 [3] "MIPS32 Architecture for Programmers, Volume IV-a: The MIPS16e Application-Specific Extension to the MIPS32 Architecture", MIPS Technologies, Inc., Document Number: MD00076, Revision 2.63, July 16, 2013, Section 3.9 "MIPS16e Instruction Summaries", pp. 37-39 [4] same, Section 3.15 "Instruction Bit Encoding", pp. 46-49 [5] "MIPS64 Architecture for Programmers, Volume IV-a: The MIPS16e Application-Specific Extension to the MIPS64 Architecture", MIPS Technologies, Inc., Document Number: MD00077, Revision 2.60, June 25, 2008, Section 1.9 "MIPS16e Instruction Summaries", pp. 38-41 [6] same, Section 1.15 "Instruction Bit Encoding", pp. 48-51 include/ * opcode/mips.h (INSN2_SHORT_ONLY): New macro. gas/ * config/tc-mips.c (is_size_valid_16): Disallow a `.e' suffix instruction size override for INSN2_SHORT_ONLY opcode table entries. * testsuite/gas/mips/mips16-extend-swap.d: Adjust output. * testsuite/gas/mips/mips16-macro-e.l: Adjust error messages. * testsuite/gas/mips/mips16-32@mips16-macro-e.l: Adjust error messages. * testsuite/gas/mips/mips16e-32@mips16-macro-e.l: Adjust error messages. * testsuite/gas/mips/mips16-insn-e.d: New test. * testsuite/gas/mips/mips16-insn-t.d: New test. * testsuite/gas/mips/mips16-32@mips16-insn-e.d: New test. * testsuite/gas/mips/mips16-64@mips16-insn-e.d: New test. * testsuite/gas/mips/mips16e-32@mips16-insn-e.d: New test. * testsuite/gas/mips/mips16-32@mips16-insn-t.d: New test. * testsuite/gas/mips/mips16-64@mips16-insn-t.d: New test. * testsuite/gas/mips/mips16e-32@mips16-insn-t.d: New test. * testsuite/gas/mips/mips16-insn-e.l: New stderr output. * testsuite/gas/mips/mips16-insn-t.l: New stderr output. * testsuite/gas/mips/mips16-32@mips16-insn-e.l: New stderr output. * testsuite/gas/mips/mips16-64@mips16-insn-e.l: New stderr output. * testsuite/gas/mips/mips16e-32@mips16-insn-e.l: New stderr output. * testsuite/gas/mips/mips16-32@mips16-insn-t.l: New stderr output. * testsuite/gas/mips/mips16-64@mips16-insn-t.l: New stderr output. * testsuite/gas/mips/mips16e-32@mips16-insn-t.l: New stderr output. * testsuite/gas/mips/mips16-insn-e.s: New test source. * testsuite/gas/mips/mips16-insn-t.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests. opcodes/ * mips-dis.c (print_insn_mips16): Disallow EXTEND prefix matching for INSN2_SHORT_ONLY opcode table entries. * mips16-opc.c (SH): New macro. (mips16_opcodes): Set SH in `pinfo2' for non-extensible instruction entries: "nop", "addu", "and", "break", "cmp", "daddu", "ddiv", "ddivu", "div", "divu", "dmult", "dmultu", "drem", "dremu", "dsllv", "dsll", "dsrav", "dsra", "dsrlv", "dsrl", "dsubu", "exit", "entry", "jalr", "jal", "jr", "j", "jalrc", "jrc", "mfhi", "mflo", "move", "mult", "multu", "neg", "not", "or", "rem", "remu", "sllv", "sll", "slt", "sltu", "srav", "sra", "srlv", "srl", "subu", "xor", "sdbbp", "seb", "seh", "sew", "zeb", "zeh", "zew" and "extend". binutils/ * testsuite/binutils-all/mips/mips16-extend-insn.d: New test. * testsuite/binutils-all/mips/mips16-extend-insn.s: New test source. * testsuite/binutils-all/mips/mips.exp: Run the new tests.
2016-12-23Bump version to 2.28.51Tristan Gingold2-10/+14
bfd/ 2016-12-23 Tristan Gingold <gingold@adacore.com> * version.m4: Bump version to 2.28.51 * configure: Regenerate. binutils/ 2016-12-23 Tristan Gingold <gingold@adacore.com> * configure: Regenerate. gas/ 2016-12-23 Tristan Gingold <gingold@adacore.com> * configure: Regenerate. gprof/ 2016-12-23 Tristan Gingold <gingold@adacore.com> * configure: Regenerate. ld/ 2016-12-23 Tristan Gingold <gingold@adacore.com> * configure: Regenerate. opcodes/ 2016-12-23 Tristan Gingold <gingold@adacore.com> * configure: Regenerate.
2016-12-23Add marker in NEWS filesTristan Gingold3-0/+7
binutils/ 2016-12-23 Tristan Gingold <gingold@adacore.com> * NEWS: Add marker for 2.28. gas/ 2016-12-23 Tristan Gingold <gingold@adacore.com> * NEWS: Add marker for 2.28. ld/ 2016-12-23 Tristan Gingold <gingold@adacore.com> * NEWS: Add marker for 2.28.
2016-12-23Regenerate pot files.Tristan Gingold2-1611/+3150
2016-12-20MIPS16/opcodes: Respect ISA and ASE in disassemblyMaciej W. Rozycki2-1/+6
Limit MIPS16 instruction disassembly according to the ISA level and ASE set selected, as with the regular MIPS and microMIPS instruction sets. Retain the property of `objdump -m mips:16' disassembling all MIPS16 instructions however, regardless of any ISA level recorded in the binary examined. To validate the disassembler use the GAS test suite for its convenience of running tests across multiple ISAs, even though placing the tests in the binutils test suite would be more appropriate. Adjust the single binutils test which depends on 64-bit instruction disassembly to have the ISA level required actually recorded in the binary examined. opcodes/ * mips-dis.c (mips_arch_choices): Use ISA_MIPS64 rather than ISA_MIPS3 as the `isa' selection in the `bfd_mach_mips16' entry. (print_insn_mips16): Check opcode entries for validity against the ISA level and ASE set selected. binutils/ * testsuite/binutils-all/mips/mips16-undecoded.s: Use `.module' rather than `.set' to set the ISA level. gas/ * testsuite/gas/mips/mips16-sub.d: New test. * testsuite/gas/mips/mips16-32@mips16-sub.d: New test. * testsuite/gas/mips/mips16e-32@mips16-sub.d: New test. * testsuite/gas/mips/mips16e-sub.d: New test. * testsuite/gas/mips/mips16-32@mips16e-sub.d: New test. * testsuite/gas/mips/mips16-64@mips16e-sub.d: New test. * testsuite/gas/mips/mips16e-64-sub.d: New test. * testsuite/gas/mips/mips16-32@mips16e-64-sub.d: New test. * testsuite/gas/mips/mips16-64@mips16e-64-sub.d: New test. * testsuite/gas/mips/mips16e-32@mips16e-64-sub.d: New test. * testsuite/gas/mips/mips16-sub.s: New test source. * testsuite/gas/mips/mips16e-sub.s: New test source. * testsuite/gas/mips/mips16e-64-sub.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests.
2016-12-20MIPS16: Switch to 32-bit opcode table interpretationMaciej W. Rozycki2-6/+17
Switch to 32-bit MIPS16 opcode table entry interpretation, similar to how the microMIPS opcode table is handled, for both the `match' and `mask' fields, removing special casing for JAL and JALX instructions and their `a' and `i' operand codes throughout, while retaining automatic processing of extendable opcodes in assembly and disassembly. In assembly disallow size enforcement suffixes as appropriate: `.t' for both 32-bit instructions and macros and `.e' for macros only, making macro handling consistent with the microMIPS instruction set. In disassembly fully decode EXTEND prefixes prepended to unsupported instruction encodings (according to the ISA selection) rather than dumping them as hexadecimal data along with the following instruction, removing all special casing for the EXTEND prefix and making its handling rely on its opcode table entry, except where it is considered a part of an extendable instruction. include/ * opcode/mips.h (mips_opcode_32bit_p): New inline function. gas/ * config/tc-mips.c (micromips_insn_length): Use `mips_opcode_32bit_p'. (is_size_valid): Adjust description. (is_size_valid_16): New function. (validate_mips_insn): Use `mips_opcode_32bit_p' in MIPS16 operand decoding. (validate_mips16_insn): Remove `a' and `i' operand code special casing, use `mips_opcode_32bit_p' to determine instruction width. (append_insn): Adjust forced MIPS16 instruction size determination. (match_mips16_insn): Likewise. Don't shift the instruction's opcode with the `a' and `i' operand codes. Use `mips_opcode_32bit_p' in operand decoding. (match_mips16_insns): Check for forced instruction size's validity. (mips16_ip): Don't force instruction size in the `noautoextend' mode. * testsuite/gas/mips/mips16-jal-e.d: New test. * testsuite/gas/mips/mips16-jal-t.d: New test. * testsuite/gas/mips/mips16-macro-e.d: New test. * testsuite/gas/mips/mips16-macro-t.d: New test. * testsuite/gas/mips/mips16-jal-t.l: New stderr output. * testsuite/gas/mips/mips16-macro-e.l: New stderr output. * testsuite/gas/mips/mips16-macro-t.l: New stderr output. * testsuite/gas/mips/mips16-jal-e.s: New test source. * testsuite/gas/mips/mips16-jal-t.s: New test source. * testsuite/gas/mips/mips16-macro-e.s: New test source. * testsuite/gas/mips/mips16-macro-t.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests. opcodes/ * mips-dis.c (print_mips16_insn_arg): Always handle `extend' and `insn' together, with `extend' as the high-order 16 bits. (match_kind): New enum. (print_insn_mips16): Rework for 32-bit instruction matching. Do not dump EXTEND prefixes here. * mips16-opc.c (mips16_opcodes): Move "extend" entry to the end. Recode `match' and `mask' fields as 32-bit in absolute "jal" and "jalx" entries. binutils/ * testsuite/binutils-all/mips/mips16-extend-noinsn.d: Adjust test for separate EXTEND prefix disassembly.
2016-12-20Re-work RISC-V gas flags: now we just support -mabi and -marchAndrew Waterman2-2/+25
We've decided to standardize on two flags for RISC-V: "-march" sets the target architecture (which determines which instructions can be generated), and "-mabi" sets the target ABI. We needed to rework this because the old flag set didn't support soft-float or single-float ABIs, and didn't support an x32-style ABI on RISC-V. Additionally, we've changed the behavior of the -march flag: it's now a lot stricter and only parses things we can actually understand. Additionally, it's now lowercase-only: the rationale is that while the RISC-V ISA manual specifies that ISA strings are case-insensitive, in Linux-land things are usually case-sensitive. Since this flag can be used to determine library paths, we didn't want to bake some case-insensitivity in there that would case trouble later. This patch implements these two new flags and removes the old flags that could conflict with these. There wasn't a RISC-V release before, so we want to just support a clean flag set. include/ * elf/riscv.h (EF_RISCV_SOFT_FLOAT): Don't define. (EF_RISCV_FLOAT_ABI, EF_RISCV_FLOAT_ABI_SOFT): Define. (EF_RISCV_FLOAT_ABI_SINGLE, EF_RISCV_FLOAT_ABI_DOUBLE): Define. (EF_RISCV_FLOAT_ABI_QUAD): Define. bfd/ * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Use EF_RISCV_FLOAT_ABI_SOFT instead of EF_RISCV_SOFT_FLOAT. binutils/ * readelf.c (get_machine_flags): Use EF_RISCV_FLOAT_ABI_{SOFT,SINGLE,DOBULE,QUAD) instead of EF_RISCV_{SOFT,HARD}_FLOAT. gas/ * config/tc-riscv.h (xlen): Delete. * config/tc-riscv.c (xlen): Make static. (abi_xlen): New variable. (options): Replace OPTION_{M32,M64,MSOFT_FLOAT,MHARD_FLOAT,MRVC} with OPTION_MABI. (md_longopts): Likewise. (md_parse_option): Likewise. (riscv_elf_final_processing): Likewise. * doc/as.texinfo (Target RISC-V options): Likewise. * doc/c-riscv.texi (OPTIONS): Likewise. * config/tc-riscv.c (float_mode): Removed. (float_abi): New type, specifies the floating-point ABI. (riscv_set_abi): New function. (riscv_add_subset): Only allow lower-case ISA names and require them to start with "rv". (riscv_after_parse_args): Likewise. opcodes/ * riscv-dis.c (riscv_disassemble_insn): Default to the ELF's XLEN when none is provided.
2016-12-14MIPS/opcodes: Also set disassembler's ASE flags from ELF structuresMaciej W. Rozycki7-0/+112
Respect any ASE flags recorded in ELF file structures for the purpose of selecting instructions to be disassembled, preventing code from being hex-dumped even though having been clearly indicated as valid at the assembly time. Use date from the MIPS ABI flags structure if present, and otherwise there may be an MDMX ASE flag set in the ELF file header. For backwards compatibility only set extra flags and do not clear any, preserving all previously set by the architecture selected to be disassembled for. include/ * elf/mips.h (Elf_Internal_ABIFlags_v0): Also declare struct typedef as `elf_internal_abiflags_v0'. bfd/ * bfd-in.h (elf_internal_abiflags_v0): New struct declaration. (bfd_mips_elf_get_abiflags): New prototype. * elfxx-mips.c (bfd_mips_elf_get_abiflags): New function. * bfd-in2.h: Regenerate. opcodes/ * mips-dis.c (mips_convert_abiflags_ases): New function. (set_default_mips_dis_options): Also infer ASE flags from ELF file structures. binutils/ * testsuite/binutils-all/mips/mips-ase-1.d: New test. * testsuite/binutils-all/mips/mips-ase-2.d: New test. * testsuite/binutils-all/mips/mips-ase-3.d: New test. * testsuite/binutils-all/mips/mips-ase-1.s: New test source. * testsuite/binutils-all/mips/mips-ase-2.s: New test source. * testsuite/binutils-all/mips/mips.exp: Run the new tests.
2016-12-13[AArch64] Recognize R_AARCH64_P32_ABS32 as 32-bit relocation in readelfJiong Wang2-1/+6
binutils/ * readelf.c (is_32bit_abs_reloc): Recognize R_AARCH64_P32_ABS32.
2016-12-13Add a 'Past Maintainers' section to the MAINTAINERS file. Retire Mark ↵Nick Clifton2-2/+13
Mitchell's name to this section. * MAINTAINERS (Past Maintainers): New section. Move Mark Mitchell's name here.
2016-12-09MIPS16/opcodes: Reformat raw EXTEND and undecoded outputMaciej W. Rozycki4-0/+66
Use a tab rather than a space to separate `extend' and its uninterpreted argument output, like with regular instructions. Separate hexadecimal halves of undecoded extended instructions output with a space instead of presenting them concatenated. opcodes/ * mips-dis.c (print_insn_mips16): Use a tab rather than a space to separate `extend' and its uninterpreted argument output. Separate hexadecimal halves of undecoded extended instructions output. binutils/ * testsuite/binutils-all/mips/mips16-extend-noinsn.d: New test. * testsuite/binutils-all/mips/mips16-extend-noinsn.s: New test source. * testsuite/binutils-all/mips/mips.exp: Run the new test.
2016-12-08MIPS16/opcodes: Fix PC-relative operation delay-slot adjustmentMaciej W. Rozycki4-0/+426
Complement commit dd8b7c222e0e ("MIPS: mips16e jalrc/jrc opcodes"), <https://sourceware.org/ml/binutils/2005-07/msg00349.html>, and stop the disassembler making a delay-slot adjustment for PC-relative operations following either MIPS16e compact jumps, or undefined RR/J(AL)R(C) encodings that have the `l' (link) and `ra' (source register is `ra') bits set both at a time. Adjust code description for accuracy. Add a suitable test case. opcodes/ * mips-dis.c (print_mips16_insn_arg): Avoid delay-slot adjustment for PC-relative operations following MIPS16e compact jumps or undefined RR/J(AL)R(C) encodings. binutils/ * testsuite/binutils-all/mips/mips16-pcrel.d: New test. * testsuite/binutils-all/mips/mips16-pcrel.s: New test source. * testsuite/binutils-all/mips/mips.exp: Run the new test.
2016-12-08Always use a hex prefix when displaying the alignment of program headers.Etienne Buira2-1/+6
* readelf.c (process_program_headers): Always use hex prefix when displaying the segment alignment.
2016-12-06Fix seg-fault running strip on a corrupt binary.Nick Clifton2-1/+9
PR binutils/20930 * objcopy.c (mark_symbols_used_in_relocations): Check for a null symbol pointer pointer before attempting to mark the symbol as kept.
2016-12-05binutils: add myself to MAINTAINERSJose E. Marchesi2-0/+5
2016-12-05 Jose E. Marchesi <jose.marchesi@oracle.com> * MAINTAINERS: Add myself as maintainer for the SPARC targets.
2016-12-05Fix seg-fault running strip on a corrupt binary.Nick Clifton2-1/+9
PR ld/20923 * objcopy.c (mark_symbols_used_in_relocations): Check for a null symbol pointer before attempting to mark the symbol as kept.
2016-12-01Fix calculation of synthetic symbol sizes (ppc64)Luis Machado2-2/+10
The attached patch fixes a problem where nm displays bogus information for synthetic symbol sizes when --size-sort is used. This happens because the synthetic symbols (dot symbols for ppc64) are generated based on their non-dot symbols. The generation process doesn't copy over the ELF-specific bits of the regular non-dot symbols. When --size-sort is used, the code attempts to access the symbol size from the ELF-specific bits and ends up reading gargabe, causing the size to be displayed incorrectly. With the patch, i can see dot and non-dot symbols having the same size with --size-sort. This doesn't fix the fact that we don't display size information for synthetic symbols without --size-sort, which i may address in the future. binutils/ChangeLog: 2016-12-01 Luis Machado <lgustavo@codesourcery.com> * nm.c (sort_symbols_by_size): Don't read symbol size if symbol is synthetic.
2016-11-30Stop readelf from complaining about out of order PT_LOAD segments.Nick Clifton2-0/+10
PR ld/20815 * readelf.c (process_program_headers): Do not warn about out of order PT_LOAD segments.