Commit Graph

16005 Commits

Author SHA1 Message Date
GDB Administrator dc7148375d Automatic date update in version.in 2020-05-05 00:00:06 +00:00
Gunther Nikl 7242fa8aa7 [PATCH] bfd: tweak SET_ARCH_MACH of aout-cris.c
* aout-cris.c (DEFAULT_ARCH): Delete define.
	(MY_set_arch_mach): Likewise.
	(SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
	of bfd_arch_cris.
	(swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
	of r_type before the shift.
2020-05-04 16:07:26 +01:00
Wilco Dijkstra cff69cf4cf [binutils-gdb][ld][AArch64] Fix group_sections algorithm
PR ld/25665
	* bfd/elfnn-aarch64.c (group_sections): Copy implementation
	from elf32-arm.c.
	* testsuite/ld-aarch64/aarch64-elf.exp: Add new test.
	* testsuite/ld-aarch64/farcall-group.s: New large group test.
	* testsuite/ld-aarch64/farcall-group.d: Likewise.
2020-05-04 15:51:56 +01:00
GDB Administrator c3bf7d31de Automatic date update in version.in 2020-05-04 00:00:06 +00:00
GDB Administrator c69ad65744 Automatic date update in version.in 2020-05-03 00:00:07 +00:00
GDB Administrator a4be18526b Automatic date update in version.in 2020-05-02 00:00:07 +00:00
Alan Modra a2714d6cca PR25900, RISC-V: null pointer dereference
PR 25900
	* elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
	accessing root.u.def of symbols.  Also check root.u.def.section
	is non-NULL.  Reverse tests so as to make the logic positive.
2020-05-01 15:32:36 +09:30
Alan Modra a8acd6eeb6 PR25882, .gnu.attributes are not checked for shared libraries
This allows backend merge_private_bfd_data to examine shared library
e_flags and/or .gnu.attributes.  ARM and PowerPC have done so when
using ld.gold for a long time.

(The tic6x change below is dead code due to the earlier FIXME,
but this is probably one of the changes needed there.)

	PR 25882
bfd/
	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
ld/
	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
	shared libraries.
2020-05-01 15:32:36 +09:30
Alan Modra 6b728d3286 FIXME for merging of e_flags and .gnu.attributes
Code in the linker, present before the addition of .gnu.attributes
support, results in shared libraries not being considered by BFD when
merging e_flags and .gnu.attributes from input files to the output.
That doesn't seem correct to me, but I don't know enough about all the
various ABIs to change the behaviour with any confidence.  So this
patch merely punts on dynamic objects in merge_private_bfd_data target
functions, with a FIXME for maintainer attention.

I haven't excluded shared libraries from being considered where the
target merge_private_bfd_data (a) already has code dealing with shared
libraries, or (b) where that function just sets the output to the most
constraining arch/mach combination and other fairly trivial merges, or
(c) when the target has no shared library linker support.

In (a) are: arc, arm, aarch64, riscv, sparc.
In (b) are: bpf, cris, csky, m32r, m68k, mn10300, nios2, tilegx,
	    tilepro, vax, visium, xtensa.
In (c) are: bpf, cr16, h8300, iq2000, m32c, m68hc11, m68hc12, mcore,
	    mep, msp430, mt, rl78, rx, v850.

	PR 25882
	* elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
	* elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
	* elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
	* elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
	* elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
	* elf32-sh.c (sh_elf_merge_private_data): Likewise.
	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
	* elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
	* elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
2020-05-01 15:32:36 +09:30
Alan Modra 91ed9b71fa ppc32 merging of e_flags from dynamic objects
EF_PPC_RELOCATABLE and similar flags, if present in an input shared
library, don't have any relevance as far as the output file is
concerned.

Currently, dynamic objects aren't seen in merge_private_bfd_data.
This patch is in preparation for a change to that.

	PR 25882
	* elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
	from shared libraries.
2020-05-01 15:32:36 +09:30
GDB Administrator eb47d2fa97 Automatic date update in version.in 2020-05-01 00:00:16 +00:00
Max Filippov d548f47df4 xtensa: fix XTENSA_NDIFF handling for PR ld/25861
Fields marked with XTENSA_NDIFF relocations are not negated, they only
have sign bits removed. Don't negate their values when relaxation is
performed. Don't add sign bits when the value is zero. Report overflow
when the result has negative sign but all significant bits are zero.

2020-04-29  Max Filippov  <jcmvbkbc@gmail.com>
bfd/
	* elf32-xtensa.c (relax_section): Don't negate diff_value for
	XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
	equals 0. Report overflow when the result has negative sign but
	all significant bits are zero.

ld/
	* testsuite/ld-xtensa/relax-diff1.d: New test definition.
	* testsuite/ld-xtensa/relax-diff1.s: New test source.
	* testsuite/ld-xtensa/relax-ndiff.d: New test definition.
	* testsuite/ld-xtensa/relax-ndiff.s: New test source.
	* testsuite/ld-xtensa/xtensa.exp: (relax-diff1)
	(relax-ndiff): New tests.
2020-04-29 18:34:23 -07:00
GDB Administrator 44e33ab45d Automatic date update in version.in 2020-04-30 00:00:11 +00:00
Gunther Nikl dfa85db14c bfd: Fix 64-bit relocation handling for a.out
* aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
	(aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
2020-04-29 14:42:41 +01:00
GDB Administrator 03549f57b6 Automatic date update in version.in 2020-04-29 00:00:12 +00:00
GDB Administrator 30b57e1bea Automatic date update in version.in 2020-04-28 00:00:10 +00:00
Alan Modra 48e5bada0a alpha-vms: divide by zero
The zero check was on the wrong operand.  And, yes, the second operand
popped is supposed to be divided by the first operand popped.

	* vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
	Emit warning message.
2020-04-28 08:35:34 +09:30
Tamar Christina 251dae9107 x86: Add i386 PE big-object support
The 64-bit version of binutils got support for the PE COFF BIG OBJ format a
couple of years ago.   The BIG OBJ format is a slightly different COFF format
which extends the size of the number of section field in the header from a
uint16_t to a uint32_t and so greatly increases the number of sections allowed.

However the 32-bit version of bfd never got support for this.  The GHC Haskell
compiler generates a great deal of symbols due to it's use of
-ffunction-sections and -fdata-sections.

This meant that we could not build the 32-bit version of the GHC Compiler for
many releases now as binutils didn't have this support.

This patch adds the support to the 32-bit port of binutils as well and also does
come cleanup in the code.

bfd/ChangeLog:

	* coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
	* coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
	* config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
	to x86_64_pe_big_vec as it not a big-endian format.
	(vec i386_pe_big_vec): New.
	* configure.ac: Likewise.
	* targets.c: Likewise.
	* configure: Regenerate.
	* pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
	COFF_WITH_PE_BIGOBJ): New.
	* pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
	New.
	(x86_64_pe_be_vec): Moved.

gas/ChangeLog:

	* NEWS: Add news entry for big-obj.
	* config/tc-i386.c (i386_target_format): Support new format.
	* doc/c-i386.texi: Add i386 support.
	* testsuite/gas/pe/big-obj.d: Rename test to not be x64 specific.
	* testsuite/gas/pe/pe.exp (big-obj): Make test run on i386 as well.

ld/ChangeLog:

	* pe-dll.c (pe_detail_list):  Add pe-bigobj-i386.
2020-04-27 17:41:39 +01:00
GDB Administrator 25e29062d2 Automatic date update in version.in 2020-04-27 00:00:15 +00:00
GDB Administrator ec9c4d8322 Automatic date update in version.in 2020-04-26 00:00:07 +00:00
GDB Administrator 617769d62f Automatic date update in version.in 2020-04-25 00:00:08 +00:00
GDB Administrator 5e5bbc7e79 Automatic date update in version.in 2020-04-24 00:00:20 +00:00
Anton Kolesov 2745674244 arc: Add support for ARC HS extra registers in core files
When a coredump is generated, there are a few registers in
ARC HS that are put under a special section, namely ".reg-v2".
It is for backward compatibility reasons with older tools that
we have decided not to extend the generic ".reg" section.

This patch makes it possible to display the information better
regarding that section.  Compare the output of "readelf" without
and with these changes:

$ readelf -n core     # without the patch
  ...
  LINUX    0x0000000c  Unknown note type: (0x00000600)
   description data: 78 08 00 00 2f 6c 64 2d 75 43 6c 69

$ readelf -n core     # with the patch
  ...
  LINUX    0x0000000c  NT_ARC_V2 (ARC HS accumulator/extra registers)
   description data: 78 08 00 00 2f 6c 64 2d 75 43 6c 69

In another commit (soon to be submitted), GDB will makes use of these
changes to parse the extra section and its registers.

bfd/ChangeLog
2020-03-26  Anton Kolesov  <anton.kolesov@synopsys.com>

	* elf-bfd.h (elfcore_write_arc_v2): Add prototype.
	* elf.c (elfcore_grok_arc_v2): New function.
	(elfcore_grok_note): Call the new function to handle the corresponding
	note.
	(elfcore_write_arc_v2): New function.
	(elfcore_write_register_note): Call the new function to handle the
	corresponding pseudo-sections.

binutils/ChangeLog
2020-03-26  Anton Kolesov  <anton.kolesov@synopsys.com>

	* readelf.c (get_note_type): Handle NT_ARC_V2.

include/elf/ChangeLog
2020-03-26  Anton Kolesov  <anton.kolesov@synopsys.com>

	* common.h (NT_ARC_V2): New macro definitions.
2020-04-23 11:09:09 +03:00
Max Filippov 30ce8e47fa xtensa: fix PR ld/25861
Introduce new relaxations XTENSA_PDIFF{8,16,32} for positive differences
(subtracted symbol precedes diminished symbol) and XTENSA_NDIFF{8,16,32}
for negative differences (subtracted symbol follows diminished symbol).
Don't generate XTENSA_DIFF relocations in the assembler, generate
XTENSA_PDIFF or XTENSA_NDIFF based on relative symbol position.

Handle XTENSA_DIFF in BFD for compatibility with old object files.
Handle XTENSA_PDIFF and XTENSA_NDIFF in BFD, treating difference value
as unsigned.

2020-04-22  Max Filippov  <jcmvbkbc@gmail.com>
bfd/
	* bfd-in2.h: Regenerated.
	* elf32-xtensa.c (elf_howto_table): New entries for
	R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
	(elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
	(relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
	R_XTENSA_NDIFF{8,16,32}.
	* libbfd.h (bfd_reloc_code_real_names): Add names for
	BFD_RELOC_XTENSA_PDIFF{8,16,32} and
	BFD_RELOC_XTENSA_NDIFF{8,16,32}.
	* reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
	and BFD_RELOC_XTENSA_NDIFF{8,16,32}.

binutils/
	* readelf.c (is_none_reloc): Recognize
	BFD_RELOC_XTENSA_PDIFF{8,16,32} and
	BFD_RELOC_XTENSA_NDIFF{8,16,32}.

gas/
	* config/tc-xtensa.c (md_apply_fix): Replace
	BFD_RELOC_XTENSA_DIFF{8,16,32} generation with
	BFD_RELOC_XTENSA_PDIFF{8,16,32} and
	BFD_RELOC_XTENSA_NDIFF{8,16,32} generation.
	* testsuite/gas/xtensa/loc.d: Replace BFD_RELOC_XTENSA_DIFF16
	with BFD_RELOC_XTENSA_PDIFF16 in the expected output.

include/
	* elf/xtensa.h (elf_xtensa_reloc_type): New entries for
	R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.

ld/
	* testsuite/ld-xtensa/relax-loc.d: New test definition.
	* testsuite/ld-xtensa/relax-loc.s: New test source.
	* testsuite/ld-xtensa/xtensa.exp (relax-loc): New test.
2020-04-22 18:46:45 -07:00
GDB Administrator e44f65e3c5 Automatic date update in version.in 2020-04-23 00:00:10 +00:00
GDB Administrator 259f1c5dca Automatic date update in version.in 2020-04-22 00:00:10 +00:00
Tamar Christina c36876fe5b BFD: Exclude sections with no content from compress check.
The check in bfd_get_full_section_contents is trying to check that we don't
allocate more space for a section than the size of the section is on disk.

Previously we excluded linker created sections since they didn't have a size on
disk.  However we also need to exclude sections with no content as well such as
the BSS section.  Space for these would not have been allocated by the assembler
and so the check would incorrectly fail.

bfd/ChangeLog:

	PR binutils/24753
	* compress.c (bfd_get_full_section_contents): Exclude sections with no
	content.

gas/ChangeLog:

	PR binutils/24753
	* testsuite/gas/arm/pr24753.d: New test.
	* testsuite/gas/arm/pr24753.s: New test.
2020-04-21 15:17:18 +01:00
H.J. Lu 6f6fd151cb elf: Strip zero-sized dynamic sections
ELF size_dynamic_sections is called by the ELF backend linker after all
the linker input files have been seen but before the section sizes have
been set.  After the sections sizes have been set, target-specific,
global optimizations may make some dynamic sections zero-sized if they
are no longer needed.

Add ELF strip_zero_sized_dynamic_sections so that ELF backend linker can
strip zero-sized dynamic sections after the sections sizes have been set.

bfd/

	PR ld/25849
	* elf-bfd.h (elf_backend_data): Add
	elf_backend_strip_zero_sized_dynamic_sections.
	(_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
	* elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
	New macro.
	* elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
	function.
	* elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
	New macro.
	(elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.

ld/

	PR ld/25849
	* ldelfgen.c (ldelf_map_segments): Call
	elf_backend_strip_zero_sized_dynamic_sections.
	* testsuite/ld-alpha/tlsbinr.rd: Updated.
2020-04-21 05:24:03 -07:00
H.J. Lu 1f7f2abbc3 alpha: Warn DT_TEXTREL with -M
This fixes:

FAIL: DT_TEXTREL map file warning

	* elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
	sec.
	(elf64_alpha_check_relocs): Set sec instead of reltext.  Warn
	DT_TEXTREL with -M.
	(elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
2020-04-21 05:20:23 -07:00
Nick Clifton e04f33c09f Updated Serbian translation for the BFD directory. 2020-04-21 11:48:31 +01:00
Alan Modra fad3d2c1b2 Remove SH-5 remnants
git commit 211dc24b87 removed most sh5 and sh64 SuperH support, after
they were obsoleted by git commit 2b213129c5.  This patch removes a
few remaining pieces that should have gone with 211dc24b87.

include/
	* elf/sh.h (STO_SH5_ISA32, SHF_SH5_ISA32, SHF_SH5_ISA32_MIXED),
	(SHT_SH5_CR_SORTED, STT_DATALABEL): Delete.
bfd/
	* elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
	processing.
2020-04-21 11:35:43 +09:30
GDB Administrator 0ff8f4b9f0 Automatic date update in version.in 2020-04-21 00:00:11 +00:00
Stephen Casner 23c8270e9d When bfd/pdp11.c was copied from bfd/aoutx.h, the #defines for external symbol types N_TEXT etc. were #undef'd and then #define'd with new values. But N_STAB was not changed even though the new value for N_EXT overlapped with it. This caused aout_link_write_symbols() to treat global symbols referenced in the source but defined in a linker script as undefined.
Separately, in translate_symbol_table() the 16-bit symbol values were sign extended to unsigned long (e.g., 64 bits) when they really should be treated as unsigned so the value remains 16 bits.

	PR 25828
	* pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
	causing globals from linker script to be treated as debug symbols.
	(translate_symbol_table): Don't sign-extend symbol values from 16
	to 64 bits in nm output.
2020-04-20 12:49:50 +01:00
GDB Administrator 58ee9a8a46 Automatic date update in version.in 2020-04-20 00:00:07 +00:00
Alan Modra 2efec98b28 PowerPC64: remove empty .rela.dyn (.rela.branch_lt)
Stripping .rela.branch_lt is easy enough but messes with the
testsuite due to stub symbols (that use section id) changing.  Tests
that run on more than one target variant can be tricky to fix, this
renaming happened to work.

bfd/
	* elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
ld/
	* testsuite/ld-powerpc/tlsopt5.s: Rename foo to aaaaa.
	* testsuite/ld-powerpc/tlsopt5.d: Adjust to suit.
	* testsuite/ld-powerpc/tlsopt6.d: Likewise.
2020-04-20 08:14:42 +09:30
GDB Administrator 13d43873d8 Automatic date update in version.in 2020-04-19 00:00:06 +00:00
Alan Modra 18f9735354 bfd_is_const_section thinko
* section.c (bfd_is_const_section): Correct test for special
	sections.
	* bfd-in2.h: Regenerate.
2020-04-18 10:24:17 +09:30
GDB Administrator 41937b52d8 Automatic date update in version.in 2020-04-18 00:00:10 +00:00
Alan Modra 8d55d10ac0 PR25842, Null pointer dereference in nm-new
PR 25842
	* elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
	NULL nodename.
2020-04-17 10:56:01 +09:30
GDB Administrator ffb60ef355 Automatic date update in version.in 2020-04-17 00:00:14 +00:00
Nick Clifton 8e4979ac1e Stop the MIPS assembler from accepting ifunc symbols.
PR 25803
gas	* config/obj-elf.c (obj_elf_type): Reject ifunc symbols on MIPS
	targets.
	* testsuite/gas/elf/elf.exp: Add MIPS targets to the list to skip
	for the type-2 test.
	* testsuite/gas/elf/type-noifunc.e: Update to allow for MIPS
	targets running this test.

bfd	* elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
	abort with a more helpful error message.
2020-04-16 18:02:10 +01:00
Alan Modra aec72fda3b PR25827, Null pointer dereferencing in scan_unit_for_symbols
PR 25827
	* dwarf2.c (scan_unit_for_symbols): Wrap overlong lines.  Don't
	strdup(0).
2020-04-16 17:55:04 +09:30
Alan Modra 2165dc8d90 PowerPC64 GOT reloc reserving PLT entry for ifunc
I can't see any reason why ELFv2 should create a PLT entry for ifuncs
referenced by GOT relocs as long as the GOT entry remains.  The GOT
entry ought to be resolved by ld.so to the value returned by the ifunc
resolver, or if there is global entry stub created for some other
reason, by the linker to the stub address.

	* elf64-ppc.c (ppc64_elf_check_relocs): Don't create plt entries
	for GOT relocs against ifuncs.
2020-04-16 15:43:19 +09:30
Alan Modra 06507dab61 PowerPC64 GOT reloc optimisation
When the symbol referenced by a GOT reloc is an ifunc, we can't
optimise away the GOT indirection.  Well, we can, but only if a global
entry stub is created with the ifunc symbol redefined to the stub.
But that results in slower code and an indirection via the PLT so
there isn't much to like about that solution.

	* elf64-ppc.c (ppc64_elf_edit_toc): Exclude ifunc from GOT
	optimisation.
	(ppc64_elf_relocate_section): Likewise.
2020-04-16 15:39:48 +09:30
GDB Administrator 27e91adae9 Automatic date update in version.in 2020-04-16 00:00:10 +00:00
Fangrui Song 95a5156812 Unify the behaviour of ld.bfd and ld.gold with respect to warning about unresolved symbol references. (PR 24613)
PR binutils/24613
include	* bfdlink.h (enum report_method): Delete RM_GENERATE_WARNING and
	RM_GENERATE_ERROR. Add RM_DIAGNOSE.
	(struct bfd_link_info): Add warn_unresolved_syms.

ld	* lexsup.c (parse_args): Change RM_GENERATE_WARNING and
	RM_GENERATE_ERROR to RM_DIAGNOSE.
	* emultempl/aix.em (ld_${EMULATION_NAME}_emulation): Change
	RM_GENERATE_ERROR to RM_DIAGNOSE.
	* emultempl/elf.em (ld_${EMULATION_NAME}_emulation): Likewise.

bfd	* coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
	to RM_DIAGNOSE plus a check of warn_unresolved_syms.
	* coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
	* elf-bfd.h (_bfd_elf_large_com_section): Likewise.
	* elf32-m32r.c (m32r_elf_relocate_section): Likewise.
	* elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
	* elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
	* elf32-sh.c (sh_elf_relocate_section): Likewise.
	* elf32-spu.c (spu_elf_relocate_section): Likewise.
	* elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
	* elflink.c (elf_link_output_extsym): Likewise.
	* elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
2020-04-15 14:25:08 +01:00
Alan Modra 7ecb51549a PR25823, Use after free in bfd_hash_lookup
PR 25823
	* peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
	pointer into strings that may be freed for section name, always
	allocate a new string.
2020-04-15 19:02:26 +09:30
GDB Administrator 6a05414145 Automatic date update in version.in 2020-04-15 00:00:10 +00:00
Juan Manuel Guerrero f717994fe8 [PATCH v2 2/2] coff-go32: support extended relocations
This patch extends the relocation and line number counters for
coff-go32 and coff-go32-exe to 32 bits.  As I understand it works the
same as for PE-COFF:

If the number of relocations in an object file exceeds 65534, the
NRELOC field is set to 65535 and the actual number of relocations is
stored in the VADDR field of the first relocation entry.

Executable files have no relocations, and thus the NRELOC field is
repurposed to extend NLNNO to 32-bits.

bfd	* coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
	(coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
	(_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
	(_bfd_go32_mkobject): New functions.
	* coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
	(coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
	(go32exe_mkobject): Call _bfd_go32_mkobject.
	* coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
	(coff_set_alignment_hook): Define function for COFF_GO32_EXE
	and COFF_GO32.
	(coff_write_relocs): Enable extended reloc counter code if
	COFF_WITH_EXTENDED_RELOC_COUNTER is defined.  Test for obj_go32.
	(coff_write_object_contents): Likewise.  Pad section headers
	for COFF_GO32 and COFF_GO32EXE.  Use bfd_coff_swap_scnhdr_out
	instead of coff_swap_scnhdr_out.
	* cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
	enable extended reloc counter.
	* coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
	Declare with ATTRIBUTE_UNUSED.
	* libcoff-in.h: (struct coff_tdata): New field go32.
	(obj_go32): Define.
	* libcoff.h: Regenerate.
2020-04-14 17:30:01 +01:00
Fangrui Song 34ca55313b The assembler only supports 32-bit stabs. So set sh_entsize unconditionally to 12.
PR gas/25768
	* elf.c (assign_section_numbers): Always set .stab sh_entsize to
	12.
2020-04-14 15:21:50 +01:00