aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-07-07Recognize the recently-added FreeBSD core dump note for LWP info.John Baldwin
This core dump note contains the same information returned by the ptrace PT_LWPINFO operation for each LWP belonging to a process. binutils/ChangeLog: * readelf.c (get_freebsd_elfcore_note_type): Handle NT_FREEBSD_PTLWPINFO. include/ChangeLog: * elf/common.h (NT_FREEBSD_PTLWPINFO): Define.
2017-07-07Use the thread_section_name helper class in fbsd_core_thread_name.John Baldwin
gdb/ChangeLog: * fbsd-tdep.c (fbsd_core_thread_name): Use thread_section_name.
2017-07-07Add a new gdbarch method to fetch signal information from core files.John Baldwin
Previously the core_xfer_partial method used core_get_siginfo to handle TARGET_OBJECT_SIGNAL_INFO requests. However, core_get_siginfo looked for Linux-specific sections in the core file. To support fetching siginfo from cores on other systems, add a new gdbarch method (`core_xfer_siginfo`) and move the body of the existing core_get_siginfo into a linux_core_xfer_siginfo implementation of this method in linux-tdep.c. gdb/ChangeLog: * corelow.c (get_core_siginfo): Remove. (core_xfer_partial): Use the gdbarch "core_xfer_siginfo" method instead of get_core_siginfo. * gdbarch.sh (core_xfer_siginfo): New gdbarch callback. * gdbarch.h: Re-generate. * gdbarch.c: Re-generate. * linux-tdep.c (linux_core_xfer_siginfo): New. (linux_init_abi): Install gdbarch "core_xfer_siginfo" method.
2017-07-07Move the thread_section_name class to gdbcore.h.John Baldwin
This allows it to be used outside of corelow.c.
2017-07-07Fetch signal information for native FreeBSD processes.John Baldwin
Use the `pl_siginfo' field in the `struct ptrace_lwpinfo' object returned by the PT_LWPINFO ptrace() request to supply the current contents of $_siginfo for each thread. Note that FreeBSD does not supply a way to modify the signal information for a thread, so $_siginfo is read-only for FreeBSD. To handle 32-bit processes on a 64-bit host, define types for 32-bit compatible siginfo_t and convert the 64-bit siginfo_t to the 32-bit equivalent when supplying information for a 32-bit process. gdb/ChangeLog: * fbsd-nat.c [PT_LWPINFO && __LP64__] (union sigval32) (struct siginfo32): New. [PT_LWPINFO] (fbsd_siginfo_size, fbsd_convert_siginfo): New. (fbsd_xfer_partial) [PT_LWPINFO]: Handle TARGET_OBJECT_SIGNAL_INFO via ptrace(PT_LWPINFO).
2017-07-07Implement the "get_siginfo_type" gdbarch method for FreeBSD architectures.John Baldwin
As with Linux architectures, cache the created type in the gdbarch when it is first created. Currently FreeBSD uses an identical siginfo type on all architectures, so there is no support for architecture-specific fields. gdb/ChangeLog: * fbsd-tdep.c (fbsd_gdbarch_data_handle, struct fbsd_gdbarch_data) (init_fbsd_gdbarch_data, get_fbsd_gdbarch_data) (fbsd_get_siginfo_type): New. (fbsd_init_abi): Install gdbarch "get_siginfo_type" method. (_initialize_fbsd_tdep): New.
2017-07-07MIPS/LD: Fix a segfault from ELF `e_flags' access with non-ELF output BFDMaciej W. Rozycki
Fix a commit 861fb55ab50a ("Defer allocation of R_MIPS_REL32 GOT slots"), <https://sourceware.org/ml/binutils/2008-08/msg00096.html>, regression and a more recent: FAIL: ld-unique/pr21529 new LD test case failure, observed with all the relevant MIPS targets whenever the linker is invoked with one or more ELF inputs and the output format set to `binary'. The culprit is a segmentation fault caused in `mips_before_allocation' by a null pointer dereference, where an attempt is made to access the ELF file header's `e_flags' member, for the purpose of determining whether to produce a PLT and copy relocations, without first checking that the output BFD is ELF. The `e_flags' member is stored in BFD's private data pointed to by `tdep', which in the case of the `binary' BFD is null, causing the segmentation fault. With other non-ELF BFDs such as SREC `tdep' is not null and consequently no crash may happen and in that case random data will be interpreted as it was `e_flags'. Disable the access to `e_flags' then and all the associated checks and consequently never produce a PLT and copy relocations if output is not a MIPS ELF BFD, matching `_bfd_mips_elf_merge_private_bfd_data' that does not process `e_flags' in that case either and therefore does not let us decide here anyway if all the input objects included in the link are suitable for use with a PLT and copy relocations. ld/ * emultempl/mipself.em (mips_before_allocation): Avoid ELF processing if not MIPS ELF. * testsuite/ld-mips-elf/binary.d: New test. * testsuite/ld-mips-elf/binary.ld: New test linker script. * testsuite/ld-mips-elf/binary.s: New test source. * testsuite/ld-mips-elf/mips-elf.exp: Run the new test.
2017-07-07Make ppc476 testcases more robustAlan Modra
* testsuite/ld-powerpc/ppc476-shared.lnk: Align .bss. * testsuite/ld-powerpc/ppc476-shared.d: Adjust. * testsuite/ld-powerpc/ppc476-shared2.d: Adjust.
2017-07-07Move print_insn_XXX to an opcodes internal header, againAlan Modra
88c1242dc0a changed some generated files rather than the source. * cgen-dis.in: Include disassemble.h, not dis-asm.h. * m32c-dis.c: Regenerate. * mep-dis.c: Regenerate.
2017-07-07Add some missing xcoff supportAlan Modra
* coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2017-07-07Apply ld/Makefile.in patch to the correct fileAlan Modra
Makefile.in is generated. * Makefile.am (eelf64_s390.c): Depend on emultempl/s390.em.
2017-07-07Another _doprnt fix for %L handlingAlan Modra
* bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma as long long. Move code replacing "ll" with "I64", and simplify.
2017-07-07Automatic date update in version.inGDB Administrator
2017-07-06Fission support for multiple CUs per DWO fileDavid Blaikie
In some cases a compiler may produce a single object file (& thus single DWO file) representing multiple source files. The most common example of this is in whole program optimization (such as LLVM's LTO). Fission may still be a beneficial feature to use here - to avoid the need to read/link the debug info with system libraries and the like. This change adds basic support for multiple CUs in a single DWO file to support LLVM's output in this situation. There is still outstanding work to design and implement a solution for cross-CU references (usually using DW_FORM_ref_addr) in this scenario. For now LLVM works around this by duplicating DIEs rather than making cross-CU references in DWO files. This degrades debugger behavior/quality especially for file-local entities. 2017-07-06 David Blaikie <dblaikie@gmail.com> * dwarf2read.c (struct dwo_file): Use a htab of dwo_unit* (rather than a singular dwo_unit*) to support multiple CUs in the same way that multiple TUs are supported. (create_cus_hash_table): Replace create_dwo_cu with a function for parsing multiple CUs from a DWO file. (open_and_init_dwo_file): Use create_cus_hash_table rather than create_dwo_cu. (lookup_dwo_cutu): Lookup CU in the hash table in the dwo_file with htab_find, rather than comparing the signature to a singleton CU in the dwo_file. 2017-07-06 David Blaikie <dblaikie@gmail.com> * gdb.dwarf2/fission-multi-cu.S: Test containing multiple CUs in a DWO, built from fissiont-multi-cu{1,2}.c. * gdb.dwarf2/fission-multi-cu.exp: Test similar to fission-base.exp, except putting 'main' and 'func' in separate CUs in the same DWO file. * gdb.dwarf2/fission-multi-cu1.c: First CU for the multi-CU-single-DWO test. * gdb.dwarf2/fission-multi-cu2.c: Second CU in the multi-CU-single-DWO test.
2017-07-06Convert 'L' to 'l' when setting wide_width to 1H.J. Lu
When setting wide_width to 1, convert 'L' to 'l'. Otherwise, %Lx/%Lu/%Ld will be passed to fprintf which will treat the argument as long long. * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width to 1.
2017-07-06Automatic date update in version.inGDB Administrator
2017-07-06Fix Python unwinder frames regressionPedro Alves
The gdb.python/py-unwind.exp test is crashing GDB / leaving core dumps in the test dir, even though it all passes cleanly. The crash is not visible in gdb.sum/gdb.log because it happens as side effect of the "quit" command, while flushing the frame cache. The problem is simply a typo in a 'for' loop's condition, introduced by a recent change [4fa847d78edd ("Remove MAX_REGISTER_SIZE from py-unwind.c")], resulting in infinite loop / double-free. The new test exposes the crash, like: Running src/gdb/testsuite/gdb.python/py-unwind.exp ... ERROR: Process no longer exists gdb/ChangeLog: 2017-07-06 Pedro Alves <palves@redhat.com> * python/py-unwind.c (pyuw_dealloc_cache): Fix for loop condition. gdb/testsuite/ChangeLog: 2017-07-06 Pedro Alves <palves@redhat.com> * gdb.python/py-unwind.exp: Test flushregs.
2017-07-05Fix build with GCC 4.2H.J. Lu
Fix GCC 4.2 warnings like: cc1: warnings being treated as errors binutils-gdb/bfd/dwarf2.c:1844: warning: declaration of ‘time’ shadows a global declaration /usr/include/time.h:187: warning: shadowed declaration is here binutils-gdb/bfd/dwarf2.c: In function ‘line_info_add_file_name’: binutils-gdb/bfd/dwarf2.c:1854: warning: declaration of ‘time’ shadows a global declaration /usr/include/time.h:187: warning: shadowed declaration is here bfd/ * dwarf2.c (line_info_add_include_dir_stub): Replace time with xtime. (line_info_add_file_name): Likewise. (decode_line_info): Likewise. binutils/ * dwarf.c (display_debug_names): Replace index with xindex.
2017-07-05[ARM] Add support for Cortex-A55 and Cortex-A75.James Greenhalgh
This patch adds support for the ARM Cortex-A55 and Cortex-A75 processors. The ARM Cortex-A55 and Cortex-A75 procsessors implement the ARMv8-A architecture, with support for the ARMv8.1-A and ARMv8.2-A extensions, including support for the 16-bit floating point extensions. The 16-bit floating-point extensions are optional, and we haven't defined an option mapping straight to them thus far, so this patch first needs to add one of those in include/opcode/arm.h, then we can simply add the CPU names as usual in config/tc-arm.c . Tested on arm-none-eabi. 2017-07-05 James Greenhalgh <james.greenhalgh@arm.com> * config/tc-arm.c (arm_cpus): Add Cortex-A55 and Cortex-A75. * doc/c-arm.texi (-mcpu): Document Cortex-A55 and Cortex-A75.
2017-07-05X86: Disassemble primary opcode map's group 2 ModRM.reg == 6 aliases correctlyBorislav Petkov
The instructions are not documented in the Intel SDM but are documented in the AMD APM as an alias to the group 2, ModRM.reg == 4 variant. Both AMD and Intel CPUs execute the C[0-1] and D[0-3] instructions as expected, i.e., like the /4 aliases: #include <stdio.h> int main(void) { int a = 2; printf ("a before: %d\n", a); asm volatile(".byte 0xd0,0xf0" /* SHL %al */ : "+a" (a)); printf("a after : %d\n", a); return 0; } $ ./a.out a before: 2 a after : 4
2017-07-05Fixup changelog entries for previous commitRamana Radhakrishnan
40c7d50720e04c3d1ef1695a8097f735bafbe54f
2017-07-05Automatic date update in version.inGDB Administrator
2017-07-04Garbage collect TYPE_STATIC and several TYPE_FN_FIELD_xPedro Alves
Nothing uses these. Most of the TYPE_FN_FIELD_ ones were probably used by the gcj support. gdb/ChangeLog: 2017-07-04 Pedro Alves <palves@redhat.com> * gdbtypes.c (recursive_dump_type): Don't reference TYPE_STATIC. * gdbtypes.h (TYPE_STATIC): Delete. (struct fn_field) <is_public, is_abstract, is_static, is_final, is_synchronized, is_native>: Delete. <dummy>: Bump. (TYPE_FN_FIELD_PUBLIC, TYPE_FN_FIELD_STATIC, TYPE_FN_FIELD_FINAL) (TYPE_FN_FIELD_SYNCHRONIZED, TYPE_FN_FIELD_NATIVE) (TYPE_FN_FIELD_ABSTRACT): Delete.
2017-07-04[Patch ARM] Support MVFR2 VFP Coprocessor register for ARMv8-ARamana Radhakrishnan
This patch adds support mvfr2 control registers for armv8-a as this was missed from the original port to armv8-a (documented at G6.2.109 in (Issue B.a) of the ARM-ARM. This was discovered by an internal user of the GNU toolchain. I'd like to backport this to the binutils 2.28 and binutils 2.29 release branch if possible (with suitable testing and basically checking removing the armv8-r parts). Tristan - are you ok with the backports ? Applied to trunk. regards Ramana 2017-07-04 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> * gas/config/tc-arm.c (arm_regs): Add MVFR2. (do_vmrs): Constraint for MVFR2 and armv8. (do_vmsr): Likewise. * gas/testsuite/gas/arm/armv8-a+fp.d: Update. * gas/testsuite/gas/arm/armv8-ar+fp.s: Likewise. * gas/testsuite/gas/arm/armv8-r+fp.d: Likewise. * gas/testsuite/gas/arm/vfp-bad.s: Likewise. * gas/testsuite/gas/arm/vfp-bad.l: Likewise. * opcodes/arm-dis.c: Support MVFR2 in disassembly with vmrs and vmsr.
2017-07-04Regenerate configure.Tristan Gingold
bfd/ 2017-07-04 Tristan Gingold <gingold@adacore.com> * version.m4: Bump version to 2.29.51 * configure: Regenerate. binutils/ 2017-07-04 Tristan Gingold <gingold@adacore.com> * configure: Regenerate. gas/ 2017-07-04 Tristan Gingold <gingold@adacore.com> * configure: Regenerate. gprof/ 2017-07-04 Tristan Gingold <gingold@adacore.com> * configure: Regenerate. ld/ 2017-07-04 Tristan Gingold <gingold@adacore.com> * configure: Regenerate. opcodes/ 2017-07-04 Tristan Gingold <gingold@adacore.com> * configure: Regenerate.
2017-07-04Add markers.Tristan Gingold
binutils/ 2017-07-04 Tristan Gingold <gingold@adacore.com> * NEWS: Add marker for 2.29. gas/ 2017-07-04 Tristan Gingold <gingold@adacore.com> * NEWS: Add marker for 2.29. ld/ 2017-07-04 Tristan Gingold <gingold@adacore.com> * NEWS: Add marker for 2.29.
2017-07-04[AArch64] Remove useless and incorrect assertionJiong Wang
The outer caller elf_link_output_extsym in elflink.c is a traverse function on all external symbol, and it will only call *finish_dynamic_symbol if some conditions is meet. It is executed conditionally. If the condition to trigger that assertion is satisified, it then won't satify the outer check in finish_dynamic_symbol, so *finish_dynamic_symbol won't be called that the assertion is expected to be dead code. If elf_link_output_extsym is a traverse function that unconditionally called on external symbols decided to be exported, then an assertion to make sure these symbols are in sane status might make sense. bfd/ * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the sanity check at the head of this function.
2017-07-04[binutils patch] DWARF-5: Extend bfd/dwarf2.c parse_comp_unit()Jan Kratochvil
bfd/ 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com> * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and dwarf_line_str_size. (struct attr_abbrev): Add field implicit_const. (dwarf_debug_sections): Add .debug_line_str. (enum dwarf_debug_section_enum): Add debug_line_str and debug_max. (dwarf_debug_section_assert): Add static assertion. (read_indirect_line_string): New. (read_abbrevs): Support DW_FORM_implicit_const. (is_str_attr): Support DW_FORM_line_strp. (read_attribute_value): Support DW_FORM_line_strp and DW_FORM_implicit_const. (read_attribute): Support DW_FORM_implicit_const. (line_info_add_include_dir, line_info_add_include_dir_stub): (line_info_add_file_name, read_formatted_entries): New. (decode_line_info, parse_comp_unit): Support DWARF 5. (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2017-07-04Automatic date update in version.inGDB Administrator
2017-07-03bfd: partial revert commit EC1ACAB (prevent all but undef weak symbols to ↵Egeyar Bagcioglu
become dynamic in sparc). bfd/ChangeLog: 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com> * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the abort statement that was put for symbols that are not dynamic.
2017-07-03Regenerate pot files.Tristan Gingold
2017-07-03strings: remove section/file size checkAlan Modra
This reverts most of 06803313754, 2005-07-05 Dmitry V. Levin change adding a check that section size doesn't exceed file size. As we've seen recently with mmo tests, decoded section size can easily exceed file size with formats that encode section data. I've also changed "strings" to use bfd_malloc_and_get_section, so that "strings" won't die on a malloc failure. I think it's better to continue on looking at other sections after failing to dump a section with fuzzed size. The testcases at https://bugzilla.altlinux.org/show_bug.cgi?id=5871 on a 32-bit host now produce $ strings -d --target=a.out-i386 /tmp/bfdkiller.dat strings: error: /tmp/bfdkiller.dat(.text) is too large (0xffffffff bytes) strings: /tmp/bfdkiller.dat: Reading section .text failed: Memory exhausted strings: /tmp/bfdkiller.dat: Reading section .data failed: File truncated org.ec $ strings -d --target=a.out-i386 /tmp/eclipse-state strings: /tmp/eclipse-state: Reading section .text failed: File truncated org.eclipse.osgi System Bundle [snip] * strings.c (filename_and_size_t): Delete. (strings_a_section): Don't check section size against file size. Use bdf_malloc_and_get_section. Report an error on failures. Replace arg param with filename and got_a_section param. (got_a_section): Move to.. (strings_object_file): ..an auto var here. Iterate over sections rather than calling bfd_map_over_sections. Adjust strings_a_section call.
2017-07-03Support %Lx, %Lu, %Ld in _bfd_error_handler formatAlan Modra
One way to print 64-bit bfd_vma or bfd_size_type values on 32-bit hosts is to cast the value to long long and use the 'll' modifier in printf format strings. However, that's awkward because we also support the Microsoft C library printf that uses 'I64' as a modifier instead, and having variants of translated strings would not endear us to the translation project. So, rewrite the 'll' modifier in _doprint for Microsoft. Even with that capability it's not so nice for 32-bit code to need casts to long long, so this patch makes 'L' a modifier for bfd_vma rather than an alias for 'll'. I've then used the new 'L' modifier to fix selected format strings. * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for __MSVCRT__. Support "L" modifier for bfd_vma. Formatting. * elf.c (setup_group): Use "Lx" to print sh_size. (_bfd_elf_setup_sections): Remove unnecessary cast and print unknown section type in hex. (copy_special_section_fields): Style fix. (bfd_section_from_shdr): Correct format for sh_link. Use a common error message for all the variants of unrecognized section types. (assign_file_positions_for_load_sections): Use "Lx" for lma adjust error message. (assign_file_positions_for_non_load_sections): Formatting. (rewrite_elf_program_header): Formatting. Use "Lx" for bfd_vma values in error messages. * elfcode.h (elf_slurp_reloc_table_from_section): Cast ELF_R_SYM value to type expected by format. * elflink.c (elf_link_read_relocs_from_section): Use "Lx" in error messages. (elf_link_add_object_symbols): Use "Lu" for symbol sizes. (elf_link_input_bfd): Use "Lx" for r_info. (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2017-07-03BFD long long cleanupAlan Modra
long long isn't supposed to be used without a configure test, to support ancient compilers. Probably not terribly important nowadays. * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG. * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and Microsoft C library variant of long long format specifier. (PRINT20): Cast value to bfd_uint64_t not long long. * coffcode.h (coff_print_aux): Use BFD_VMA_FMT. * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than long long. Don't cast to bfd_vma. * elf32-score.c (score3_bfd_getl48): Likewise. * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2017-07-03Miscellaneous format string fixesAlan Modra
* elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to print d_tag. (bfd_elf_print_symbol): Don't cast symbol->flags. (_bfd_elf_symbol_from_bfd_symbol): Likewise. * elf32-ppc.c (ppc_elf_begin_write_processing): Correct _bfd_error_handler argument order. (ppc_elf_merge_private_bfd_data): Don't cast flags.
2017-07-03Missing config for bfd.c:_doprntAlan Modra
This function uses HAVE_LONG_LONG and HAVE_LONG_DOUBLE * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke AC_TYPE_LONG_DOUBLE. * configure: Regenerate. * config.in: Regenerate.
2017-07-03Disable symver test on hppa64-hpuxAlan Modra
The syntax for common symbols is different on that target. * testsuite/gas/elf/symver.d: Don't run on hppa64-hpux.
2017-07-03[GOLD] undef after using DW_IDX and friendsAlan Modra
* dwarf.h (DW_FIRST_IDX, DW_IDX, DW_IDX_DUP, DW_END_IDX): Undef after using.
2017-07-03Repair include/dwarf2.def breakageAlan Modra
* dwarf.h (DW_FIRST_IDX, DW_IDX, DW_IDX_DUP, DW_END_IDX): Define.
2017-07-03buffer.h: Fix spelling mistakesSimon Marchi
gdb/ChangeLog: * buffer.h (buffer_finish): Fix spelling mistakes.
2017-07-03Automatic date update in version.inGDB Administrator
2017-07-02DWARF-5: readelf: .debug_namesJan Kratochvil
Display DWARF-5 .debug_names (standardized .gdb_index). binutils/ChangeLog 2017-07-02 Jan Kratochvil <jan.kratochvil@redhat.com> * dwarf.c: Include assert.h. (MAX, MIN, get_IDX_name, display_debug_names): New. (debug_displays): Add .debug_names. * dwarf.h: (enum dwarf_section_display_enum): Add debug_names. * readelf.c (process_section_headers): Add ".debug_names".
2017-07-02Import include/+libiberty/ r249883 from upstream GCC.Jan Kratochvil
include/ChangeLog 2017-07-02 Jan Kratochvil <jan.kratochvil@redhat.com> * dwarf2.def (DW_IDX_compile_unit, DW_IDX_type_unit, DW_IDX_die_offset) (DW_IDX_parent, DW_IDX_type_hash, DW_IDX_lo_user, DW_IDX_hi_user) (DW_IDX_GNU_internal, DW_IDX_GNU_external): New. * dwarf2.h (DW_IDX, DW_IDX_DUP, DW_FIRST_IDX, DW_END_IDX): New. (enum dwarf_name_index_attribute): Remove. (get_DW_IDX_name): New declaration. libiberty/ChangeLog 2017-07-02 Jan Kratochvil <jan.kratochvil@redhat.com> * dwarfnames.c (DW_FIRST_IDX, DW_END_IDX, DW_IDX, DW_IDX_DUP): New.
2017-07-02Automatic date update in version.inGDB Administrator
2017-07-02Use bfd_malloc_and_get_sectionAlan Modra
It's nicer than xmalloc followed by bfd_get_section_contents, since xmalloc exits on failure and needs a check that its size_t arg doesn't lose high bits when converted from bfd_size_type. PR binutils/21665 * objdump.c (strtab): Make var a bfd_byte*. (disassemble_section): Don't limit malloc size. Instead, use bfd_malloc_and_get_section. (read_section_stabs): Use bfd_malloc_and_get_section. Return bfd_byte*. (find_stabs_section): Remove now unnecessary cast. * objcopy.c (copy_object): Use bfd_malloc_and_get_section. Free contents on error return. * nlmconv.c (copy_sections): Use bfd_malloc_and_get_section.
2017-07-01Setup .dir-locals.el to use C-style comments by defaultEli Zaretskii
gdb/ChangeLog: 2017-07-01 Eli Zaretskii <eliz@gnu.org> * .dir-locals.el: Automatically switch to C-style comments in versions of Emacs that support the feature.
2017-07-01Automatic date update in version.inGDB Administrator
2017-07-01MIPS/GAS: Use a switch on relaxation type in microMIPS fixup creationMaciej W. Rozycki
Use a switch on the relaxation type rather than a chain of conditionals in microMIPS fixup creation, improving source code structure and aiding the compiler with code generation. gas/ * config/tc-mips.c (md_convert_frag): Use a switch on the microMIPS relaxation type rather than a chain of conditionals.
2017-07-01MIPS/GAS: Use frag symbol/offset directly in fixup creationMaciej W. Rozycki
There is no need to use a helper expression in the creation of fixups made from a frag's symbol and offset, because a simple `symbol+offset' expression can be handled directly, with the use of a `fix_new' rather than a `fix_new_exp' call. Rewrite `md_convert_frag' using `fix_new' then and remove all the unneeded helper expressions, simplifying code. gas/ * config/tc-mips.c (md_convert_frag): Rewrite `fix_new_exp' calls in terms of `fix_new'.
2017-07-01MIPS/GAS: Use non-zero frag offset directly in PIC branch relaxationMaciej W. Rozycki
Use frag symbols with a non-zero offset directly in `fix_new_exp' calls made in PIC branch relaxation. There is no need here to make a helper symbol to hold the result of a `symbol+offset' calculation requested as only branches to local symbols are relaxed and in this case the LO16 part of the PIC address load sequence will have the offset accounted for in calculation against the local GOT entry retrieved as the GOT16 high part. Consequently actual code produed is identical whether a helper symbol is used or the original `symbol+offset' expression used directly. Verify that this is indeed the case with GAS and LD tests. gas/ * config/tc-mips.c (md_convert_frag): Don't make a helper expression symbol for `fix_new_exp' called with a non-zero offset. * testsuite/gas/mips/relax-offset.d: New test. * testsuite/gas/mips/mips1@relax-offset.d: New test. * testsuite/gas/mips/r3000@relax-offset.d: New test. * testsuite/gas/mips/r3900@relax-offset.d: New test. * testsuite/gas/mips/micromips@relax-offset.d: New test. * testsuite/gas/mips/relax-offset.l: New stderr output. * testsuite/gas/mips/relax-offset.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests. ld/ * testsuite/ld-mips-elf/relax-offset.dd: New test. * testsuite/ld-mips-elf/relax-offset.gd: New test. * testsuite/ld-mips-elf/relax-offset-umips.dd: New test. * testsuite/ld-mips-elf/relax-offset-umips.gd: New test. * testsuite/ld-mips-elf/relax-offset.ld: New test linker script. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests. (prune_warnings): New temporary procedure.