Commit Graph

104773 Commits

Author SHA1 Message Date
Nick Alcock
66dd4c3850
libctf: fix ref leak of names of newly-inserted non-root-visible types
A bug in ctf_dtd_delete led to refs in the string table to the
names of non-root-visible types not being removed when the DTD
was.  This seems harmless, but actually it would lead to a write
down a pointer into freed memory if such a type was ctf_rollback()ed
over and then the dict was serialized (updating all the refs as the
strtab was serialized in turn).

Bug introduced in commit fe4c2d5563
("libctf: create: non-root-visible types should not appear in name tables")
which is included in binutils 2.35.

libctf/
	* ctf-create.c (ctf_dtd_delete): Remove refs for all types
	with names, not just root-visible ones.
2024-08-02 12:44:27 +01:00
Alan Modra
a281816c8a PR28422, build_id use-after-free
This fixes a bug in commit 5d9bbb73c1.  All fields preserved from a
bfd in struct bfd_preserve need to be cleared in bfd_reinit.

	PR 28422
	* format.c (bfd_reinit): Clear build_id.

(cherry picked from commit 6d661cdc5b)
2021-10-07 14:59:53 +10:30
Alan Modra
163d807743 [GOLD] PowerPC64 relocation overflow for -Os register save/restore funcs
Fixes a silly mistake in calculating the address of -Os out-of-line
register save/restore function copies.  Copies of these linker defined
functions are added to stub sections when the original (in
target->savres_section) can't be reached.

	* powerpc.cc (Target_powerpc::Relocate::relocate): Correct address
	calculation of out-of-line save/restore function copies.

(cherry picked from commit 89c905a342)
2021-08-19 10:52:15 +09:30
Alan Modra
ee51385839 [GOLD] PR27815, gold fails to build with latest GCC
...gold/gc.h:250:37: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: [-Werror]
  250 |                 (*secvec).push_back(Section_id(NULL, 0));
      |                                     ^~~~~~~~~~~~~~~~~~~

	PR gold/27815
	* gc.h (gc_process_relocs): Use nullptr in Section_id constructor.

Don't use nullptr, it requires -std=c++11 on versions of gcc prior to
6.1.  It would be possible to arrange to pass -std=c++11 automatically
when required (top level configure does that for gcc builds) but that
seems overkill and since we're not up-to-date on the top level config
files would mean someone would need to sync those over.

	PR gold/27815
	* gc.h (gc_process_relocs): Use cast in Section_id constructor.

https://en.cppreference.com/w/cpp/types/NULL says NULL might be
defined as nullptr.
https://en.cppreference.com/w/cpp/language/reinterpret_cast says
reinterpret_cast can't be used on nullptr.

	PR gold/28106
	PR gold/27815
	* gc.h (gc_process_relocs): Use static_cast in Section_id constructor.

(cherry picked from commit 1f1fb219fd)
(cherry picked from commit 5d7f11f0e7)
(cherry picked from commit b97bd97623)
2021-08-19 10:52:15 +09:30
Alan Modra
74b1f14926 testsuite: Don't start directives in first column
Fixes fails on hppa64-hp-hpux11.23

	* testsuite/gas/elf/section25.s: Don't start directives in first
	column.
	* testsuite/gas/elf/section26.s: Likewise.

(cherry picked from commit db543a7de3)
2021-08-19 10:52:03 +09:30
Duncan Simpson
212b5b74a0 Fix gold to use mallinfo2 if available instead of deprecated mallinfo.
gold/
	PR gold/26585
	* configure.ac: Add check for mallinfo2.
	* configure: Regenerate.
	* main.cc (main): Use mallinfo2 if available.

	PR gold/26585
	* main.cc (main): Fix typo in previous patch.

	PR gold/26585
	* config.in: Regenerate from previous commit.

(cherry picked from commit 4ee6049505)
(cherry picked from commit cc1849716f)
(cherry picked from commit 9331846e44)
2021-08-19 09:37:43 +09:30
Nick Clifton
84fd26d820 Backport patch to fix a quadratic slow down in the BFD library.
PR 28058
bfd	* elf.c (bfd_section_from_shdr): Set has_secondary_relocs flag.
	(_bfd_elf_slurp_secondary_reloc_section): Use it for early-out.
2021-07-09 16:54:59 +01:00
Nick Clifton
abe2a28aaa Backportpatch to fix parsing of DWARF fuction and variable tags.
PR 27484
bfd	* dwarf2.c (scan_unit_for_symbols): Scan twice, once to accumulate
	function and variable tags and a second time to resolve their
	attributes.
2021-07-09 16:39:06 +01:00
GDB Administrator
814d9ecf9b Automatic date update in version.in 2021-07-03 00:00:52 +00:00
GDB Administrator
9db99e42f8 Automatic date update in version.in 2021-07-02 00:00:41 +00:00
Richard Earnshaw
687dd74c9b arm: don't treat XScale features as part of the FPU [PR 28031]
Although the XScale and its iwMMX extensions are implemented in the
Arm co-processor space, they are not considered to be part of the FPU
specification.  In particular, they cannot be enabled or disabled via
a .fpu directive.  It's therefore incorrect to strip these properties
when a new .fpu directive is encountered.

Note that the legacy Maverick co-processor is considered to be a FPU
and it is possible to control this via the .fpu directive.

include:

	PR gas/28031
	* opcode/arm.h (FPU_ANY): Exclude XScale-related features.
