aboutsummaryrefslogtreecommitdiff
path: root/bfd/ChangeLog
AgeCommit message (Collapse)AuthorFilesLines
2022-10-19Fix an illegal memory access when parsing an ELF file containing corrupt ↵Nick Clifton1-0/+6
symbol version information. PR 29699 * elf.c (_bfd_elf_slurp_version_tables): Fail if the sh_info field of the section header is zero.
2022-09-09Support debuginfo files with empty group sections.Nick Clifton1-0/+6
PR 29532 bfd * elf.c (setup_group): Do not return false if there is no group information available. bionutils* objcopy.c (setup_section): Leave group sections intact when creating separate debuginfo files.
2022-09-06bfd: Add bfd_find_nearest_line_with_altAaron Merey1-0/+49
bfd_find_nearest_line_with_alt functions like bfd_find_nearest_line with the addition of a parameter for specifying the filename of a supplementary debug file such as one referenced by .gnu_debugaltlink or .debug_sup. This patch focuses on implementing bfd_find_nearest_line_with_alt support for ELF/DWARF2 .gnu_debugaltlink. For other targets this function simply sets the invalid_operation bfd_error.
2022-09-02Add OpenBSD ARM Little Endian BFD support.Frederic Cambus1-0/+4
* config.bfd (arm-*-openbsd*): Restore target.
2022-08-30BFD library: Use entry 0 in directory and filename tables of DWARF-5 debug info.Nick Clifton1-0/+12
PR 29529 * dwarf2.c (struct line_info_table): Add new field: use_dir_and_file_0. (concat_filename): Use new field to help select the correct table slot. (read_formatted_entries): Do not skip entry 0. (decode_line_info): Set new field depending upon the version of DWARF being parsed. Initialise filename based upon the setting of the new field.
2022-08-22Add OpenBSD AArch64 Little Endian BFD support.Frederic Cambus1-0/+4
* config.bfd (aarch64-*-openbsd*): Add target.
2022-08-03Fix a conflict between the linker's need to rename some PE format input ↵Alan Modra1-0/+13
libraries and the BFD library's file caching mechanism. PR 29389 bfd * bfd.c (BFD_CLOSED_BY_CACHE): New bfd flag. * cache.c (bfd_cache_delete): Set BFD_CLOSED_BY_DELETE on the closed bfd. (bfd_cache_lookup_worker): Clear BFD_CLOSED_BY_DELETE on the newly reopened bfd. * opncls.c (bfd_set_filename): Refuse to change the name of a bfd that has been closed by bfd_cache_delete. Mark changed bfds as uncacheable. * bfd-in2.h: Regenerate. ld * ldlang.h (lang_input_statement_struct): Add sort_key field. * emultempl/pe.em (after_open): If multiple import libraries refer to the same bfd, store their names in the sort_key field. * emultempl/pep.em (after_open): Likewise. * ldlang.c (sort_filename): New function. Returns the filename to be used when sorting input files. (wild_sort): Use the sort_filename function.
2022-07-29Stop the linker from complaining about unrecognised DW_FORM-rnglistx and ↵Nick Clifton1-0/+6
DW_FORM_loclistx format attributes. PR 29424 * dwarf2.c (read_attribute_value): Handle DW_FORM_rnglistx and DW_FORM_loclistx.
2022-07-26Fix indentation in loongarch code, preventing a compile time warning.Nick Clifton1-0/+5
2022-07-08Add markers for 2.39 branchNick Clifton1-0/+4
2022-05-19 _bfd_real_fopen should not use ccs parameter on WindowsYvan Roux1-0/+5
PR 25713 * bfdio.c (_bfd_real_fopen): Delete ccs string.
2022-04-27Create pseudo sections for NT_ARM_TLS notes on FreeBSD.John Baldwin1-0/+4
bfd/ChangeLog: * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_TLS notes.
2022-04-25Emit a note warning the user that creating an executable stack because of a ↵Nick Clifton1-0/+8
missing .note.GNU-stack section is deprecated. PR 29072 bfd * elflink.c (bfd_elf_size_dynamic_sections): Display a note to the user that the current ehaviour of creating an executable stack because of a missing .note.GNU-stack section is deprecated and will be changed in a future release. binutils* testsuite/lib/binutils-common.exp (prune_warnings_extra): Filter out notes about the executable stacjk behaviour beign deprecated. ld * testsuite/ld-elf/pr29072.b.warn: Update to include the note about the linker's behaviour being depreccated.
2022-04-20xcoff: implement linker relaxationCl?ment Chigot1-0/+60
bfd/ChangeLog: * coff-rs6000.c (xcoff_reloc_type_noop): Add info argument. (xcoff_reloc_type_fail): Likewise. (xcoff_reloc_type_pos): Likewise. (xcoff_reloc_type_neg): Likewise. (xcoff_reloc_type_rel): Likewise. (xcoff_reloc_type_toc): Likewise. (xcoff_reloc_type_ba): Likewise. (xcoff_reloc_type_crel): Likewise. (xcoff_reloc_type_tls): Likewise. (xcoff_reloc_type_br): Add stub handler. (xcoff_ppc_relocate_section): Add info to xcoff_calculate_relocation. (xcoff_stub_indirect_call_code): New constant. (xcoff_stub_shared_call_code): Likewise. (bfd_xcoff_backend_data): Add stub code fields. (bfd_pmac_xcoff_backend_data): Likewise. * coff64-rs6000.c (xcoff64_reloc_type_br): Add stub handler. (xcoff64_ppc_relocate_section): Add info to xcoff64_calculate_relocation. (xcoff64_stub_indirect_call_code): New constant. (xcoff64_stub_shared_call_code): Likewise. (bfd_xcoff_backend_data): Add stub code fields. (bfd_xcoff_aix5_backend_data): Likewise. * libxcoff.h (struct xcoff_backend_data_rec): Add stub fields. (bfd_xcoff_stub_indirect_call_code): New define. (bfd_xcoff_stub_indirect_call_size): New define. (bfd_xcoff_stub_shared_call_code): New define. (bfd_xcoff_stub_shared_call_size): New define. (xcoff_reloc_function): Add info argument. (enum xcoff_stub_type): New enum. (struct xcoff_stub_hash_entry): New structure. * xcofflink.c (struct xcoff_link_hash_table): Add stub hash table and params fields. (xcoff_stub_hash_entry): New define. (xcoff_stub_hash_lookup): New define. (stub_hash_newfunc): New function. (_bfd_xcoff_bfd_link_hash_table_free): Free the new stub hash table. (_bfd_xcoff_bfd_link_hash_table_create): Create the new stub hash table. (xcoff_link_add_symbols): Save rawsize for XTY_SD. (bfd_xcoff_link_init): New function. (xcoff_stub_csect_name): New function. (xcoff_stub_get_csect_in_range): New function. (xcoff_stub_name): New function. (bfd_xcoff_get_stub_entry): New function. (bfd_xcoff_type_of_stub): New function. (xcoff_add_stub): New function. (xcoff_build_one_stub): New function. (bfd_xcoff_size_stubs): New function. (bfd_xcoff_build_stubs): New function. (xcoff_stub_create_relocations): New function. (xcoff_link_input_bfd): Adapt relocations to stub. (xcoff_write_global_symbol): Adapt to new TOC entries generated for stubs. (_bfd_xcoff_bfd_final_link): Handle stub file. * xcofflink.h (struct bfd_xcoff_link_params): New structure. ld/ChangeLog: * emultempl/aix.em (params): New variable. (stub_file): New variable. (xcoff_add_stub_section): New function. (xcoff_layout_sections_again): New function (hook_in_stub): New function. (_after_allocation): Add stub creation. (_create_output_section_statements): Allocate stub file and pass params to backend.
2022-04-20Stubs (added in a later patch) will generate new .loader symbols, once the ↵Cl?ment Chigot1-0/+19
allocations have been done. Thus, the .loader section cannot be layout before that. bfd/ChangeLog: * coff-rs6000.c (_bfd_xcoff_put_ldsymbol_name): Write len in ldinfo->strings instead of directly in the output_bfd. * coff64-rs6000.c (_bfd_xcoff64_put_ldsymbol_name): Likewise. * xcofflink.c (struct xcoff_link_hash_table): Remove ldrel_count field. Add ldinfo field. (xcoff_mark_symbol): Adjust to new ldinfo field. (xcoff_mark): Likewise. (bfd_xcoff_link_count_reloc): Likewise. (xcoff_build_loader_section): Split into two functions: one that build the loader section (this function) and one that only size it... (xcoff_size_loader_section): ... (this function). (bfd_xcoff_size_dynamic_sections): Adapt to new ldinfo field. Move the part where the dynamic sections are build to ... (bfd_xcoff_build_dynamic_sections): ... this function. * xcofflink.h: Add bfd_xcoff_build_dynamic_sections prototype. include/ChangeLog: * coff/xcoff.h (struct xcoff_loader_info): Add ldrel_count and libpath fields. ld/ChangeLog: * emultempl/aix.em (_after_allocation): New function.
2022-04-13binutils: enable PE on 32bit haiku buildAlexander von Gluck IV1-0/+4
* config.bfd (x86-haiku): Add i386_pei_vec as a selectable format.
2022-04-08Debug info for function in Windows PE binary on wrong instructionNick Clifton1-0/+6
PR 29038 * coffgen.c (coff_find_nearest_line_with_names): Fix typo retrieving saved bias.
2022-04-07Add support for COFF secidx relocationsMark Harmstone1-0/+16
bfd * coff-i386.c (in_reloc_p): Add R_SECTION. (howto_table): Add R_SECTION. (coff_pe_i386_relocation_section): Add support for R_SECTION. (coff_i386_reloc_type_lookup): Add support for BFD_RELOC_16_SECCIDX. * coff-x86_64.c (in_reloc_p): Add R_SECTION. (howto_table): Add R_SECTION. (coff_pe_amd64_relocation_section): Add support for R_SECTION. (coff_amd64_reloc_type_lookup): Add support for BFD_RELOC_16_SECCIDX. * reloc.c: Add BFD_RELOC_16_SECIDX. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. gas * config/tc-i386.c (pe_directive_secidx): New function. (md_pseudo_table): Add support for secidx. (x86_cons_fix_new): Likewise. (tc_gen_reloc): Likewise. * expr.c (op_rank): Add O_secidx. * expr.h (operatorT): Likewise. * symbols.c (resolve_symbol_value): Add support for O_secidx. * testsuite/gas/i386/secidx.s: New test source file. * testsuite/gas/i386/secidx.d: New test driver file. * testsuite/gas/i386/i386.exp: Run new test. include * coff/i386.h: Define R_SECTION. * coff/x86_64.h: Likewise. ld * testsuite/ld-pe/secidx1.s: New test source file. * testsuite/ld-pe/secidx2.s: New test source file. * testsuite/ld-pe/secidx.d: New test driver file. * testsuite/ld-pe/secidx_64.d: New test driver file. * testsuite/ld-pe/pe.exp: Add new tests.
2022-04-01Use pseudosections for NT_FREEBSD_X86_SEGBASES core dump notes.John Baldwin1-0/+9
This includes adding pseudosections when reading a core dump as well as support for writing out a core dump note from a pseudosection. bfd/ChangeLog: * elf-bfd.h (elfcore_write_x86_segbases): New. * elf.c (elfcore_grok_freebsd_note): Add pseudosections for NT_FREEBSD_X86_SEGBASES register notes. (elfcore_write_x86_segbases): New. (elfcore_write_register_note): Write NT_FREEBSD_X86_SEGBASES register notes.
2022-04-01elfcore_grok_freebsd_note: Remove checks of note->namesz.John Baldwin1-0/+4
This function is only called if the note name is "FreeBSD", so checking the name size is unnecessary. bfd/ChangeLog: * elf.c (elfcore_grok_freebsd_note): Remove checks for namesz.
2022-03-22Fix return code in _bfd_dwarf2_find_nearest_line().Steiner H Gunderson1-0/+5
* dwarf2.c (_bfd_dwarf2_find_nearest_line): if a function name is found, but no line number info, then return a result of 2.
2022-03-21Reduce O(n2) performance overhead when parsing DWARF unit information.Steiner H Gunderson1-0/+7
PR 28978 * dwarf2.c (scan_unit_for_symbols): When performing second pass, check to see if the function or variable being processed is the same as the previous one.
2022-03-18Fix ld-arm bug in encoding of blx calls jumping from thumb to arm instructionsViorel Preoteasa1-0/+6
PR 28924 * elf32-arm.c (THM_MAX_FWD_BRANCH_OFFSET): Fix definition. (THM2_MAX_FWD_BRANCH_OFFSET): Likewise.
2022-03-16bfd: add AMDGCN architectureSimon Marchi1-0/+21
Add support for the AMDGCN architecture to BFD. This is the bare minimum to get $ ./configure --target=amdgcn-hsa-amdhsa --disable-gas $ make all-binutils working later in this series. The specific AMDGCN models added here are a bit arbitrary, based on what we intend to initially support in GDB. This list will need to be updated in the future anyway. The complete up-to-date list of existing AMDGPU models can be found here: https://llvm.org/docs/AMDGPUUsage.html#processors The ELF format for this architecture is documented here: https://llvm.org/docs/AMDGPUUsage.html#elf-code-object The flags for the "HSA" OS ABI are properly versioned and documented on that page. But the NONE, PAL and MESA3D OS ABIs are not well documented nor versioned. Taking a peek at the LLVM source code, we see that they encode their flags the same way as HSA v3. For example, for PAL: https://github.com/llvm/llvm-project/blob/c8b614cd74a92d85936aed5ac7c642af75ffdc29/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp#L601 So at least, we know that all AMDGPU objects (of which AMDGCN objects are a subset of) at the time of writing encode the specific GPU model in the EF_AMDGPU_MACH field of e_flags. bfd/ChangeLog: * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES): Add cpu-amdgcn.c. (BFD64_BACKENDS): Add elf64-amdgcn.lo. (BFD64_BACKENDS_CFILES): Add elf64-amdgcn.c. * Makefile.in: Re-generate. * cpu-amdgcn.c: New. * elf64-amdgcn.c: New. * archures.c (bfd_architecture): Add bfd_arch_amdgcn and related mach defines. (bfd_amdgcn_arch): New. (bfd_archures_list): Add bfd_amdgcn_arch. * bfd-in2.h: Re-generate. * config.bfd: Handle amdgcn* target. * configure.ac: Handle amdgcn_elf64_le_vec. * configure: Re-generate. * elf-bfd.h (elf_target_id): Add AMDGCN_ELF_DATA. * targets.c (amdgcn_elf64_le_vec): New. (_bfd_target_vector): Add amdgcn_elf64_le_vec. include/ChangeLog: * elf/amdgpu.h: New. * elf/common.h (ELFOSABI_AMDGPU_HSA): Add. Change-Id: I969f7b14960797e88891c308749a6e341eece5b2
2022-03-01Fix a typo in the previous delta to bfdio.c.Nick Clifton1-1/+8
PR 25713 * bfdio.c (_bfd_real_fopen): Fix typo.
2022-03-01Prevent an assertion from being triggered when linking an ARM object file ↵Nick Clifton1-0/+7
with incorrectly set build attributes. PR 28848 PR 28859 * elf32-arm.c (elf32_arm_merge_eabi_attributes): If the first input bfd has a Tag_ABI_HardFP_use set to 3 but does not also have TAG_FP_arch set then reset the TAG_ABI_HardFP_use.
2022-02-28Further correct the handling of long pathnames on Windows hosts.Torbj?rn Svensson1-0/+6
PR 25713 * bfdio.c (_bfd_real_fopen): Fix handling of parhs longer than 260 characters on Windows hosts.
2022-02-28Clarify the wording of the error message when an obsolete configuration is ↵Nick Clifton1-0/+5
encountered. PR 28886 * config.bfd: Update error message for obsolete configurations.
2022-02-17Updated Serbian translations for the bfd, gold, ld and opcodes directoriesNick Clifton1-0/+4
2022-02-16ld: Support customized output section typeFangrui Song1-0/+10
bfd/ PR ld/28841 * bfd-in2.h (struct bfd_section): Add type. (discarded_section): Add field. * elf.c (elf_fake_sections): Handle bfd_section::type. * section.c (BFD_FAKE_SECTION): Add field. * mri.c (mri_draw_tree): Update function call. ld/ PR ld/28841 * ld.texi: Document new output section type. * ldlex.l: Add new token TYPE. * ldgram.y: Handle TYPE=exp. * ldlang.h: Add type_section to list of section types. * ldlang.c (lang_add_section): Handle type_section. (map_input_to_output_sections): Handle type_section. * testsuite/ld-scripts/output-section-types.t: Add tests. * testsuite/ld-scripts/output-section-types.d: Update.
2022-02-11bfd: Remove return with expression in void functionMichael Forney1-0/+5
* bfd.c (bfd_set_gp_value): Remove return with expression in void function.
2022-02-09Update the obsolete list and how-to-make-a-release documentation now that ↵Nick Clifton1-0/+5
the 2.38 release is out.
2022-02-02Stop the BFD library complaining about compressed dwarf debug string ↵Nick Clifton1-0/+6
sections being too big. PR 28834 * dwarf2.c (read_section): Change the heuristic that checks for overlarge dwarf debug info sections.
2022-02-02or1k: Avoid R_OR1K_GOT16 signed overflow by using special howtoStafford Horne1-0/+7
Previously when fixing PR 21464 we masked out upper bits of the relocation value in order to avoid overflow complaints when acceptable. It turns out this does not work when the relocation value ends up being signed. To fix this this patch introduces a special howto with complain_on_overflow set to complain_overflow_dont. This is used in place of the normal R_OR1K_GOT16 howto when we detect R_OR1K_GOT_AHI16 relocations. bfd/ChangeLog: PR 28735 * elf32-or1k.c (or1k_elf_got16_no_overflow_howto): Define. (or1k_elf_relocate_section): Use new howto instead of trying to mask out relocation bits.
2022-01-24bfd/doc: Fix racy build failure from missing mkdirRoland McGrath1-0/+4
bfd/ * doc/local.mk (%D%/bfdver.texi): Add mkdir command.
2022-01-24Update Bulgarian, French, Romaniam and Ukranian translation for some of the ↵Nick Clifton1-0/+6
sub-directories
2022-01-22Change version number to 2.38.50 and regenerate filesNick Clifton1-0/+6
2022-01-22Add markers for 2.38 branchNick Clifton1-0/+4
2022-01-17Update the config.guess and config.sub files from the master repository and ↵Nick Clifton1-0/+7
regenerate files.
2022-01-02Update year range in copyright notice of binutils filesAlan Modra1-1/+1
The result of running etc/update-copyright.py --this-year, fixing all the files whose mode is changed by the script, plus a build with --enable-maintainer-mode --enable-cgen-maint=yes, then checking out */po/*.pot which we don't update frequently. The copy of cgen was with commit d1dd5fcc38ead reverted as that commit breaks building of bfp opcodes files.
2021-12-15Fix an undefined behaviour in the BFD library's DWARF parser.Nikita Popov1-0/+5
PR 28687 * dwarf1.c (parse_die): Fix undefined behaviour in range tests.
2021-11-17Fix the linker script parser so that it will recognise the PT_GNU_RELRO ↵Nick Clifton1-0/+6
segment type, and the linker itself so that it will gracefully handle being unable to assign any sections to such a segment. PR 28452 bfd * elf.c (assign_file_positions_for_non_load_sections): Replace assertion with a warning message. ld * ldgram.y: Add support for PT_GNU_RELRO and PT_GNU_PROPERTY. * ldgram.c: Regenerate.
2021-10-19Fix a potential illegal memory access when testing for a special LTO symbol ↵Nick Clifton1-0/+6
name. bfd * linker.c (_bfd_generic_link_add_one_symbol): Test for a NULL name before checking to see if the symbol is __gnu_lto_slim. * archive.c (_bfd_compute_and_write_armap): Likewise. binutils * nm.c (filter_symbols): Test for a NULL name before checking to see if the symbol is __gnu_lto_slim. * objcopy.c (filter_symbols): Likewise.
2021-09-27configure: regenerate in all projects that use libtool.m4Nick Alcock1-0/+4
(including sim/, which has no changelog.) bfd/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. binutils/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. gas/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. gprof/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. ld/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. libctf/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. * Makefile.in: Regenerate. opcodes/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. zlib/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate.
2021-09-15bfd: fix incorrect type used in sizeofAndrew Burgess1-0/+5
Noticed in passing that we used 'sizeof (char **)' when calculating the size of a list of 'char *' pointers. Of course, this isn't really going to make a difference anywhere, but we may as well be correct. There should be no user visible changes after this commit. bfd/ChangeLog: * archures.c (bfd_arch_list): Use 'char *' instead of 'char **' when calculating space for a string list.
2021-09-14arc: Fix potential invalid pointer access when fixing got symbols.Claudiu Zissulescu1-0/+9
When statically linking, it can arrive to an undefined weak symbol of which its value cannot be determined. However, we are having pieces of code which doesn't take this situation into account, leading to access a structure which may not be initialized. Fix this situation and add a test. bfd/ xxxx-xx-xx Cupertino Miranda <cmiranda@synopsys.com> Claudiu Zissulescu <claziss@synopsys.com> * arc-got.h (arc_static_sym_data): New structure. (get_static_sym_data): New function. (relocate_fix_got_relocs_for_got_info): Move the computation fo symbol value and section to above introduced function, and use this new function. ld/testsuite/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * ld-arc/got-weak.d: New file. * ld-arc/got-weak.s: Likewise. Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com> fix
2021-09-07Revert: [AArch64] MTE corefile supportLuis Machado1-0/+9
bfd * elf.c (elfcore_make_memtag_note_section): New function. (elfcore_grok_note): Handle NT_MEMTAG note types. binutils* readelf.c (get_note_type): Handle NT_MEMTAG note types. include * elf/common.h (NT_MEMTAG): New constant. (NT_MEMTAG_TYPE_AARCH_MTE): New constant.
2021-09-07Fix an illegal memory access triggered by an atempt to disassemble a corrupt ↵Nick Clifton1-0/+4
xtensa binary. PR 28305 * elf32-xtensa.c (elf_xtensa_do_reloc): Add check for put of range reloc.
2021-09-07Fix illegal memory access triggered by an attempt to disassemble a corrupt ↵Nick Clifton1-0/+6
RISC-V binary. PR 28303 * elfxx-riscv.c (riscv_elf_add_sub_reloc): Add check for out of range relocs.
2021-08-10Updated Serbian and Russian translations for various sub-directoriesNick Clifton1-0/+4