17096 Commits

Author SHA1 Message Date
a58f2d262b Automatic date update in version.in 2021-09-28 00:00:07 +00:00
b9004024b9 configure: regenerate in all projects that use libtool.m4
(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-27 20:31:24 +01:00
bf86d80dd2 Automatic date update in version.in 2021-09-27 00:00:08 +00:00
9a6abcc83c Automatic date update in version.in 2021-09-26 00:00:07 +00:00
99d0d99649 PR28346, segfault attempting to disassemble raw binary
Don't attempt to access elf_section_data for non-ELF sections.

	PR 28346
	* elf32-xtensa.c (xtensa_read_table_entries): Return zero entries
	for non-ELF.
2021-09-25 10:52:43 +09:30
ef7639ccb7 Automatic date update in version.in 2021-09-25 00:00:07 +00:00
3814a9e1fe Automatic date update in version.in 2021-09-24 00:00:09 +00:00
ae9150ce9e Automatic date update in version.in 2021-09-23 00:00:07 +00:00
5d0869d987 Automatic date update in version.in 2021-09-22 00:00:07 +00:00
01723a3503 Automatic date update in version.in 2021-09-21 00:00:08 +00:00
1e071750a2 Automatic date update in version.in 2021-09-20 00:00:06 +00:00
e4675a5810 elf: Don't set version info on unversioned symbols
Don't set version info on unversioned symbols when seeing a hidden
versioned symbol after an unversioned definition and the default
versioned symbol.

bfd/

	PR ld/28348
	* elflink.c (elf_link_add_object_symbols): Don't set version info
	on unversioned symbols.

ld/

	PR ld/28348
	* testsuite/ld-elf/pr28348.rd: New file.
	* testsuite/ld-elf/pr28348.t: Likewise.
	* testsuite/ld-elf/pr28348a.c: Likewise.
	* testsuite/ld-elf/pr28348b.c: Likewise.
	* testsuite/ld-elf/pr28348c.c: Likewise.
	* testsuite/ld-elf/shared.exp: Run PR ld/28348 tests.
2021-09-19 07:19:39 -07:00
3733650765 Automatic date update in version.in 2021-09-19 00:00:07 +00:00
10c21d953d Automatic date update in version.in 2021-09-18 00:00:08 +00:00
c9f2799101 RISC-V: Merged extension string tables and their version tables into one.
There are two main reasons for this patch,

* In the past we had two extension tables, one is used to record all
supported extensions in bfd/elfxx-riscv.c, another is used to get the
default extension versions in gas/config/tc-riscv.c.  It is hard to
maintain lots of tables in different files, but in fact we can merge
them into just one table.  Therefore, we now define many riscv_supported_std*
tables, which record names and versions for all supported extensions.
We not only use these tables to initialize the riscv_ext_order, but
also use them to get the default versions of extensions, and decide if
the extensions should be enbaled by default.

* We add a new filed `default_enable' for the riscv_supported_std* tables,
to decide if the extension should be enabled by default.  For now if the
`default_enable' field of the extension is set to EXT_DEFAULT, then we
should enable the extension when the -march and elf architecture attributes
are not set.  In the future, I suppose the `default_enable' can be set
to lots of EXT_<VENDOR>, each vendor can decide to open which extensions,
when the target triple of vendor is chosen.

The elf/linux regression tests of riscv-gnu-toolchain are passed.

bfd/
	* elfnn-riscv.c (cpu-riscv.h): Removed sine it is included in
	bfd/elfxx-riscv.h.
	(riscv_merge_std_ext): Updated since the field of rpe is changed.
	* elfxx-riscv.c (cpu-riscv.h): Removed.
	(riscv_implicit_subsets): Added implicit extensions for g.
	(struct riscv_supported_ext): Used to be riscv_ext_version.  Moved
	from gas/config/tc-riscv.c, and added new field `default_enable' to
	decide if the extension should be enabled by default.
	(EXT_DEFAULT): Defined for `default_enable' field.
	(riscv_supported_std_ext): It used to return the supported standard
	architecture string, but now we move ext_version_table from
	gas/config/tc-riscv.c to here, and rename it to riscv_supported_std_ext.
	Currently we not only use the table to initialize riscv_ext_order, but
	also get the default versions of extensions, and decide if the extensions
	should be enbaled by default.
	(riscv_supported_std_z_ext): Likewise, but is used for z* extensions.
	(riscv_supported_std_s_ext): Likewise, but is used for s* extensions.
	(riscv_supported_std_h_ext): Likewise, but is used for h* extensions.
	(riscv_supported_std_zxm_ext): Likewise, but is used for zxm* extensions.
	(riscv_all_supported_ext): Includes all supported extension tables.
	(riscv_known_prefixed_ext): Updated.
	(riscv_valid_prefixed_ext): Updated.
	(riscv_init_ext_order): Init the riscv_ext_order table according to
	riscv_supported_std_ext.
	(riscv_get_default_ext_version): Moved from gas/config/tc-riscv.c.
	Get the versions of extensions from riscv_supported_std* tables.
	(riscv_parse_add_subset): Updated.
	(riscv_parse_std_ext): Updated.
	(riscv_set_default_arch): Set the default subset list according to
	the default_enable field of riscv_supported_*ext tables.
	(riscv_parse_subset): If the input ARCH is NULL, then we call
	riscv_set_default_arch to set the default subset list.
	* elfxx-riscv.h (cpu-riscv.h): Included.
	(riscv_parse_subset_t): Removed get_default_version field, and added
	isa_spec field to replace it.
	(extern riscv_supported_std_ext): Removed.
gas/
	* (bfd/cpu-riscv.h): Removed.
	(struct riscv_ext_version): Renamed and moved to bfd/elfxx-riscv.c.
	(ext_version_table): Likewise.
	(riscv_get_default_ext_version): Likewise.
	(ext_version_hash): Removed.
	(init_ext_version_hash): Removed.
	(riscv_set_arch): Updated since the field of rps is changed.  Besides,
	report error when the architecture string is empty.
	(riscv_after_parse_args): Updated.
2021-09-17 16:33:54 +08:00
648d5dc4e6 Automatic date update in version.in 2021-09-17 00:00:08 +00:00
dc746ef741 Automatic date update in version.in 2021-09-16 00:00:07 +00:00
b4745472b6 bfd: fix incorrect type used in sizeof
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-15 11:32:33 +01:00
7b7c365c5c [bfd] Ensure unique printable names for bfd archs
Remove duplicate entry in bfd_ft32_arch and bfd_rx_arch.

Fix printable name for bfd_mach_n1: "nh1" -> "n1".

	PR 28336
	* cpu-ft32.c (arch_info_struct): Remove "ft32" entry.
	* cpu-rx.c (arch_info_struct): Remove "rx" entry.
	* cpu-nds32.c (bfd_nds32_arch): Fix printable name for bfd_mach_n1
	entry.
2021-09-15 10:10:46 +02:00
0a8d812b42 PR28328, dlltool ice
PR 28328
	* archive.c (bfd_ar_hdr_from_filesystem): Don't use bfd_set_input_error
	here, our caller will do that.
2021-09-15 10:04:17 +09:30
ff03a88e30 Automatic date update in version.in 2021-09-15 00:00:07 +00:00
09a7e91293 arc: Fix potential invalid pointer access when fixing got symbols.
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-14 12:10:54 +03:00
924e660d52 Automatic date update in version.in 2021-09-14 00:00:06 +00:00
fd5255582f Re: Deprecate a.out support for NetBSD targets
* config.bfd: Correct m68-*-*bsd* obsolete target match.
2021-09-13 17:04:01 +09:30
52e5dceb69 Automatic date update in version.in 2021-09-13 00:00:06 +00:00
58632d2856 Automatic date update in version.in 2021-09-12 00:00:05 +00:00
5abdee61d9 Automatic date update in version.in 2021-09-11 00:00:07 +00:00
e7776f52fe PowerPC, sanity check r_offset in relocate_section
* elf32-ppc.c (offset_in_range): New function.
	(ppc_elf_vle_split16): Sanity check r_offset before accessing
	section contents.  Return status.
        (ppc_elf_relocate_section): Sanity check r_offset before
        accessing section contents.  Don't segfault on NULL howto.
2021-09-10 18:04:18 +09:30
653cc1a141 Automatic date update in version.in 2021-09-10 00:00:08 +00:00
3660254ee0 Automatic date update in version.in 2021-09-09 00:00:08 +00:00
733ae98cb8 PowerPC64, sanity check r_offset in relocate_section
This hardens the powerpc64 linker code transformations.

	* elf64-ppc.c (is_8byte_reloc, offset_in_range): New functions.
	(ppc64_elf_relocate_section): Sanity check r_offset before
	accessing section contents for various code transformations.
2021-09-08 22:22:34 +09:30
beaddc1a80 PowerPC64: Avoid useless work on R_PPC64_TPREL34
_bfd_elf_ppc_at_tprel_transform doesn't handle prefix instructions,
and I'm not inclined to implement code editing for them.

	* elf64-ppc.c (ppc64_elf_relocate_section): Don't attempt tprel
	transform for R_PPC64_TPREL34.
2021-09-08 22:22:34 +09:30
116282d9d1 Automatic date update in version.in 2021-09-08 00:00:07 +00:00
64dbf74d42 Revert: [AArch64] MTE corefile support
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-07 11:03:20 -03:00
9dc2f26777 Fix an illegal memory access triggered by an atempt to disassemble a corrupt xtensa binary.
PR 28305
	* elf32-xtensa.c (elf_xtensa_do_reloc): Add check for put of range
	reloc.
2021-09-07 11:47:08 +01:00
3f1a2892e1 Fix illegal memory access triggered by an attempt to disassemble a corrupt RISC-V binary.
PR 28303
	* elfxx-riscv.c (riscv_elf_add_sub_reloc): Add check for out of
	range relocs.
2021-09-07 09:44:17 +01:00
b54509b844 PR28307, segfault in ppc64_elf_toc64_reloc
Adds missing bfd_reloc_offset_in_range checks to various relocation
special_functions.

	PR 28307
	* elf32-ppc.c (ppc_elf_addr16_ha_reloc): Range check reloc offset.
	* elf64-ppc.c (ppc64_elf_ha_reloc, ppc64_elf_brtaken_reloc): Likewise.
	(ppc64_elf_toc64_reloc, ppc64_elf_prefix_reloc): Likewise.
2021-09-07 10:41:29 +09:30
b4d9dd5c35 Automatic date update in version.in 2021-09-07 00:00:06 +00:00
804439b4d7 Fix an illegal memory access triggered by disassembling corrupt s390x binaries.
PR 28304
	* elfxx-score7.c (score_elf_gprel15_reloc): If there is no output bfd
	treat the reloc as undefined.
2021-09-06 12:25:20 +01:00
93d481d1d8 Automatic date update in version.in 2021-09-06 00:00:07 +00:00
b8fd36aaee Automatic date update in version.in 2021-09-05 00:00:06 +00:00
3f630a60ea Automatic date update in version.in 2021-09-04 00:00:06 +00:00
f2cfdb7486 ubsan: alpha: member access within null pointer
* elf64-alpha.c (elf64_alpha_relax_with_lituse): Avoid UB.
2021-09-03 11:45:58 +09:30
68e503ecf0 Automatic date update in version.in 2021-09-03 00:00:06 +00:00
d85e70a35b Add support for the haiku operating system. These are the os support patches we have been grooming and maintaining for quite a few years over on git.haiku-os.org. All of these architectures are working and most have been stable for quite some time. 2021-09-02 12:19:14 +01:00
b03b65e2aa SHT_SYMTAB_SHNDX handling
.symtab_shndx section contents is an array, one entry for each symbol
in .symtab, present when the number of symbols exceeds a little less
than 64k.  Since the mapping is 1-1 with symbols there is no need to
keep both dest_index and destshndx_index in elf_sym_strtab.  Instead,
just make sure that the shndx pointers to the swap functions are kept
NULL when .symtab_shndx does not exist.  Also, strtabcount in the
linker's elf hash table is incremented in lock-step with the output
symcount, so that can disappear too.
2021-09-02 13:48:21 +09:30
36f61bf2ad PTR_ADD and NPTR_ADD for bfd.h
This defines a couple of macros used to avoid ubsan complaints about
calculations involving NULL pointers.  PTR_ADD should be used in the
case where it is known that the offset is always zero with a NULL
pointer, and you'd like to know if a non-zero offset is ever used.
NPTR_ADD should be rarely used, but is defined for cases where a
non-zero offset is expected and should be ignored if the pointer is
NULL.

bfd/
	* bfd-in.h (PTR_ADD, NPTR_ADD): Define.
	* bfd-in2.h: Regenerate.
	* elf-eh-frame.c (adjust_eh_frame_local_symbols): Avoid NULL
	pointer calculations.
	* elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): Likewise.
	(bfd_elf_add_dt_needed_tag, elf_finalize_dynstr): Likewise.
	(elf_link_add_object_symbols, elf_link_input_bfd): Likewise.
	(bfd_elf_final_link, bfd_elf_gc_record_vtinherit): Likewise.
binutils/
	* objdump.c (disassemble_section): Use PTR_ADD for rel_ppend.
2021-09-02 13:48:21 +09:30
c79332d2d1 Automatic date update in version.in 2021-09-02 00:00:09 +00:00
bb1fcfc4b3 Automatic date update in version.in 2021-09-01 00:00:07 +00:00
c0e5bb42c6 Automatic date update in version.in 2021-08-31 00:00:07 +00:00