2021-07-01 17:47:11 +01:00
GDB Administrator
bd374cc2dc Automatic date update in version.in 2021-07-01 00:00:40 +00:00
GDB Administrator
2446b02367 Automatic date update in version.in 2021-06-30 00:00:48 +00:00
GDB Administrator
75a4eb82ef Automatic date update in version.in 2021-06-29 00:00:46 +00:00
GDB Administrator
ed2f2f45c2 Automatic date update in version.in 2021-06-28 00:00:34 +00:00
GDB Administrator
2cfc66bc46 Automatic date update in version.in 2021-06-27 00:00:39 +00:00
GDB Administrator
af42a868ef Automatic date update in version.in 2021-06-26 00:00:33 +00:00
GDB Administrator
ad9a2bd65c Automatic date update in version.in 2021-06-25 00:00:44 +00:00
GDB Administrator
0adfd3a88e Automatic date update in version.in 2021-06-24 00:00:45 +00:00
GDB Administrator
6ecf41172c Automatic date update in version.in 2021-06-23 00:00:39 +00:00
GDB Administrator
80d0c46a72 Automatic date update in version.in 2021-06-22 00:00:43 +00:00
GDB Administrator
a7eb3ff36c Automatic date update in version.in 2021-06-21 00:00:30 +00:00
GDB Administrator
21dd883860 Automatic date update in version.in 2021-06-20 00:00:39 +00:00
GDB Administrator
37fadb6ef2 Automatic date update in version.in 2021-06-19 00:00:28 +00:00
GDB Administrator
bf57d8eb47 Automatic date update in version.in 2021-06-18 00:00:46 +00:00
GDB Administrator
a81254fae7 Automatic date update in version.in 2021-06-17 00:00:44 +00:00
GDB Administrator
de955b29e6 Automatic date update in version.in 2021-06-16 00:00:43 +00:00
GDB Administrator
4c30ee3286 Automatic date update in version.in 2021-06-15 00:00:45 +00:00
GDB Administrator
88cb287c03 Automatic date update in version.in 2021-06-14 00:00:35 +00:00
GDB Administrator
6bd77506c0 Automatic date update in version.in 2021-06-13 00:00:37 +00:00
GDB Administrator
d9b45ba2ee Automatic date update in version.in 2021-06-12 00:00:31 +00:00
GDB Administrator
dd1396b5f0 Automatic date update in version.in 2021-06-11 00:01:19 +00:00
GDB Administrator
b481ba02ba Automatic date update in version.in 2021-06-10 00:00:36 +00:00
GDB Administrator
8c5062d58d Automatic date update in version.in 2021-06-09 00:00:45 +00:00
GDB Administrator
8b91c37ed9 Automatic date update in version.in 2021-06-08 00:01:38 +00:00
GDB Administrator
953595dada Automatic date update in version.in 2021-06-07 00:01:10 +00:00
GDB Administrator
1dae789b15 Automatic date update in version.in 2021-06-06 00:01:13 +00:00
GDB Administrator
ecb46fca67 Automatic date update in version.in 2021-06-05 00:01:25 +00:00
GDB Administrator
0aa46dd891 Automatic date update in version.in 2021-06-04 00:01:44 +00:00
GDB Administrator
215986c7c0 Automatic date update in version.in 2021-06-03 00:01:11 +00:00
GDB Administrator
57bef2f936 Automatic date update in version.in 2021-06-02 00:01:18 +00:00
GDB Administrator
459494d59b Automatic date update in version.in 2021-06-01 00:01:22 +00:00
GDB Administrator
7e989c8aeb Automatic date update in version.in 2021-05-31 00:01:25 +00:00
GDB Administrator
c2b48366f9 Automatic date update in version.in 2021-05-30 00:01:11 +00:00
GDB Administrator
5411a4251e Automatic date update in version.in 2021-05-29 00:01:09 +00:00
GDB Administrator
1932900f76 Automatic date update in version.in 2021-05-28 00:01:10 +00:00
GDB Administrator
3bc86347ee Automatic date update in version.in 2021-05-27 00:00:57 +00:00
GDB Administrator
c63828ebe8 Automatic date update in version.in 2021-05-26 00:01:38 +00:00
Tamar Christina
995e0b770e Gas: Forgot to commit changelog 2021-05-25 18:41:31 +01:00
Tamar Christina
eaf6d3b360 Arm: Fix forward thumb references [PR gas/25235]
When assembling a forward reference the symbol will be unknown and so during
do_t_adr we cannot set the thumb bit.  The bit it set so early to prevent
relaxations that are invalid. i.e. relaxing a Thumb2 to Thumb1 insn when the
symbol is Thumb.

But because it's done so early we miss the case for forward references.
This patch changes it so that we additionally check the thumb bit during the
internal relocation processing.

In principle we should be able to only set the bit during reloc processing but
that would require changes to the other relocations that the instruction could
be relaxed to.

This approach still allows early relaxations (which means that we have less
iteration of internal reloc processing) while still fixing the forward reference
case.

gas/ChangeLog:

2021-05-24  Tamar Christina  <tamar.christina@arm.com>

	PR gas/25235
	* config/tc-arm.c (md_convert_frag): Set LSB when Thumb symbol.
	(relax_adr): Thumb symbols 4 bytes.
	* testsuite/gas/arm/pr25235.d: New test.
	* testsuite/gas/arm/pr25235.s: New test.

(cherry picked from commit d3e52e120b)
2021-05-25 16:08:22 +01:00