Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package binutils.17161 for
openSUSE:Leap:15.2:Update checked in at 2021-11-15 10:07:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2:Update/binutils.17161 (Old)
and /work/SRC/openSUSE:Leap:15.2:Update/.binutils.17161.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "binutils.17161"
Mon Nov 15 10:07:04 2021 rev:1 rq:930840 version:2.37
Changes:
--------
New Changes file:
--- /dev/null 2021-10-14 08:13:55.193858881 +0200
+++
/work/SRC/openSUSE:Leap:15.2:Update/.binutils.17161.new.1890/binutils.changes
2021-11-15 10:07:06.376369268 +0100
@@ -0,0 +1,3994 @@
+-------------------------------------------------------------------
+Fri Nov 5 16:54:36 UTC 2021 - Michael Matz <[email protected]>
+
+- Add binutils-revert-hlasm-insns.diff for compatibility on old
+ code stream that expect 'brcl 0,label' to not be disassembled
+ as 'jgnop label' on s390x. [bsc#1192267]
+
+-------------------------------------------------------------------
+Wed Nov 3 08:23:52 UTC 2021 - Martin Li??ka <[email protected]>
+
+- Rebase binutils-2.37-branch.diff: fixes PR28523 aka boo#1188941.
+
+-------------------------------------------------------------------
+Tue Nov 2 15:57:53 UTC 2021 - Michael Matz <[email protected]>
+
+- Fix empty man-pages from broken release tarball [PR28144].
+
+-------------------------------------------------------------------
+Mon Nov 1 09:34:38 UTC 2021 - Martin Li??ka <[email protected]>
+
+- Update binutils-skip-rpaths.patch with contained a memory corruption
+ (boo#1191473).
+
+-------------------------------------------------------------------
+Fri Oct 8 14:11:44 UTC 2021 - Michael Matz <[email protected]>
+
+- Configure with --disable-x86-used-note on old code streams.
+- Disable libalternatives temporarily for build cycle reasons.
+- make TARGET-bfd=headers again, we patch bfd-in.h
+- This state submitted to SLE12 and SLE15 code streams for annual
+ toolchain update. [jsc#PM-2767, jsc#SLE-21561, jsc#SLE-19618]
+- Bump binutils-2.37-branch.diff to 66d5c7003, to include fixes for
+ PR28422, PR28192, PR28391. Also adds some s390x arch14
+ instructions [jsc#SLE-18637].
+
+-------------------------------------------------------------------
+Fri Sep 10 23:16:12 CEST 2021 - Stefan Schubert [email protected]
+
+- Using libalternatives instead of update-alternatives.
+
+-------------------------------------------------------------------
+Wed Sep 8 15:09:58 UTC 2021 - Michael Matz <[email protected]>
+
+- Adjust for testsuite fails on older products that configure
+ binutils in different ways, adds binutils-compat-old-behaviour.diff
+ and adjusts binutils-revert-nm-symversion.diff and
+ binutils-revert-plt32-in-branches.diff.
+
+-------------------------------------------------------------------
+Tue Aug 3 13:36:19 UTC 2021 - Martin Li??ka <[email protected]>
+
+- Bump binutils-2.37-branch.diff: fixes PR28138.
+
+-------------------------------------------------------------------
+Thu Jul 22 17:36:14 UTC 2021 - Martin Li??ka <[email protected]>
+
+- Use LTO & PGO build.
+
+-------------------------------------------------------------------
+Thu Jul 22 15:01:27 UTC 2021 - Martin Li??ka <[email protected]>
+
+- Update to binutils 2.37:
+ * The GNU Binutils sources now requires a C99 compiler and library to
+ build.
+ * Support for the arm-symbianelf format has been removed.
+ * Support for Realm Management Extension (RME) for AArch64 has been
+ added.
+ * A new linker option '-z report-relative-reloc' for x86 ELF targets
+ has been added to report dynamic relative relocations.
+ * A new linker option '-z start-stop-gc' has been added to disable
+ special treatment of __start_*/__stop_* references when
+ --gc-sections.
+ * A new linker options '-Bno-symbolic' has been added which will
+ cancel the '-Bsymbolic' and '-Bsymbolic-functions' options.
+ * The readelf tool has a new command line option which can be used to
+ specify how the numeric values of symbols are reported.
+ --sym-base=0|8|10|16 tells readelf to display the values in base 8,
+ base 10 or base 16. A sym base of 0 represents the default action
+ of displaying values under 10000 in base 10 and values above that in
+ base 16.
+ * A new format has been added to the nm program. Specifying
+ '--format=just-symbols' (or just using -j) will tell the program to
+ only display symbol names and nothing else.
+ * A new command line option '--keep-section-symbols' has been added to
+ objcopy and strip. This stops the removal of unused section symbols
+ when the file is copied. Removing these symbols saves space, but
+ sometimes they are needed by other tools.
+ * The '--weaken', '--weaken-symbol' and '--weaken-symbols' options
+ supported by objcopy now make undefined symbols weak on targets that
+ support weak symbols.
+ * Readelf and objdump can now display and use the contents of .debug_sup
+ sections.
+ * Readelf and objdump will now follow links to separate debug info
+ files by default. This behaviour can be stopped via the use of the
+ new '-wN' or '--debug-dump=no-follow-links' options for readelf and
+ the '-WN' or '--dwarf=no-follow-links' options for objdump. Also
+ the old behaviour can be restored by the use of the
+ '--enable-follow-debug-links=no' configure time option.
+
+ The semantics of the =follow-links option have also been slightly
+ changed. When enabled, the option allows for the loading of symbol
+ tables and string tables from the separate files which can be used
+ to enhance the information displayed when dumping other sections,
+ but it does not automatically imply that information from the
+ separate files should be displayed.
+
+ If other debug section display options are also enabled (eg
+ '--debug-dump=info') then the contents of matching sections in both
+ the main file and the separate debuginfo file *will* be displayed.
+ This is because in most cases the debug section will only be present
+ in one of the files.
+
+ If however non-debug section display options are enabled (eg
+ '--sections') then the contents of matching parts of the separate
+ debuginfo file will *not* be displayed. This is because in most
+ cases the user probably only wanted to load the symbol information
+ from the separate debuginfo file. In order to change this behaviour
+ a new command line option --process-links can be used. This will
+ allow di0pslay options to applied to both the main file and any
+ separate debuginfo files.
+ * Nm has a new command line option: '--quiet'. This suppresses "no
+ symbols" diagnostic.
+- Includes fixes for these CVEs:
+ bnc#1181452 aka CVE-2021-20197 aka PR26945
+ bnc#1183511 aka CVE-2021-20284 aka PR26931
+ bnc#1184519 aka CVE-2021-20294 aka PR26929
+ bnc#1184620 aka CVE-2021-3487 aka PR26946
+ bnc#1184794 aka CVE-2020-35448 aka PR26574
+- Also fixes:
+ bsc#1183909 - slow performance of stripping some binaries
+- Rebased patches: binutils-build-as-needed.diff,
binutils-fix-abierrormsg.diff,
+ binutils-fix-invalid-op-errata.diff, binutils-fix-relax.diff,
+ binutils-revert-nm-symversion.diff, binutils-revert-plt32-in-branches.diff
+- Removed patches (are in upstream):
ppc-ensure-undef-dynamic-weak-undefined.patch and
+ ppc-use-local-plt.patch.
+- Add binutils-2.37-branch.diff.gz.
+
+-------------------------------------------------------------------
+Fri May 7 15:34:22 UTC 2021 - Andreas Schwab <[email protected]>
+
+- ppc-ensure-undef-dynamic-weak-undefined.patch: PPC: ensure_undef_dynamic
+ on weak undef only in plt
+- ppc-use-local-plt.patch: PowerPC use_local_plt (prerequisite for above
+ patch)
+
+-------------------------------------------------------------------
+Fri Mar 26 10:06:58 UTC 2021 - Martin Li??ka <[email protected]>
+
+- Update 2.36 branch diff which fixes PR27587.
+
+-------------------------------------------------------------------
+Wed Mar 3 12:53:27 UTC 2021 - Martin Li??ka <[email protected]>
+
+- Do not run make TARGET-bfd=headers separately.
+
+-------------------------------------------------------------------
+Mon Mar 1 09:01:59 UTC 2021 - Martin Li??ka <[email protected]>
+
+- Bump 2.36 branch diff (includes fix for PR27441 aka bsc#1182252).
+
+-------------------------------------------------------------------
+Thu Feb 4 08:40:53 UTC 2021 - Martin Li??ka <[email protected]>
+
+- Bump 2.36 branch diff.
+
+-------------------------------------------------------------------
+Wed Feb 3 08:39:37 UTC 2021 - Martin Li??ka <[email protected]>
+
+- Update 2.36 branch diff which should fix PR27311 completely.
+ It fixes also PR27284.
+- Remove temporary fix
0001-PR27311-ld.bfd-symbol-from-plugin-undefined-referenc.patch.
+
+-------------------------------------------------------------------
+Tue Feb 2 13:07:22 UTC 2021 - Martin Li??ka <[email protected]>
+
+- Add temporary upstream fix for PR27311
+ 0001-PR27311-ld.bfd-symbol-from-plugin-undefined-referenc.patch.
+
+-------------------------------------------------------------------
+Sun Jan 24 16:56:39 UTC 2021 - Martin Li??ka <[email protected]>
+
+- Update to binutils 2.36:
+ New features in the Assembler:
+ General:
+ * When setting the link order attribute of ELF sections, it is now
+ possible to use a numeric section index instead of symbol name.
+ * Added a .nop directive to generate a single no-op instruction in
+ a target neutral manner. This instruction does have an effect on
+ DWARF line number generation, if that is active.
+ * Removed --reduce-memory-overheads and --hash-size as gas now
+ uses hash tables that can be expand and shrink automatically.
+ X86/x86_64:
+ * Add support for AVX VNNI, HRESET, UINTR, TDX, AMX and Key
+ Locker instructions.
+ * Support non-absolute segment values for lcall and ljmp.
+ * Add {disp16} pseudo prefix to x86 assembler.
+ * Configure with --enable-x86-used-note by default for Linux/x86.
++++ 3797 more lines (skipped)
++++ between /dev/null
++++ and
/work/SRC/openSUSE:Leap:15.2:Update/.binutils.17161.new.1890/binutils.changes
New Changes file:
cross-aarch64-binutils.changes: same change
New Changes file:
cross-arm-binutils.changes: same change
New Changes file:
cross-avr-binutils.changes: same change
New Changes file:
cross-epiphany-binutils.changes: same change
New Changes file:
cross-hppa-binutils.changes: same change
New Changes file:
cross-hppa64-binutils.changes: same change
New Changes file:
cross-i386-binutils.changes: same change
New Changes file:
cross-ia64-binutils.changes: same change
New Changes file:
cross-m68k-binutils.changes: same change
New Changes file:
cross-mips-binutils.changes: same change
New Changes file:
cross-ppc-binutils.changes: same change
New Changes file:
cross-ppc64-binutils.changes: same change
New Changes file:
cross-ppc64le-binutils.changes: same change
New Changes file:
cross-riscv64-binutils.changes: same change
New Changes file:
cross-rx-binutils.changes: same change
New Changes file:
cross-s390-binutils.changes: same change
New Changes file:
cross-s390x-binutils.changes: same change
New Changes file:
cross-sparc-binutils.changes: same change
New Changes file:
cross-sparc64-binutils.changes: same change
New Changes file:
cross-spu-binutils.changes: same change
New Changes file:
cross-x86_64-binutils.changes: same change
New Changes file:
cross-xtensa-binutils.changes: same change
New:
----
README.First-for.SUSE.packagers
_constraints
aarch64-common-pagesize.patch
add-ulp-section.diff
baselibs.conf
binutils-2.37-branch.diff.gz
binutils-2.37.tar.bz2
binutils-2.37.tar.bz2.sig
binutils-bfd_h.patch
binutils-build-as-needed.diff
binutils-compat-old-behaviour.diff
binutils-fix-abierrormsg.diff
binutils-fix-invalid-op-errata.diff
binutils-fix-relax.diff
binutils-pr22868.diff
binutils-revert-hlasm-insns.diff
binutils-revert-nm-symversion.diff
binutils-revert-plt32-in-branches.diff
binutils-skip-rpaths.patch
binutils.changes
binutils.keyring
binutils.spec
cross-aarch64-binutils.changes
cross-aarch64-binutils.spec
cross-arm-binutils.changes
cross-arm-binutils.spec
cross-avr-binutils.changes
cross-avr-binutils.spec
cross-avr-nesc-as.patch
cross-avr-omit_section_dynsym.patch
cross-avr-size.patch
cross-epiphany-binutils.changes
cross-epiphany-binutils.spec
cross-hppa-binutils.changes
cross-hppa-binutils.spec
cross-hppa64-binutils.changes
cross-hppa64-binutils.spec
cross-i386-binutils.changes
cross-i386-binutils.spec
cross-ia64-binutils.changes
cross-ia64-binutils.spec
cross-m68k-binutils.changes
cross-m68k-binutils.spec
cross-mips-binutils.changes
cross-mips-binutils.spec
cross-ppc-binutils.changes
cross-ppc-binutils.spec
cross-ppc64-binutils.changes
cross-ppc64-binutils.spec
cross-ppc64le-binutils.changes
cross-ppc64le-binutils.spec
cross-riscv64-binutils.changes
cross-riscv64-binutils.spec
cross-rx-binutils.changes
cross-rx-binutils.spec
cross-s390-binutils.changes
cross-s390-binutils.spec
cross-s390x-binutils.changes
cross-s390x-binutils.spec
cross-sparc-binutils.changes
cross-sparc-binutils.spec
cross-sparc64-binutils.changes
cross-sparc64-binutils.spec
cross-spu-binutils.changes
cross-spu-binutils.spec
cross-x86_64-binutils.changes
cross-x86_64-binutils.spec
cross-xtensa-binutils.changes
cross-xtensa-binutils.spec
enable-targets-gold.diff
ld-relro.diff
pre_checkin.sh
s390-biarch.diff
s390-pic-dso.diff
testsuite.diff
unit-at-a-time.patch
x86-64-biarch.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ binutils.spec ++++++
++++ 647 lines (skipped)
cross-aarch64-binutils.spec: same change
cross-arm-binutils.spec: same change
cross-avr-binutils.spec: same change
cross-epiphany-binutils.spec: same change
cross-hppa-binutils.spec: same change
cross-hppa64-binutils.spec: same change
cross-i386-binutils.spec: same change
cross-ia64-binutils.spec: same change
cross-m68k-binutils.spec: same change
cross-mips-binutils.spec: same change
cross-ppc-binutils.spec: same change
cross-ppc64-binutils.spec: same change
cross-ppc64le-binutils.spec: same change
cross-riscv64-binutils.spec: same change
cross-rx-binutils.spec: same change
cross-s390-binutils.spec: same change
cross-s390x-binutils.spec: same change
cross-sparc-binutils.spec: same change
cross-sparc64-binutils.spec: same change
cross-spu-binutils.spec: same change
cross-x86_64-binutils.spec: same change
cross-xtensa-binutils.spec: same change
++++++ README.First-for.SUSE.packagers ++++++
IMPORTANT: Please change binutils.spec and then run ./pre_checkin.sh!
Do not change cross-*.spec directly!
The spec file triggers by it's %name if it compiles the native or the
cross version and pre_checkin.sh (called automatically by checkin too)
copies over the binutils.spec and changes the Name field, so you shouldn't
need to worry too much about the cross packages
Updating to some branch head:
> cvs -z 9 -d :pserver:anoncvs@stravinsky:/cvs/src export -r
> binutils-2_23-branch binutils
Thanks,
Stephan Kulow
++++++ _constraints ++++++
<constraints>
<hardware>
<disk>
<size unit="G">6</size>
</disk>
</hardware>
<overwrite>
<conditions>
<arch>ppc</arch>
<arch>ppc64</arch>
<arch>ppc64le</arch>
</conditions>
<hardware>
<physicalmemory>
<size unit="G">4</size>
</physicalmemory>
</hardware>
</overwrite>
</constraints>
++++++ aarch64-common-pagesize.patch ++++++
Change default common-page-size to 64K on aarch64. This enables the use
of RELRO since we are using 64K pages.
Index: binutils-2.25.0/bfd/elfnn-aarch64.c
===================================================================
--- binutils-2.25.0.orig/bfd/elfnn-aarch64.c
+++ binutils-2.25.0/bfd/elfnn-aarch64.c
@@ -7945,7 +7945,7 @@ const struct elf_size_info elfNN_aarch64
#define ELF_MACHINE_CODE EM_AARCH64
#define ELF_MAXPAGESIZE 0x10000
#define ELF_MINPAGESIZE 0x1000
-#define ELF_COMMONPAGESIZE 0x1000
+#define ELF_COMMONPAGESIZE 0x10000
#define bfd_elfNN_close_and_cleanup \
elfNN_aarch64_close_and_cleanup
Index: binutils-2.25.0/gold/aarch64.cc
===================================================================
--- binutils-2.25.0.orig/gold/aarch64.cc
+++ binutils-2.25.0/gold/aarch64.cc
@@ -791,7 +791,7 @@ const Target::Target_info Target_aarch64
"/lib/ld.so.1", // program interpreter
0x400000, // default_text_segment_address
0x10000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000, // common_pagesize (overridable by -z common-page-size)
+ 0x10000, // common_pagesize (overridable by -z common-page-size)
false, // isolate_execinstr
0, // rosegment_gap
elfcpp::SHN_UNDEF, // small_common_shndx
@@ -818,7 +818,7 @@ const Target::Target_info Target_aarch64
"/lib/ld.so.1", // program interpreter
0x400000, // default_text_segment_address
0x10000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000, // common_pagesize (overridable by -z common-page-size)
+ 0x10000, // common_pagesize (overridable by -z common-page-size)
false, // isolate_execinstr
0, // rosegment_gap
elfcpp::SHN_UNDEF, // small_common_shndx
@@ -845,7 +845,7 @@ const Target::Target_info Target_aarch64
"/lib/ld.so.1", // program interpreter
0x400000, // default_text_segment_address
0x10000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000, // common_pagesize (overridable by -z common-page-size)
+ 0x10000, // common_pagesize (overridable by -z common-page-size)
false, // isolate_execinstr
0, // rosegment_gap
elfcpp::SHN_UNDEF, // small_common_shndx
@@ -872,7 +872,7 @@ const Target::Target_info Target_aarch64
"/lib/ld.so.1", // program interpreter
0x400000, // default_text_segment_address
0x10000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000, // common_pagesize (overridable by -z common-page-size)
+ 0x10000, // common_pagesize (overridable by -z common-page-size)
false, // isolate_execinstr
0, // rosegment_gap
elfcpp::SHN_UNDEF, // small_common_shndx
++++++ add-ulp-section.diff ++++++
This is for userspace live patching, adding some space into
shared libs or executable (in the .ulp section) when one of the
input files contains a section named .ulp.track.
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 101c2fdf50d..f5d9e201fdb 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1487,6 +1487,10 @@ struct elf_backend_data
(const bfd *ibfd, bfd *obfd, const Elf_Internal_Shdr *isection,
Elf_Internal_Shdr *osection);
+ bool (*elf_backend_is_ulp_enabled) (bfd *abfd);
+
+ bool (*elf_backend_setup_ulp) (struct bfd_link_info *);
+
/* Used to handle bad SHF_LINK_ORDER input. */
void (*link_order_error_handler) (const char *, ...);
diff --git a/bfd/elflink.c b/bfd/elflink.c
index ce1407fa2dc..5c70bcf6c07 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -7260,6 +7260,13 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
s = bfd_get_linker_section (dynobj, ".gnu.version");
s->flags |= SEC_EXCLUDE;
}
+
+ if (bed->elf_backend_is_ulp_enabled != NULL
+ && bed->elf_backend_setup_ulp != NULL
+ && (*bed->elf_backend_is_ulp_enabled) (info->input_bfds))
+ {
+ (*bed->elf_backend_setup_ulp)(info);
+ }
}
return true;
}
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 4c6b1f20340..1f54509cd08 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -771,6 +771,14 @@
#define elf_backend_copy_special_section_fields
_bfd_elf_copy_special_section_fields
#endif
+#ifndef elf_backend_is_ulp_enabled
+#define elf_backend_is_ulp_enabled NULL
+#endif
+
+#ifndef elf_backend_setup_ulp
+#define elf_backend_setup_ulp NULL
+#endif
+
#ifndef elf_backend_compact_eh_encoding
#define elf_backend_compact_eh_encoding NULL
#endif
@@ -904,6 +912,8 @@ static const struct elf_backend_data elfNN_bed =
elf_backend_maybe_function_sym,
elf_backend_get_reloc_section,
elf_backend_copy_special_section_fields,
+ elf_backend_is_ulp_enabled,
+ elf_backend_setup_ulp,
elf_backend_link_order_error_handler,
elf_backend_relplt_name,
ELF_MACHINE_ALT1,
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index 62d516aab8d..c0fb718d85c 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -31,6 +31,8 @@
#define ELF64_DYNAMIC_INTERPRETER "/lib/ld64.so.1"
#define ELFX32_DYNAMIC_INTERPRETER "/lib/ldx32.so.1"
+#define ULP_ENTRY_LEN 16
+
bool
_bfd_x86_elf_mkobject (bfd *abfd)
{
@@ -984,6 +986,64 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
return valid_p;
}
+/* Check if input bfds are ulp-enabled by containing .ulp.track section */
+
+bool
+_bfd_x86_elf_is_ulp_enabled (struct bfd *input_bfd)
+{
+ while (input_bfd != NULL)
+ for (; input_bfd != NULL; input_bfd = input_bfd->link.next)
+ {
+ if (input_bfd->section_count == 0) continue;
+ if (bfd_get_section_by_name (input_bfd, ".ulp.track")) return true;
+ }
+ return false;
+}
+
+/* To be used by elf_link_hash_traverse when computing the ulp length */
+
+static bool
+bfd_x86_elf_link_compute_ulp (struct elf_link_hash_entry *h, void *data)
+{
+ unsigned long *ulp_length = (unsigned long *) data;
+
+ if (h->dynindx != -1 && h->type == STT_FUNC && !h->def_dynamic)
+ {
+ ++(*ulp_length);
+ }
+ return true;
+}
+
+/* Fill the user-space live patching section */
+
+bool
+_bfd_x86_elf_setup_ulp (struct bfd_link_info *info)
+{
+ struct elf_x86_link_hash_table *htab;
+ asection *ulp;
+ unsigned int ulp_length = 0;
+
+ htab = elf_x86_hash_table (info, X86_64_ELF_DATA);
+
+ elf_link_hash_traverse (elf_hash_table (info),
+ bfd_x86_elf_link_compute_ulp,
+ &ulp_length);
+
+ ulp = htab->ulp;
+
+ ulp->size = ulp_length * ULP_ENTRY_LEN;
+
+ ulp->contents = (bfd_byte *) bfd_malloc (ulp->size);
+ if (ulp->contents == NULL)
+ return false;
+
+ if (!ulp->contents)
+ return false;
+
+ memset(ulp->contents, 0x00, ulp->size);
+ return true;
+}
+
/* Set the sizes of the dynamic sections. */
bool
@@ -3030,7 +3090,26 @@ _bfd_x86_elf_link_setup_gnu_properties
htab->plt_second = sec;
}
- }
+
+ /* create sections to support user-space live patching */
+ if (_bfd_x86_elf_is_ulp_enabled(info->input_bfds))
+ {
+ flagword flags = (bed->dynamic_sec_flags
+ | SEC_ALLOC
+ | SEC_CODE
+ | SEC_LOAD
+ | SEC_READONLY);
+
+ sec = bfd_make_section_anyway_with_flags (dynobj, ".ulp", flags);
+ if (sec == NULL)
+ info->callbacks->einfo (_("%F%P: failed to create ULP
section\n"));
+
+ if (!bfd_set_section_alignment (sec, plt_alignment))
+ goto error_alignment;
+
+ htab->ulp = sec;
+ }
+ }
if (!info->no_ld_generated_unwind_info)
{
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
index db11327e96f..89f51382216 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -452,6 +452,7 @@ struct elf_x86_link_hash_table
asection *plt_second_eh_frame;
asection *plt_got;
asection *plt_got_eh_frame;
+ asection *ulp;
/* Parameters describing PLT generation, lazy or non-lazy. */
struct elf_x86_plt_layout plt;
@@ -690,6 +691,12 @@ extern void _bfd_x86_elf_link_report_relative_reloc
(struct bfd_link_info *, asection *, struct elf_link_hash_entry *,
Elf_Internal_Sym *, const char *, const void *);
+extern bool _bfd_x86_elf_is_ulp_enabled
+ (struct bfd *);
+
+extern bool _bfd_x86_elf_setup_ulp
+ (struct bfd_link_info *);
+
#define bfd_elf64_mkobject \
_bfd_x86_elf_mkobject
#define bfd_elf32_mkobject \
@@ -727,3 +734,7 @@ extern void _bfd_x86_elf_link_report_relative_reloc
_bfd_x86_elf_merge_gnu_properties
#define elf_backend_fixup_gnu_properties \
_bfd_x86_elf_link_fixup_gnu_properties
+#define elf_backend_is_ulp_enabled \
+ _bfd_x86_elf_is_ulp_enabled
+#define elf_backend_setup_ulp \
+ _bfd_x86_elf_setup_ulp
++++++ baselibs.conf ++++++
binutils-devel
requires -binutils-<targettype>
obsoletes "binutils-<targettype> < <version>"
++++++ binutils-2.37-branch.diff.gz ++++++
++++ 14150 lines (skipped)
++++++ binutils-bfd_h.patch ++++++
Remove the #error to avoid issues with legacy not dealing with this
Index: bfd/bfd-in.h
===================================================================
--- bfd/bfd-in.h.orig
+++ bfd/bfd-in.h
@@ -23,11 +23,6 @@
#ifndef __BFD_H_SEEN__
#define __BFD_H_SEEN__
-/* PR 14072: Ensure that config.h is included first. */
-#if !defined PACKAGE && !defined PACKAGE_VERSION
-#error config.h must be included before this header
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
++++++ binutils-build-as-needed.diff ++++++
Index: ld/ldmain.c
===================================================================
--- ld/ldmain.c.orig 2017-07-26 10:07:31.862559913 +0200
+++ ld/ldmain.c 2017-07-26 10:07:31.886560303 +0200
@@ -309,6 +309,8 @@ main (int argc, char **argv)
yydebug = 1;
}
#endif
+ if (getenv ("SUSE_ASNEEDED") && atoi(getenv ("SUSE_ASNEEDED")) > 0)
+ input_flags.add_DT_NEEDED_for_regular = true;
config.build_constructors = true;
config.rpath_separator = ':';
++++++ binutils-compat-old-behaviour.diff ++++++
This adjusts some testcases that expect new behaviour:
* that relaxable relocations are generated
* that separate-code is default
- this also implies that default max-page-size is 0x1000, instead of the
old 0x200000, so some testcases need to encode that as well
Index: binutils-2.37/ld/testsuite/ld-elf/linux-x86.exp
===================================================================
--- binutils-2.37.orig/ld/testsuite/ld-elf/linux-x86.exp
+++ binutils-2.37/ld/testsuite/ld-elf/linux-x86.exp
@@ -125,7 +125,7 @@ proc check_pr25749a {testname srcfilea s
}
# Suppress warning for unsupported attribute from older GCC.
- append cflags " -w"
+ append cflags " -w -Wa,-mrelax-relocations=yes"
exec cp $srcdir/$subdir/$srcfilea $srcfilea
exec chmod +w $srcfilea
@@ -246,7 +246,7 @@ proc check_pr25749b {testname srcfilea s
[list \
"Build lib${testname}.so ($dsoldflags)" \
"-shared $dsoldflags tmpdir/pr25749-bin.o" \
- "-fPIC -I../bfd" \
+ "-fPIC -I../bfd -Wa,-mrelax-relocations=yes" \
[list $srcfileb] \
{{readelf {-Wr} pr25749.rd}} \
"lib${testname}.so" \
Index: binutils-2.37/ld/testsuite/ld-i386/report-reloc-1.d
===================================================================
--- binutils-2.37.orig/ld/testsuite/ld-i386/report-reloc-1.d
+++ binutils-2.37/ld/testsuite/ld-i386/report-reloc-1.d
@@ -1,6 +1,6 @@
#source: report-reloc-1.s
#as: --32
-#ld: -pie -melf_i386 -z report-relative-reloc
+#ld: -pie -melf_i386 -z report-relative-reloc -z separate-code
#warning_output: report-reloc-1.l
#readelf: -r --wide
Index: binutils-2.37/ld/testsuite/ld-x86-64/pe-x86-64.exp
===================================================================
--- binutils-2.37.orig/ld/testsuite/ld-x86-64/pe-x86-64.exp
+++ binutils-2.37/ld/testsuite/ld-x86-64/pe-x86-64.exp
@@ -27,7 +27,7 @@ if {![istarget "x86_64-*-linux*"] } {
run_ld_link_tests [list \
[list \
"Build pe-x86-64-1" \
- "-m elf_x86_64 --entry=begin" \
+ "-m elf_x86_64 --entry=begin -z separate-code -z max-page-size=4096" \
"" \
"" \
{pe-x86-64-1a.obj.bz2 pe-x86-64-1b.obj.bz2 pe-x86-64-1c.obj.bz2} \
@@ -36,7 +36,7 @@ run_ld_link_tests [list \
] \
[list \
"Build pe-x86-64-2" \
- "-m elf_x86_64 --entry=begin" \
+ "-m elf_x86_64 --entry=begin -z separate-code -z max-page-size=4096" \
"" \
"" \
{pe-x86-64-2a.obj.bz2 pe-x86-64-2b.obj.bz2 pe-x86-64-2c.obj.bz2} \
@@ -45,7 +45,7 @@ run_ld_link_tests [list \
] \
[list \
"Build pe-x86-64-3" \
- "-m elf_x86_64 --entry=begin" \
+ "-m elf_x86_64 --entry=begin -z separate-code -z max-page-size=4096" \
"" \
"" \
{pe-x86-64-3a.obj.bz2 pe-x86-64-3b.obj.bz2 pe-x86-64-3c.obj.bz2 \
@@ -55,7 +55,7 @@ run_ld_link_tests [list \
] \
[list \
"Build pe-x86-64-4" \
- "-m elf_x86_64 --entry=begin" \
+ "-m elf_x86_64 --entry=begin -z separate-code -z max-page-size=4096" \
"" \
"" \
{pe-x86-64-4a.obj.bz2 pe-x86-64-4b.obj.bz2 pe-x86-64-4c.obj.bz2 \
@@ -65,7 +65,7 @@ run_ld_link_tests [list \
] \
[list \
"Build pe-x86-64-5" \
- "-m elf_x86_64 --entry=begin" \
+ "-m elf_x86_64 --entry=begin -z separate-code -z max-page-size=4096" \
"" \
"" \
{pe-x86-64-5.obj.bz2 } \
@@ -75,7 +75,7 @@ run_ld_link_tests [list \
] \
[list \
"Build pe-x86-64-6" \
- "-m elf_x86_64 --entry=main" \
+ "-m elf_x86_64 --entry=main -z separate-code -z max-page-size=4096" \
"" \
"" \
{pe-x86-64-6.obj.bz2 } \
Index: binutils-2.37/ld/testsuite/ld-x86-64/report-reloc-1-x32.d
===================================================================
--- binutils-2.37.orig/ld/testsuite/ld-x86-64/report-reloc-1-x32.d
+++ binutils-2.37/ld/testsuite/ld-x86-64/report-reloc-1-x32.d
@@ -1,6 +1,6 @@
#source: report-reloc-1.s
#as: --x32
-#ld: -pie -melf32_x86_64 -z report-relative-reloc
+#ld: -pie -melf32_x86_64 -z report-relative-reloc -z separate-code -z
max-page-size=4096
#warning_output: report-reloc-1.l
#readelf: -r --wide
Index: binutils-2.37/ld/testsuite/ld-x86-64/report-reloc-1.d
===================================================================
--- binutils-2.37.orig/ld/testsuite/ld-x86-64/report-reloc-1.d
+++ binutils-2.37/ld/testsuite/ld-x86-64/report-reloc-1.d
@@ -1,6 +1,6 @@
#source: report-reloc-1.s
#as: --64
-#ld: -pie -melf_x86_64 -z report-relative-reloc
+#ld: -pie -melf_x86_64 -z report-relative-reloc -z separate-code -z
max-page-size=4096
#warning_output: report-reloc-1.l
#readelf: -r --wide
Index: binutils-2.37/ld/testsuite/ld-x86-64/pr19609-4e.d
===================================================================
--- binutils-2.37.orig/ld/testsuite/ld-x86-64/pr19609-4e.d
+++ binutils-2.37/ld/testsuite/ld-x86-64/pr19609-4e.d
@@ -1,6 +1,6 @@
#source: pr19609-4.s
#as: --64 -mrelax-relocations=yes
-#ld: -melf_x86_64 -Ttext=0x70000000 -Tdata=0xa0000000 --no-relax
+#ld: -melf_x86_64 -Ttext=0x70000000 -Tdata=0xa0000000 --no-relax -z
separate-code -z max-page-size=4096
#objdump: -dw
.*: +file format .*
Index: binutils-2.37/ld/testsuite/ld-x86-64/pr19609-6a.d
===================================================================
--- binutils-2.37.orig/ld/testsuite/ld-x86-64/pr19609-6a.d
+++ binutils-2.37/ld/testsuite/ld-x86-64/pr19609-6a.d
@@ -1,6 +1,6 @@
#source: pr19609-6.s
#as: --64 -mrelax-relocations=yes
-#ld: -melf_x86_64 --defsym foobar=0x80000000
+#ld: -melf_x86_64 --defsym foobar=0x80000000 -z separate-code -z
max-page-size=4096
#objdump: -dw
.*: +file format .*
Index: binutils-2.37/ld/testsuite/ld-x86-64/pr19609-6b.d
===================================================================
--- binutils-2.37.orig/ld/testsuite/ld-x86-64/pr19609-6b.d
+++ binutils-2.37/ld/testsuite/ld-x86-64/pr19609-6b.d
@@ -1,6 +1,6 @@
#source: pr19609-6.s
#as: --64 -mrelax-relocations=yes
-#ld: -melf_x86_64 --defsym foobar=0x80000000 --no-relax
+#ld: -melf_x86_64 --defsym foobar=0x80000000 --no-relax -z separate-code -z
max-page-size=4096
#objdump: -dw
.*: +file format .*
Index: binutils-2.37/ld/testsuite/ld-x86-64/pr19609-7b.d
===================================================================
--- binutils-2.37.orig/ld/testsuite/ld-x86-64/pr19609-7b.d
+++ binutils-2.37/ld/testsuite/ld-x86-64/pr19609-7b.d
@@ -1,6 +1,6 @@
#source: pr19609-7.s
#as: --64 -mrelax-relocations=yes
-#ld: -melf_x86_64 -Ttext=0x80000000 --no-relax
+#ld: -melf_x86_64 -Ttext=0x80000000 --no-relax -z separate-code -z
max-page-size=4096
#objdump: -dw
.*: +file format .*
Index: binutils-2.37/ld/testsuite/ld-x86-64/pr19609-7d.d
===================================================================
--- binutils-2.37.orig/ld/testsuite/ld-x86-64/pr19609-7d.d
+++ binutils-2.37/ld/testsuite/ld-x86-64/pr19609-7d.d
@@ -1,6 +1,6 @@
#source: pr19609-7.s
#as: --x32 -mrelax-relocations=yes
-#ld: -melf32_x86_64 -Ttext=0x80000000 --no-relax
+#ld: -melf32_x86_64 -Ttext=0x80000000 --no-relax -z separate-code -z
max-page-size=4096
#objdump: -dw
.*: +file format .*
++++++ binutils-fix-abierrormsg.diff ++++++
This fixes an error message given too eagerly on ppc64le,
when no input files are used and as-needed is in effect. E.g.:
% ld-new --as-needed -o /dev/null -lc
gives an error message about input and output ABI versions being
incompatible. This is because the ABI setting of "unknown" (0)
to "from-input" is done in ppc64_elf_before_check_relocs, which
isn't called for as-needed libraries (via check_directives callback).
merge_private_bfd_data is called for as-needed and not-as-needed inputs
(via notice_as_needed), so copy that code there.
This construct is used in some packages to check for availability
of libraries (e.g. in nvme-cli to check for -luuid). Redircting error
output makes this siletently fail.
Index: binutils-2.35/bfd/elf64-ppc.c
===================================================================
--- binutils-2.35.orig/bfd/elf64-ppc.c 2020-07-24 11:12:19.000000000 +0200
+++ binutils-2.35/bfd/elf64-ppc.c 2020-08-10 17:25:00.205219071 +0200
@@ -5310,11 +5310,17 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, struct
bfd_link_info *info)
if (iflags & ~EF_PPC64_ABI)
{
- _bfd_error_handler
- /* xgettext:c-format */
- (_("%pB uses unknown e_flags 0x%lx"), ibfd, iflags);
- bfd_set_error (bfd_error_bad_value);
- return false;
+ if (abiversion (info->output_bfd) == 0)
+ set_abiversion (info->output_bfd, abiversion (ibfd));
+ else
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB: ABI version %ld is not compatible with ABI version %ld
output"),
+ ibfd, iflags, oflags);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
}
else if (iflags != oflags && iflags != 0)
{
++++++ binutils-fix-invalid-op-errata.diff ++++++
Also reported as PR25210. There's a problem when using the two
linker options '--fix-cortex-a53-835769 --fix-cortex-a53-843419'
together. This is the default in our distro, but not upstream so
it went unnoticed.
Leads to an error while linking any code that sports one of the
sequences that triggers the errata fixup (gcc being one of those),
namely:
ld: can not size stub section: invalid operation
ld: warning: cannot find entry symbol _start; defaulting to 0000000000400078
ld: linker stubs: file class ELFCLASSNONE incompatible with ELFCLASS64
ld: final link failed: file in wrong format
--- bfd/elfnn-aarch64.c.mm 2019-09-09 13:19:43.000000000 +0000
+++ bfd/elfnn-aarch64.c 2019-11-20 11:44:00.000000000 +0000
@@ -4312,7 +4312,8 @@ elfNN_aarch64_size_stubs (bfd *output_bfd,
|| (input_bfd->flags & BFD_LINKER_CREATED) != 0)
continue;
- if (!_bfd_aarch64_erratum_835769_scan (input_bfd, info,
+ if (input_bfd != stub_bfd
+ && !_bfd_aarch64_erratum_835769_scan (input_bfd, info,
&num_erratum_835769_fixes))
return false;
}
++++++ binutils-fix-relax.diff ++++++
Fix for bsc#1179341
the movload->movconst relaxation can be done only with REX
rewriting, and hence needs a GOTPCRELX relocation. With old object
files we might still see GOTPCREL relocs, even with REX bytes available.
We still can't do such rewriting and hence need to stay with the old
rewriting into a lea.
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 549a8be6a6..b89b0023db 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1731,7 +1731,7 @@ elf_x86_64_convert_load_reloc (bfd *abfd,
if (opcode == 0x8b)
{
- if (abs_symbol && local_ref && relocx)
+ if (abs_symbol && local_ref && relocx && rex)
to_reloc_pc32 = false;
if (to_reloc_pc32)
++++++ binutils-pr22868.diff ++++++
Fixes two testsuite fails in the gold plugin tests of LLVM.
Aka binutils/PR22868
Index: binutils-2.30/gold/resolve.cc
===================================================================
--- binutils-2.30.orig/gold/resolve.cc 2018-01-13 14:31:16.000000000 +0100
+++ binutils-2.30/gold/resolve.cc 2018-03-06 16:58:42.000000000 +0100
@@ -265,10 +265,13 @@ Symbol_table::resolve(Sized_symbol<size>
return;
// Likewise for an absolute symbol defined twice with the same value.
+ // plugin-symbols are always absolute with same value here, so ignore those
if (!is_ordinary
&& st_shndx == elfcpp::SHN_ABS
&& !to_is_ordinary
&& to_shndx == elfcpp::SHN_ABS
+ && object->pluginobj() == NULL
+ && to->object()->pluginobj() == NULL
&& to->value() == sym.get_st_value())
return;
++++++ binutils-revert-hlasm-insns.diff ++++++
This reverts commit b10b530a4566, because generating 'jgnop'
from 'bcrl' confuses some parsing tools (in particular kernels
recordmcount.pl tool) on s390x.
Due to the way the assembler and disassembler are implemented we need
to disable both, the assembly and disassembly of the problematic
mnemonic (that's only a problem for jgnop vs brcl, but still).
So, just revert the whole commit.
(We leave out the patch to ChangeLog in the reversion)
diff --git a/gas/testsuite/gas/s390/esa-g5.d b/gas/testsuite/gas/s390/esa-g5.d
index 67a971bef15..949ef141c1a 100644
--- a/gas/testsuite/gas/s390/esa-g5.d
+++ b/gas/testsuite/gas/s390/esa-g5.d
@@ -78,14 +78,10 @@ Disassembly of section .text:
.*: 07 29 [ ]*bhr %r9
.*: 07 f9 [ ]*br %r9
.*: a7 95 00 00 [ ]*bras %r9,e2 <foo\+0xe2>
-.*: a7 65 00 00 [ ]*bras %r6,e6 <foo\+0xe6>
-.*: a7 64 00 00 [ ]*jlh ea <foo\+0xea>
-.*: a7 66 00 00 [ ]*brct %r6,ee <foo\+0xee>
-.*: a7 66 00 00 [ ]*brct %r6,f2 <foo\+0xf2>
-.*: 84 69 00 00 [ ]*brxh %r6,%r9,f6 <foo\+0xf6>
-.*: 84 69 00 00 [ ]*brxh %r6,%r9,fa <foo\+0xfa>
-.*: 85 69 00 00 [ ]*brxle %r6,%r9,fe <foo\+0xfe>
-.*: 85 69 00 00 [ ]*brxle %r6,%r9,102 <foo\+0x102>
+.*: a7 64 00 00 [ ]*jlh e6 <foo\+0xe6>
+.*: a7 66 00 00 [ ]*brct %r6,ea <foo\+0xea>
+.*: 84 69 00 00 [ ]*brxh %r6,%r9,ee <foo\+0xee>
+.*: 85 69 00 00 [ ]*brxle %r6,%r9,f2 <foo\+0xf2>
.*: b2 5a 00 69 [ ]*bsa %r6,%r9
.*: b2 58 00 69 [ ]*bsg %r6,%r9
.*: 0b 69 [ ]*bsm %r6,%r9
@@ -184,49 +180,27 @@ Disassembly of section .text:
.*: b2 21 00 69 [ ]*ipte %r6,%r9
.*: b2 29 00 69 [ ]*iske %r6,%r9
.*: b2 23 00 69 [ ]*ivsk %r6,%r9
-.*: a7 f4 00 00 [ ]*j 288 <foo\+0x288>
-.*: a7 84 00 00 [ ]*je 28c <foo\+0x28c>
-.*: a7 24 00 00 [ ]*jh 290 <foo\+0x290>
-.*: a7 a4 00 00 [ ]*jhe 294 <foo\+0x294>
-.*: a7 44 00 00 [ ]*jl 298 <foo\+0x298>
-.*: a7 c4 00 00 [ ]*jle 29c <foo\+0x29c>
-.*: a7 64 00 00 [ ]*jlh 2a0 <foo\+0x2a0>
-.*: a7 44 00 00 [ ]*jl 2a4 <foo\+0x2a4>
-.*: a7 74 00 00 [ ]*jne 2a8 <foo\+0x2a8>
-.*: a7 d4 00 00 [ ]*jnh 2ac <foo\+0x2ac>
-.*: a7 54 00 00 [ ]*jnhe 2b0 <foo\+0x2b0>
-.*: a7 b4 00 00 [ ]*jnl 2b4 <foo\+0x2b4>
-.*: a7 34 00 00 [ ]*jnle 2b8 <foo\+0x2b8>
-.*: a7 94 00 00 [ ]*jnlh 2bc <foo\+0x2bc>
-.*: a7 b4 00 00 [ ]*jnl 2c0 <foo\+0x2c0>
-.*: a7 e4 00 00 [ ]*jno 2c4 <foo\+0x2c4>
-.*: a7 d4 00 00 [ ]*jnh 2c8 <foo\+0x2c8>
-.*: a7 74 00 00 [ ]*jne 2cc <foo\+0x2cc>
-.*: a7 14 00 00 [ ]*jo 2d0 <foo\+0x2d0>
-.*: a7 24 00 00 [ ]*jh 2d4 <foo\+0x2d4>
-.*: a7 84 00 00 [ ]*je 2d8 <foo\+0x2d8>
-.*: a7 04 00 00 [ ]*jnop 2dc <foo\+0x2dc>
-.*: a7 14 00 00 [ ]*jo 2e0 <foo\+0x2e0>
-.*: a7 24 00 00 [ ]*jh 2e4 <foo\+0x2e4>
-.*: a7 24 00 00 [ ]*jh 2e8 <foo\+0x2e8>
-.*: a7 34 00 00 [ ]*jnle 2ec <foo\+0x2ec>
-.*: a7 44 00 00 [ ]*jl 2f0 <foo\+0x2f0>
-.*: a7 44 00 00 [ ]*jl 2f4 <foo\+0x2f4>
-.*: a7 54 00 00 [ ]*jnhe 2f8 <foo\+0x2f8>
-.*: a7 64 00 00 [ ]*jlh 2fc <foo\+0x2fc>
-.*: a7 74 00 00 [ ]*jne 300 <foo\+0x300>
-.*: a7 74 00 00 [ ]*jne 304 <foo\+0x304>
-.*: a7 84 00 00 [ ]*je 308 <foo\+0x308>
-.*: a7 84 00 00 [ ]*je 30c <foo\+0x30c>
-.*: a7 94 00 00 [ ]*jnlh 310 <foo\+0x310>
-.*: a7 a4 00 00 [ ]*jhe 314 <foo\+0x314>
-.*: a7 b4 00 00 [ ]*jnl 318 <foo\+0x318>
-.*: a7 b4 00 00 [ ]*jnl 31c <foo\+0x31c>
-.*: a7 c4 00 00 [ ]*jle 320 <foo\+0x320>
-.*: a7 d4 00 00 [ ]*jnh 324 <foo\+0x324>
-.*: a7 d4 00 00 [ ]*jnh 328 <foo\+0x328>
-.*: a7 e4 00 00 [ ]*jno 32c <foo\+0x32c>
-.*: a7 f4 00 00 [ ]*j 330 <foo\+0x330>
+.*: a7 f4 00 00 [ ]*j 278 <foo\+0x278>
+.*: a7 84 00 00 [ ]*je 27c <foo\+0x27c>
+.*: a7 24 00 00 [ ]*jh 280 <foo\+0x280>
+.*: a7 a4 00 00 [ ]*jhe 284 <foo\+0x284>
+.*: a7 44 00 00 [ ]*jl 288 <foo\+0x288>
+.*: a7 c4 00 00 [ ]*jle 28c <foo\+0x28c>
+.*: a7 64 00 00 [ ]*jlh 290 <foo\+0x290>
+.*: a7 44 00 00 [ ]*jl 294 <foo\+0x294>
+.*: a7 74 00 00 [ ]*jne 298 <foo\+0x298>
+.*: a7 d4 00 00 [ ]*jnh 29c <foo\+0x29c>
+.*: a7 54 00 00 [ ]*jnhe 2a0 <foo\+0x2a0>
+.*: a7 b4 00 00 [ ]*jnl 2a4 <foo\+0x2a4>
+.*: a7 34 00 00 [ ]*jnle 2a8 <foo\+0x2a8>
+.*: a7 94 00 00 [ ]*jnlh 2ac <foo\+0x2ac>
+.*: a7 b4 00 00 [ ]*jnl 2b0 <foo\+0x2b0>
+.*: a7 e4 00 00 [ ]*jno 2b4 <foo\+0x2b4>
+.*: a7 d4 00 00 [ ]*jnh 2b8 <foo\+0x2b8>
+.*: a7 74 00 00 [ ]*jne 2bc <foo\+0x2bc>
+.*: a7 14 00 00 [ ]*jo 2c0 <foo\+0x2c0>
+.*: a7 24 00 00 [ ]*jh 2c4 <foo\+0x2c4>
+.*: a7 84 00 00 [ ]*je 2c8 <foo\+0x2c8>
.*: ed 65 af ff 00 18 [ ]*kdb %f6,4095\(%r5,%r10\)
.*: b3 18 00 69 [ ]*kdbr %f6,%f9
.*: ed 65 af ff 00 08 [ ]*keb %f6,4095\(%r5,%r10\)
@@ -509,4 +483,4 @@ Disassembly of section .text:
.*: f8 58 5f ff af ff [ ]*zap 4095\(6,%r5\),4095\(9,%r10\)
.*: b2 21 b0 69 [ ]*ipte %r6,%r9,%r11
.*: b2 21 bd 69 [ ]*ipte %r6,%r9,%r11,13
-.*: 07 07 [ ]*nopr %r7
+.*: 07 07 [ ]*nopr %r7
diff --git a/gas/testsuite/gas/s390/esa-g5.s b/gas/testsuite/gas/s390/esa-g5.s
index ee3d6319b19..c417b818add 100644
--- a/gas/testsuite/gas/s390/esa-g5.s
+++ b/gas/testsuite/gas/s390/esa-g5.s
@@ -72,14 +72,10 @@ foo:
bpr %r9
br %r9
bras %r9,.
- jas %r6,.
brc 6,.
brct 6,.
- jct %r6,.
brxh %r6,%r9,.
- jxh %r6,%r9,.
brxle %r6,%r9,.
- jxle %r6,%r9,.
bsa %r6,%r9
bsg %r6,%r9
bsm %r6,%r9
@@ -199,28 +195,6 @@ foo:
jo .
jp .
jz .
- jnop .
- bro .
- brh .
- brp .
- brnle .
- brl .
- brm .
- brnhe .
- brlh .
- brne .
- brnz .
- bre .
- brz .
- brnlh .
- brhe .
- brnl .
- brnm .
- brle .
- brnh .
- brnp .
- brno .
- bru .
kdb %f6,4095(%r5,%r10)
kdbr %f6,%f9
keb %f6,4095(%r5,%r10)
diff --git a/gas/testsuite/gas/s390/esa-z900.d
b/gas/testsuite/gas/s390/esa-z900.d
index 42f408b624f..f6ff0812d89 100644
--- a/gas/testsuite/gas/s390/esa-z900.d
+++ b/gas/testsuite/gas/s390/esa-z900.d
@@ -6,52 +6,29 @@
Disassembly of section .text:
.* <foo>:
-.*: c0 f4 00 00 00 00 [ ]*jg 0 <foo>
-.*: c0 04 00 00 00 00 [ ]*jgnop 6 <foo\+0x6>
-.*: c0 14 00 00 00 00 [ ]*jgo c <foo\+0xc>
-.*: c0 24 00 00 00 00 [ ]*jgh 12 <foo\+0x12>
-.*: c0 24 00 00 00 00 [ ]*jgh 18 <foo\+0x18>
-.*: c0 34 00 00 00 00 [ ]*jgnle 1e <foo\+0x1e>
-.*: c0 44 00 00 00 00 [ ]*jgl 24 <foo\+0x24>
-.*: c0 44 00 00 00 00 [ ]*jgl 2a <foo\+0x2a>
-.*: c0 54 00 00 00 00 [ ]*jgnhe 30 <foo\+0x30>
-.*: c0 64 00 00 00 00 [ ]*jglh 36 <foo\+0x36>
-.*: c0 74 00 00 00 00 [ ]*jgne 3c <foo\+0x3c>
-.*: c0 74 00 00 00 00 [ ]*jgne 42 <foo\+0x42>
-.*: c0 84 00 00 00 00 [ ]*jge 48 <foo\+0x48>
-.*: c0 84 00 00 00 00 [ ]*jge 4e <foo\+0x4e>
-.*: c0 94 00 00 00 00 [ ]*jgnlh 54 <foo\+0x54>
-.*: c0 a4 00 00 00 00 [ ]*jghe 5a <foo\+0x5a>
-.*: c0 b4 00 00 00 00 [ ]*jgnl 60 <foo\+0x60>
-.*: c0 b4 00 00 00 00 [ ]*jgnl 66 <foo\+0x66>
-.*: c0 c4 00 00 00 00 [ ]*jgle 6c <foo\+0x6c>
-.*: c0 d4 00 00 00 00 [ ]*jgnh 72 <foo\+0x72>
-.*: c0 d4 00 00 00 00 [ ]*jgnh 78 <foo\+0x78>
-.*: c0 e4 00 00 00 00 [ ]*jgno 7e <foo\+0x7e>
-.*: c0 f4 00 00 00 00 [ ]*jg 84 <foo\+0x84>
-.*: c0 14 00 00 00 00 [ ]*jgo 8a <foo\+0x8a>
-.*: c0 24 00 00 00 00 [ ]*jgh 90 <foo\+0x90>
-.*: c0 24 00 00 00 00 [ ]*jgh 96 <foo\+0x96>
-.*: c0 34 00 00 00 00 [ ]*jgnle 9c <foo\+0x9c>
-.*: c0 44 00 00 00 00 [ ]*jgl a2 <foo\+0xa2>
-.*: c0 44 00 00 00 00 [ ]*jgl a8 <foo\+0xa8>
-.*: c0 54 00 00 00 00 [ ]*jgnhe ae <foo\+0xae>
-.*: c0 64 00 00 00 00 [ ]*jglh b4 <foo\+0xb4>
-.*: c0 74 00 00 00 00 [ ]*jgne ba <foo\+0xba>
-.*: c0 74 00 00 00 00 [ ]*jgne c0 <foo\+0xc0>
-.*: c0 84 00 00 00 00 [ ]*jge c6 <foo\+0xc6>
-.*: c0 84 00 00 00 00 [ ]*jge cc <foo\+0xcc>
-.*: c0 94 00 00 00 00 [ ]*jgnlh d2 <foo\+0xd2>
-.*: c0 a4 00 00 00 00 [ ]*jghe d8 <foo\+0xd8>
-.*: c0 b4 00 00 00 00 [ ]*jgnl de <foo\+0xde>
-.*: c0 b4 00 00 00 00 [ ]*jgnl e4 <foo\+0xe4>
-.*: c0 c4 00 00 00 00 [ ]*jgle ea <foo\+0xea>
-.*: c0 d4 00 00 00 00 [ ]*jgnh f0 <foo\+0xf0>
-.*: c0 d4 00 00 00 00 [ ]*jgnh f6 <foo\+0xf6>
-.*: c0 e4 00 00 00 00 [ ]*jgno fc <foo\+0xfc>
-.*: c0 f4 00 00 00 00 [ ]*jg 102 <foo\+0x102>
-.*: c0 65 00 00 00 00 [ ]*brasl %r6,108 <foo\+0x108>
-.*: c0 65 00 00 00 00 [ ]*brasl %r6,10e <foo\+0x10e>
+.*: c0 f4 00 00 00 00 [ ]*jg 0 \<foo\>
+.*: c0 14 00 00 00 00 [ ]*jgo 6 \<foo\+0x6>
+.*: c0 24 00 00 00 00 [ ]*jgh c \<foo\+0xc>
+.*: c0 24 00 00 00 00 [ ]*jgh 12 \<foo\+0x12>
+.*: c0 34 00 00 00 00 [ ]*jgnle 18 \<foo\+0x18>
+.*: c0 44 00 00 00 00 [ ]*jgl 1e \<foo\+0x1e>
+.*: c0 44 00 00 00 00 [ ]*jgl 24 \<foo\+0x24>
+.*: c0 54 00 00 00 00 [ ]*jgnhe 2a \<foo\+0x2a>
+.*: c0 64 00 00 00 00 [ ]*jglh 30 \<foo\+0x30>
+.*: c0 74 00 00 00 00 [ ]*jgne 36 \<foo\+0x36>
+.*: c0 74 00 00 00 00 [ ]*jgne 3c \<foo\+0x3c>
+.*: c0 84 00 00 00 00 [ ]*jge 42 \<foo\+0x42>
+.*: c0 84 00 00 00 00 [ ]*jge 48 \<foo\+0x48>
+.*: c0 94 00 00 00 00 [ ]*jgnlh 4e \<foo\+0x4e>
+.*: c0 a4 00 00 00 00 [ ]*jghe 54 \<foo\+0x54>
+.*: c0 b4 00 00 00 00 [ ]*jgnl 5a \<foo\+0x5a>
+.*: c0 b4 00 00 00 00 [ ]*jgnl 60 \<foo\+0x60>
+.*: c0 c4 00 00 00 00 [ ]*jgle 66 \<foo\+0x66>
+.*: c0 d4 00 00 00 00 [ ]*jgnh 6c \<foo\+0x6c>
+.*: c0 d4 00 00 00 00 [ ]*jgnh 72 \<foo\+0x72>
+.*: c0 e4 00 00 00 00 [ ]*jgno 78 \<foo\+0x78>
+.*: c0 f4 00 00 00 00 [ ]*jg 7e \<foo\+0x7e>
+.*: c0 65 00 00 00 00 [ ]*brasl %r6,84 \<foo\+0x84>
.*: 01 0b [ ]*tam
.*: 01 0c [ ]*sam24
.*: 01 0d [ ]*sam31
@@ -62,7 +39,7 @@ Disassembly of section .text:
.*: b9 97 00 69 [ ]*dlr %r6,%r9
.*: b9 98 00 69 [ ]*alcr %r6,%r9
.*: b9 99 00 69 [ ]*slbr %r6,%r9
-.*: c0 60 00 00 00 00 [ ]*larl %r6,136 <foo\+0x136>
+.*: c0 60 00 00 00 00 [ ]*larl %r6,ac \<foo\+0xac\>
.*: e3 65 af ff 00 1e [ ]*lrv %r6,4095\(%r5,%r10\)
.*: e3 65 af ff 00 1f [ ]*lrvh %r6,4095\(%r5,%r10\)
.*: e3 65 af ff 00 3e [ ]*strv %r6,4095\(%r5,%r10\)
@@ -72,4 +49,3 @@ Disassembly of section .text:
.*: e3 65 af ff 00 98 [ ]*alc %r6,4095\(%r5,%r10\)
.*: e3 65 af ff 00 99 [ ]*slb %r6,4095\(%r5,%r10\)
.*: eb 69 5f ff 00 1d [ ]*rll %r6,%r9,4095\(%r5\)
-.*: 07 07 [ ]*nopr %r7
diff --git a/gas/testsuite/gas/s390/esa-z900.s
b/gas/testsuite/gas/s390/esa-z900.s
index 7a006168f9e..815732df37c 100644
--- a/gas/testsuite/gas/s390/esa-z900.s
+++ b/gas/testsuite/gas/s390/esa-z900.s
@@ -1,7 +1,6 @@
.text
foo:
brcl 15,.
- jgnop .
jgo .
jgh .
jgp .
@@ -23,29 +22,7 @@ foo:
jgnp .
jgno .
jg .
- brol .
- brhl .
- brpl .
- brnlel .
- brll .
- brml .
- brnhel .
- brlhl .
- brnel .
- brnzl .
- brel .
- brzl .
- brnlhl .
- brhel .
- brnll .
- brnml .
- brlel .
- brnhl .
- brnpl .
- brnol .
- brul .
brasl %r6,.
- jasl %r6,.
tam
sam24
sam31
diff --git a/gas/testsuite/gas/s390/zarch-z900.d
b/gas/testsuite/gas/s390/zarch-z900.d
index 8d292dfc11b..8491a8f4e7a 100644
--- a/gas/testsuite/gas/s390/zarch-z900.d
+++ b/gas/testsuite/gas/s390/zarch-z900.d
@@ -20,11 +20,8 @@ Disassembly of section .text:
.*: e3 95 af ff 00 46 [ ]*bctg %r9,4095\(%r5,%r10\)
.*: b9 46 00 96 [ ]*bctgr %r9,%r6
.*: a7 97 00 00 [ ]*brctg %r9,40 \<foo\+0x40\>
-.*: a7 67 00 00 [ ]*brctg %r6,44 <foo\+0x44>
-.*: ec 96 00 00 00 44 [ ]*brxhg %r9,%r6,48 <foo\+0x48>
-.*: ec 69 00 00 00 44 [ ]*brxhg %r6,%r9,4e <foo\+0x4e>
-.*: ec 96 00 00 00 45 [ ]*brxlg %r9,%r6,54 <foo\+0x54>
-.*: ec 69 00 00 00 45 [ ]*brxlg %r6,%r9,5a <foo\+0x5a>
+.*: ec 96 00 00 00 44 [ ]*brxhg %r9,%r6,44 <foo\+0x44>
+.*: ec 96 00 00 00 45 [ ]*brxlg %r9,%r6,4a <foo\+0x4a>
.*: eb 96 5f ff 00 44 [ ]*bxhg %r9,%r6,4095\(%r5\)
.*: eb 96 5f ff 00 45 [ ]*bxleg %r9,%r6,4095\(%r5\)
.*: b3 a5 00 96 [ ]*cdgbr %f9,%r6
diff --git a/gas/testsuite/gas/s390/zarch-z900.s
b/gas/testsuite/gas/s390/zarch-z900.s
index 96d27e7b7e2..a175cca2f4f 100644
--- a/gas/testsuite/gas/s390/zarch-z900.s
+++ b/gas/testsuite/gas/s390/zarch-z900.s
@@ -14,11 +14,8 @@ foo:
bctg %r9,4095(%r5,%r10)
bctgr %r9,%r6
brctg %r9,.
- jctg %r6,.
brxhg %r9,%r6,.
- jxhg %r6,%r9,.
brxlg %r9,%r6,.
- jxleg %r6,%r9,.
bxhg %r9,%r6,4095(%r5)
bxleg %r9,%r6,4095(%r5)
cdgbr %f9,%r6
diff --git a/ld/testsuite/ld-s390/tlsbin_64.dd
b/ld/testsuite/ld-s390/tlsbin_64.dd
index d2aa851af46..b984c5719c9 100644
--- a/ld/testsuite/ld-s390/tlsbin_64.dd
+++ b/ld/testsuite/ld-s390/tlsbin_64.dd
@@ -87,26 +87,26 @@ Disassembly of section .text:
+[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\)
# GD -> LE with global variable defined in executable
+[0-9a-f]+: e3 20 d0 10 00 04 lg %r2,16\(%r13\)
- +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ <fn2\+0xca>
+ +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0xca>
+[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\)
# GD -> LE with local variable defined in executable
+[0-9a-f]+: e3 20 d0 18 00 04 lg %r2,24\(%r13\)
- +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ <fn2\+0xda>
+ +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0xda>
+[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\)
# GD -> LE with hidden variable defined in executable
+[0-9a-f]+: e3 20 d0 20 00 04 lg %r2,32\(%r13\)
- +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ <fn2\+0xea>
+ +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0xea>
+[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\)
# LD -> LE
+[0-9a-f]+: e3 20 d0 28 00 04 lg %r2,40\(%r13\)
- +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ <fn2\+0xfa>
+ +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0xfa>
+[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\)
+[0-9a-f]+: e3 40 d0 30 00 04 lg %r4,48\(%r13\)
+[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\)
+[0-9a-f]+: e3 40 d0 38 00 04 lg %r4,56\(%r13\)
+[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\)
+[0-9a-f]+: e3 20 d0 40 00 04 lg %r2,64\(%r13\)
- +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ <fn2\+0x11e>
+ +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0x11e>
+[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\)
+[0-9a-f]+: e3 40 d0 48 00 04 lg %r4,72\(%r13\)
+[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\)
diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt
index d84f9f798a4..33dbeb38249 100644
--- a/opcodes/s390-opc.txt
+++ b/opcodes/s390-opc.txt
@@ -246,14 +246,10 @@ d7 xc SS_L0RDRD "exclusive OR" g5 esa,zarch
f8 zap SS_LLRDRD "zero and add" g5 esa,zarch
a70a ahi RI_RI "add halfword immediate" g5 esa,zarch
84 brxh RSI_RRP "branch relative on index high" g5 esa,zarch
-84 jxh RSI_RRP "branch relative on index high" g5 esa,zarch
85 brxle RSI_RRP "branch relative on index low or equal" g5 esa,zarch
-85 jxle RSI_RRP "branch relative on index low or equal" g5 esa,zarch
a705 bras RI_RP "branch relative and save" g5 esa,zarch
-a705 jas RI_RP "branch relative and save" g5 esa,zarch
a704 brc RI_UP "branch relative on condition" g5 esa,zarch
a706 brct RI_RP "branch relative on count" g5 esa,zarch
-a706 jct RI_RP "branch relative on count" g5 esa,zarch
b241 cksm RRE_RR "checksum" g5 esa,zarch
a70e chi RI_RI "compare halfword immediate" g5 esa,zarch
a9 clcle RS_RRRD "compare logical long extended" g5 esa,zarch
@@ -272,11 +268,8 @@ a701 tml RI_RU "test under mask low" g5 esa,zarch
4700 nop RX_0RRD "no operation" g5 esa,zarch optparm
4700 b*8 RX_0RRD "conditional branch" g5 esa,zarch
47f0 b RX_0RRD "unconditional branch" g5 esa,zarch
-a704 jnop RI_0P "nop jump" g5 esa,zarch
a704 j*8 RI_0P "conditional jump" g5 esa,zarch
-a704 br*8 RI_0P "conditional jump" g5 esa,zarch
a7f4 j RI_0P "unconditional jump" g5 esa,zarch
-a7f4 bru RI_0P "unconditional jump" g5 esa,zarch
b34a axbr RRE_FEFE "add extended bfp" g5 esa,zarch
b31a adbr RRE_FF "add long bfp" g5 esa,zarch
ed000000001a adb RXE_FRRD "add long bfp" g5 esa,zarch
@@ -444,9 +437,7 @@ e3000000001b slgf RXE_RRRD "subtract logical 64<32" z900
zarch
e3000000000c msg RXE_RRRD "multiply single 64" z900 zarch
e3000000001c msgf RXE_RRRD "multiply single 64<32" z900 zarch
ec0000000044 brxhg RIE_RRP "branch relative on index high 64" z900 zarch
-ec0000000044 jxhg RIE_RRP "branch relative on index high 64" z900 zarch
ec0000000045 brxlg RIE_RRP "branch relative on index low or equal 64" z900
zarch
-ec0000000045 jxleg RIE_RRP "branch relative on index low or equal 64" z900
zarch
eb0000000044 bxhg RSE_RRRD "branch on index high 64" z900 zarch
eb0000000045 bxleg RSE_RRRD "branch on index low or equal 64" z900 zarch
eb000000000c srlg RSE_RRRD "shift right single logical 64" z900 zarch
@@ -471,15 +462,10 @@ eb0000000080 icmh RSE_RURD "insert characters under mask
high" z900 zarch
a702 tmhh RI_RU "test under mask high high" z900 zarch
a703 tmhl RI_RU "test under mask high low" z900 zarch
c004 brcl RIL_UP "branch relative on condition long" z900 esa,zarch
-c004 jgnop RIL_0P "nop jump long" z900 esa,zarch
c004 jg*8 RIL_0P "conditional jump long" z900 esa,zarch
-c004 br*8l RIL_0P "conditional jump long" z900 esa,zarch
c0f4 jg RIL_0P "unconditional jump long" z900 esa,zarch
-c0f4 brul RIL_0P "unconditional jump long" z900 esa,zarch
c005 brasl RIL_RP "branch relative and save long" z900 esa,zarch
-c005 jasl RIL_RP "branch relative and save long" z900 esa,zarch
a707 brctg RI_RP "branch relative on count 64" z900 zarch
-a707 jctg RI_RP "branch relative on count 64" z900 zarch
a709 lghi RI_RI "load halfword immediate 64" z900 zarch
a70b aghi RI_RI "add halfword immediate 64" z900 zarch
a70d mghi RI_RI "multiply halfword immediate 64" z900 zarch
++++++ binutils-revert-nm-symversion.diff ++++++
Some packages of ours rely on the output of nm to not contain
symversions. E.g. perf uses 'nm -D' to construct a linker input
file with symbol names. ld errors on the '@' characters. Until
those packages are fixed we use this patch. We have to carry it
for old code streams forever.
Index: binutils-2.37/binutils/nm.c
===================================================================
--- binutils-2.37.orig/binutils/nm.c
+++ binutils-2.37/binutils/nm.c
@@ -183,7 +183,7 @@ static int show_version = 0; /* Show the
static int show_synthetic = 0; /* Display synthesized symbols too. */
static int line_numbers = 0; /* Print line numbers for symbols. */
static int allow_special_symbols = 0; /* Allow special symbols. */
-static int with_symbol_versions = -1; /* Output symbol version information. */
+static int with_symbol_versions = 0; /* Output symbol version information. */
static int quiet = 0; /* Suppress "no symbols" diagnostic. */
/* The characters to use for global and local ifunc symbols. */
Index: binutils-2.37/ld/testsuite/ld-elf/shared.exp
===================================================================
--- binutils-2.37.orig/ld/testsuite/ld-elf/shared.exp
+++ binutils-2.37/ld/testsuite/ld-elf/shared.exp
@@ -938,8 +938,7 @@ run_cc_link_tests [list \
"-fPIC" \
{pr26302b.c} \
{{readelf {-sW} pr26302.rd} \
- {nm {-u} pr26302.nd} \
- {nm {-u -D} pr26302.nd} \
+ {nm {-u --with-symbol-versions} pr26302.nd} \
{nm {-u -D --with-symbol-versions} pr26302.nd}} \
"pr26302b.so" \
] \
Index: binutils-2.37/gas/testsuite/gas/symver/symver0.d
===================================================================
--- binutils-2.37.orig/gas/testsuite/gas/symver/symver0.d
+++ binutils-2.37/gas/testsuite/gas/symver/symver0.d
@@ -1,4 +1,4 @@
-#nm: -n
+#nm: -n --with-symbol-versions
#name: symver symver0
#
# The #... and #pass are there to match extra symbols inserted by
Index: binutils-2.37/gas/testsuite/gas/symver/symver1.d
===================================================================
--- binutils-2.37.orig/gas/testsuite/gas/symver/symver1.d
+++ binutils-2.37/gas/testsuite/gas/symver/symver1.d
@@ -1,4 +1,4 @@
-#nm: -n
+#nm: -n --with-symbol-versions
#name: symver symver1
#
# The #... and #pass are there to match extra symbols inserted by
Index: binutils-2.37/gas/testsuite/gas/symver/symver6.d
===================================================================
--- binutils-2.37.orig/gas/testsuite/gas/symver/symver6.d
+++ binutils-2.37/gas/testsuite/gas/symver/symver6.d
@@ -1,4 +1,4 @@
-#nm: -n
+#nm: -n --with-symbol-versions
#name: symver symver6
#
++++++ binutils-revert-plt32-in-branches.diff ++++++
++++ 620 lines (skipped)
++++++ binutils-skip-rpaths.patch ++++++
diff --git a/ld/emultempl/elf.em b/ld/emultempl/elf.em
index 42c552b36e..dd0a6b1e60 100644
--- a/ld/emultempl/elf.em
+++ b/ld/emultempl/elf.em
@@ -135,6 +135,8 @@ if test x"$LDEMUL_BEFORE_ALLOCATION" !=
xgld"$EMULATION_NAME"_before_allocation;
if test x"${ELF_INTERPRETER_NAME}" = x; then
ELF_INTERPRETER_NAME=NULL
fi
+
+ libpath_nl=`echo ${NATIVE_LIB_DIRS// /\\\n}`
fragment <<EOF
/* This is called after the sections have been attached to output
diff --git a/ld/ldelf.c b/ld/ldelf.c
index 2e27cf48a8..7162d0cf91 100644
--- a/ld/ldelf.c
+++ b/ld/ldelf.c
@@ -1506,6 +1506,31 @@ ldelf_append_to_separated_string (char **to, char
*op_arg)
}
}
+static int
+ldelf_is_contained (const char *path, const char *dc)
+{
+ while (*dc)
+ {
+ const char *pc = path;
+
+ while (*dc && *pc && *dc == *pc && *dc != '\n'
+ && *pc != ':' && *dc != '=')
+ {
+ dc++;
+ pc++;
+ }
+ if ((*pc == 0 || *pc == ':') && (*dc == '\n' || *dc == '=' || *dc == 0))
+ return 1;
+
+ while (*dc && *dc != '\n')
+ dc++;
+ if (*dc == '\n')
+ dc++;
+ }
+
+ return 0;
+}
+
/* This is called after the sections have been attached to output
sections, but before any sizes or addresses have been set. */
@@ -1513,7 +1538,7 @@ void
ldelf_before_allocation (char *audit, char *depaudit,
const char *default_interpreter_name)
{
- const char *rpath;
+ char *rpath;
asection *sinterp;
bfd *abfd;
struct bfd_link_hash_entry *ehdr_start = NULL;
@@ -1608,7 +1633,67 @@ ldelf_before_allocation (char *audit, char *depaudit,
by dynamic linking. */
rpath = command_line.rpath;
if (rpath == NULL)
- rpath = (const char *) getenv ("LD_RUN_PATH");
+ rpath = getenv ("LD_RUN_PATH");
+
+ if (rpath != NULL && getenv ("SUSE_IGNORED_RPATHS"))
+ {
+ char *dirs = 0;
+ FILE *ldso = fopen (getenv ("SUSE_IGNORED_RPATHS"), "r");
+ if (ldso)
+ {
+ off_t endcur = 0;
+ fseek (ldso, 0, SEEK_END);
+ endcur = ftell (ldso);
+ fseek (ldso, 0, SEEK_SET);
+ dirs = xmalloc (endcur + 1);
+ if (fread (dirs, 1, endcur, ldso) != (size_t) endcur)
+ {
+ free (dirs);
+ dirs = NULL;
+ }
+ else
+ dirs[endcur] = '\0';
+ }
+ if (dirs)
+ {
+ char *cr;
+ rpath = xstrdup (rpath);
+ cr = rpath; /* cursor read */
+
+ while (*cr)
+ {
+ if (ldelf_is_contained (cr, dirs)
+ || ldelf_is_contained (cr, "$libpath_nl"))
+ {
+ char *cc = cr, *cw = cr;
+ while (*cc && *cc != ':')
+ cc++;
+ if (*cc == ':')
+ {
+ cc++;
+ for (; *cc; cc++, cw++)
+ *cw = *cc;
+ }
+ else if (cw > rpath)
+ cw[-1] = 0;
+
+ *cw = 0;
+ }
+ else
+ {
+ while (*cr && *cr != ':')
+ cr++;
+ if (*cr == ':')
+ cr++;
+ }
+ }
+ if (*rpath == '\0')
+ {
+ free (rpath);
+ rpath = NULL;
+ }
+ }
+ }
for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
++++++ cross-avr-nesc-as.patch ++++++
Index: gas/config/tc-avr-nesc.h
===================================================================
--- gas/config/tc-avr-nesc.h.orig 2016-02-01 09:58:37.419903606 +0100
+++ gas/config/tc-avr-nesc.h 2016-02-01 09:58:39.631928732 +0100
@@ -143,8 +143,12 @@ extern long md_pcrel_from_section (struc
would print `12 34 56 78'. The default value is 4. */
#define LISTING_WORD_SIZE 2
-/* AVR port uses `$' as a logical line separator. */
-#define LEX_DOLLAR 0
+/* AVR port uses `$' as a logical line separator and doesn't
+ allow it in symbols. We allow it in the middle of symbols.
+ We also hack get_symbol_end to disallow it at the end of a symbol. */
+#define LEX_DOLLAR 1
+#define TC_EOL_IN_INSN(PTR) (*(PTR) == '$' && is_part_of_name((PTR)[-1]) &&
is_part_of_name((PTR)[1]))
+#define TC_FORBID_DOLLAR_AT_END
/* An `.lcomm' directive with no explicit alignment parameter will
use this macro to set P2VAR to the alignment that a request for
Index: gas/expr.c
===================================================================
--- gas/expr.c.orig 2016-02-01 09:58:35.743884569 +0100
+++ gas/expr.c 2016-02-01 09:58:39.631928732 +0100
@@ -2342,6 +2342,15 @@ get_symbol_name (char ** ilp_return)
;
if (is_name_ender (c))
c = *input_line_pointer++;
+#ifdef TC_FORBID_DOLLAR_AT_END
+ /* This is for the Atmel AVR platforms. We want to allow $ in symbols
+ but also as a line separator. Yucky. */
+ if (input_line_pointer[-2] == '$')
+ {
+ input_line_pointer--;
+ c = '$';
+ }
+#endif
}
else if (c == '"')
{
++++++ cross-avr-omit_section_dynsym.patch ++++++
Index: bfd/elf32-avr.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-avr.c,v
retrieving revision 1.27
diff -c -3 -p -r1.27 elf32-avr.c
*** bfd/elf32-avr.c 28 Sep 2006 13:27:33 -0000 1.27
--- bfd/elf32-avr.c 19 Jan 2007 12:22:49 -0000
*************** elf32_avr_build_stubs (struct bfd_link_i
*** 2915,2920 ****
--- 2915,2922 ----
#define elf_backend_final_write_processing \
bfd_elf_avr_final_write_processing
#define elf_backend_object_p elf32_avr_object_p
+ #define elf_backend_omit_section_dynsym \
+ _bfd_elf_omit_section_dynsym_all
#define bfd_elf32_bfd_relax_section elf32_avr_relax_section
#define bfd_elf32_bfd_get_relocated_section_contents \
++++++ cross-avr-size.patch ++++++
diff --git a/binutils/size.c b/binutils/size.c
index 479a464887..971156ccbe 100644
--- a/binutils/size.c
+++ b/binutils/size.c
@@ -51,6 +51,7 @@ enum output_format
{
FORMAT_BERKLEY,
FORMAT_SYSV,
+ FORMAT_AVR,
FORMAT_GNU
};
static enum output_format selected_output_format =
@@ -74,6 +75,246 @@ static bfd_size_type total_textsize;
/* Program exit status. */
static int return_code = 0;
+
+/* AVR Size specific stuff */
+
+#define AVR64 64UL
+#define AVR128 128UL
+#define AVR256 256UL
+#define AVR512 512UL
+#define AVR1K 1024UL
+#define AVR2K 2048UL
+#define AVR4K 4096UL
+#define AVR8K 8192UL
+#define AVR16K 16384UL
+#define AVR20K 20480UL
+#define AVR24K 24576UL
+#define AVR32K 32768UL
+#define AVR36K 36864UL
+#define AVR40K 40960UL
+#define AVR64K 65536UL
+#define AVR68K 69632UL
+#define AVR128K 131072UL
+#define AVR136K 139264UL
+#define AVR200K 204800UL
+#define AVR256K 262144UL
+#define AVR264K 270336UL
+
+typedef struct
+{
+ char *name;
+ long flash;
+ long ram;
+ long eeprom;
+} avr_device_t;
+
+avr_device_t avr[] =
+{
+ {"atxmega256a3", AVR264K, AVR16K, AVR4K},
+ {"atxmega256a3b", AVR264K, AVR16K, AVR4K},
+ {"atxmega256d3", AVR264K, AVR16K, AVR4K},
+
+ {"atmega2560", AVR256K, AVR8K, AVR4K},
+ {"atmega2561", AVR256K, AVR8K, AVR4K},
+
+ {"atxmega192a3", AVR200K, AVR16K, AVR2K},
+ {"atxmega192d3", AVR200K, AVR16K, AVR2K},
+
+ {"atxmega128a1", AVR136K, AVR8K, AVR2K},
+ {"atxmega128a1u", AVR136K, AVR8K, AVR2K},
+ {"atxmega128a3", AVR136K, AVR8K, AVR2K},
+ {"atxmega128d3", AVR136K, AVR8K, AVR2K},
+
+ {"at43usb320", AVR128K, 608UL, 0UL},
+ {"at90can128", AVR128K, AVR4K, AVR4K},
+ {"at90usb1286", AVR128K, AVR8K, AVR4K},
+ {"at90usb1287", AVR128K, AVR8K, AVR4K},
+ {"atmega128", AVR128K, AVR4K, AVR4K},
+ {"atmega1280", AVR128K, AVR8K, AVR4K},
+ {"atmega1281", AVR128K, AVR8K, AVR4K},
+ {"atmega1284p", AVR128K, AVR16K, AVR4K},
+ {"atmega128rfa1", AVR128K, AVR16K, AVR4K},
+ {"atmega103", AVR128K, 4000UL, AVR4K},
+
+ {"atxmega64a1", AVR68K, AVR4K, AVR2K},
+ {"atxmega64a1u", AVR68K, AVR4K, AVR2K},
+ {"atxmega64a3", AVR68K, AVR4K, AVR2K},
+ {"atxmega64d3", AVR68K, AVR4K, AVR2K},
+
+ {"at90can64", AVR64K, AVR4K, AVR2K},
+ {"at90scr100", AVR64K, AVR4K, AVR2K},
+ {"at90usb646", AVR64K, AVR4K, AVR2K},
+ {"at90usb647", AVR64K, AVR4K, AVR2K},
+ {"atmega64", AVR64K, AVR4K, AVR2K},
+ {"atmega640", AVR64K, AVR8K, AVR4K},
+ {"atmega644", AVR64K, AVR4K, AVR2K},
+ {"atmega644a", AVR64K, AVR4K, AVR2K},
+ {"atmega644p", AVR64K, AVR4K, AVR2K},
+ {"atmega644pa", AVR64K, AVR4K, AVR2K},
+ {"atmega645", AVR64K, AVR4K, AVR2K},
+ {"atmega645a", AVR64K, AVR4K, AVR2K},
+ {"atmega645p", AVR64K, AVR4K, AVR2K},
+ {"atmega6450", AVR64K, AVR4K, AVR2K},
+ {"atmega6450a", AVR64K, AVR4K, AVR2K},
+ {"atmega6450p", AVR64K, AVR4K, AVR2K},
+ {"atmega649", AVR64K, AVR4K, AVR2K},
+ {"atmega649a", AVR64K, AVR4K, AVR2K},
+ {"atmega649p", AVR64K, AVR4K, AVR2K},
+ {"atmega6490", AVR64K, AVR4K, AVR2K},
+ {"atmega6490a", AVR64K, AVR4K, AVR2K},
+ {"atmega6490p", AVR64K, AVR4K, AVR2K},
+ {"atmega64c1", AVR64K, AVR4K, AVR2K},
+ {"atmega64hve", AVR64K, AVR4K, AVR1K},
+ {"atmega64m1", AVR64K, AVR4K, AVR2K},
+ {"m3000", AVR64K, AVR4K, 0UL},
+
+ {"atmega406", AVR40K, AVR2K, AVR512},
+
+ {"atxmega32a4", AVR36K, AVR4K, AVR1K},
+ {"atxmega32d4", AVR36K, AVR4K, AVR1K},
+
+ {"at90can32", AVR32K, AVR2K, AVR1K},
+ {"at94k", AVR32K, AVR4K, 0UL},
+ {"atmega32", AVR32K, AVR2K, AVR1K},
+ {"atmega323", AVR32K, AVR2K, AVR1K},
+ {"atmega324a", AVR32K, AVR2K, AVR1K},
+ {"atmega324p", AVR32K, AVR2K, AVR1K},
+ {"atmega324pa", AVR32K, AVR2K, AVR1K},
+ {"atmega325", AVR32K, AVR2K, AVR1K},
+ {"atmega325a", AVR32K, AVR2K, AVR1K},
+ {"atmega325p", AVR32K, AVR2K, AVR1K},
+ {"atmega3250", AVR32K, AVR2K, AVR1K},
+ {"atmega3250a", AVR32K, AVR2K, AVR1K},
+ {"atmega3250p", AVR32K, AVR2K, AVR1K},
+ {"atmega328", AVR32K, AVR2K, AVR1K},
+ {"atmega328p", AVR32K, AVR2K, AVR1K},
+ {"atmega329", AVR32K, AVR2K, AVR1K},
+ {"atmega329a", AVR32K, AVR2K, AVR1K},
+ {"atmega329p", AVR32K, AVR2K, AVR1K},
+ {"atmega329pa", AVR32K, AVR2K, AVR1K},
+ {"atmega3290", AVR32K, AVR2K, AVR1K},
+ {"atmega3290a", AVR32K, AVR2K, AVR1K},
+ {"atmega3290p", AVR32K, AVR2K, AVR1K},
+ {"atmega32hvb", AVR32K, AVR2K, AVR1K},
+ {"atmega32c1", AVR32K, AVR2K, AVR1K},
+ {"atmega32hvb", AVR32K, AVR2K, AVR1K},
+ {"atmega32m1", AVR32K, AVR2K, AVR1K},
+ {"atmega32u2", AVR32K, AVR1K, AVR1K},
+ {"atmega32u4", AVR32K, 2560UL, AVR1K},
+ {"atmega32u6", AVR32K, 2560UL, AVR1K},
+
+ {"at43usb355", AVR24K, 1120UL, 0UL},
+
+ {"atxmega16a4", AVR20K, AVR2K, AVR1K},
+ {"atxmega16d4", AVR20K, AVR2K, AVR1K},
+
+ {"at76c711", AVR16K, AVR2K, 0UL},
+ {"at90pwm216", AVR16K, AVR1K, AVR512},
+ {"at90pwm316", AVR16K, AVR1K, AVR512},
+ {"at90usb162", AVR16K, AVR512, AVR512},
+ {"atmega16", AVR16K, AVR1K, AVR512},
+ {"atmega16a", AVR16K, AVR1K, AVR512},
+ {"atmega161", AVR16K, AVR1K, AVR512},
+ {"atmega162", AVR16K, AVR1K, AVR512},
+ {"atmega163", AVR16K, AVR1K, AVR512},
+ {"atmega164", AVR16K, AVR1K, AVR512},
+ {"atmega164a", AVR16K, AVR1K, AVR512},
+ {"atmega164p", AVR16K, AVR1K, AVR512},
+ {"atmega165a", AVR16K, AVR1K, AVR512},
+ {"atmega165", AVR16K, AVR1K, AVR512},
+ {"atmega165p", AVR16K, AVR1K, AVR512},
+ {"atmega168", AVR16K, AVR1K, AVR512},
+ {"atmega168a", AVR16K, AVR1K, AVR512},
+ {"atmega168p", AVR16K, AVR1K, AVR512},
+ {"atmega169", AVR16K, AVR1K, AVR512},
+ {"atmega169a", AVR16K, AVR1K, AVR512},
+ {"atmega169p", AVR16K, AVR1K, AVR512},
+ {"atmega169pa", AVR16K, AVR1K, AVR512},
+ {"atmega16hva", AVR16K, 768UL, AVR256},
+ {"atmega16hva2", AVR16K, AVR1K, AVR256},
+ {"atmega16hvb", AVR16K, AVR1K, AVR512},
+ {"atmega16m1", AVR16K, AVR1K, AVR512},
+ {"atmega16u2", AVR16K, AVR512, AVR512},
+ {"atmega16u4", AVR16K, 1280UL, AVR512},
+ {"attiny167", AVR16K, AVR512, AVR512},
+
+ {"at90c8534", AVR8K, 352UL, AVR512},
+ {"at90pwm1", AVR8K, AVR512, AVR512},
+ {"at90pwm2", AVR8K, AVR512, AVR512},
+ {"at90pwm2b", AVR8K, AVR512, AVR512},
+ {"at90pwm3", AVR8K, AVR512, AVR512},
+ {"at90pwm3b", AVR8K, AVR512, AVR512},
+ {"at90pwm81", AVR8K, AVR256, AVR512},
+ {"at90s8515", AVR8K, AVR512, AVR512},
+ {"at90s8535", AVR8K, AVR512, AVR512},
+ {"at90usb82", AVR8K, AVR512, AVR512},
+ {"ata6289", AVR8K, AVR512, 320UL},
+ {"atmega8", AVR8K, AVR1K, AVR512},
+ {"atmega8515", AVR8K, AVR512, AVR512},
+ {"atmega8535", AVR8K, AVR512, AVR512},
+ {"atmega88", AVR8K, AVR1K, AVR512},
+ {"atmega88a", AVR8K, AVR1K, AVR512},
+ {"atmega88p", AVR8K, AVR1K, AVR512},
+ {"atmega88pa", AVR8K, AVR1K, AVR512},
+ {"atmega8hva", AVR8K, 768UL, AVR256},
+ {"atmega8u2", AVR8K, AVR512, AVR512},
+ {"attiny84", AVR8K, AVR512, AVR512},
+ {"attiny84a", AVR8K, AVR512, AVR512},
+ {"attiny85", AVR8K, AVR512, AVR512},
+ {"attiny861", AVR8K, AVR512, AVR512},
+ {"attiny861a", AVR8K, AVR512, AVR512},
+ {"attiny87", AVR8K, AVR512, AVR512},
+ {"attiny88", AVR8K, AVR512, AVR64},
+
+ {"at90s4414", AVR4K, 352UL, AVR256},
+ {"at90s4433", AVR4K, AVR128, AVR256},
+ {"at90s4434", AVR4K, 352UL, AVR256},
+ {"atmega48", AVR4K, AVR512, AVR256},
+ {"atmega48a", AVR4K, AVR512, AVR256},
+ {"atmega48p", AVR4K, AVR512, AVR256},
+ {"attiny4313", AVR4K, AVR256, AVR256},
+ {"attiny43u", AVR4K, AVR256, AVR64},
+ {"attiny44", AVR4K, AVR256, AVR256},
+ {"attiny44a", AVR4K, AVR256, AVR256},
+ {"attiny45", AVR4K, AVR256, AVR256},
+ {"attiny461", AVR4K, AVR256, AVR256},
+ {"attiny461a", AVR4K, AVR256, AVR256},
+ {"attiny48", AVR4K, AVR256, AVR64},
+
+ {"at86rf401", AVR2K, 224UL, AVR128},
+ {"at90s2313", AVR2K, AVR128, AVR128},
+ {"at90s2323", AVR2K, AVR128, AVR128},
+ {"at90s2333", AVR2K, 224UL, AVR128},
+ {"at90s2343", AVR2K, AVR128, AVR128},
+ {"attiny20", AVR2K, AVR128, 0UL},
+ {"attiny22", AVR2K, 224UL, AVR128},
+ {"attiny2313", AVR2K, AVR128, AVR128},
+ {"attiny2313a", AVR2K, AVR128, AVR128},
+ {"attiny24", AVR2K, AVR128, AVR128},
+ {"attiny24a", AVR2K, AVR128, AVR128},
+ {"attiny25", AVR2K, AVR128, AVR128},
+ {"attiny26", AVR2K, AVR128, AVR128},
+ {"attiny261", AVR2K, AVR128, AVR128},
+ {"attiny261a", AVR2K, AVR128, AVR128},
+ {"attiny28", AVR2K, 0UL, 0UL},
+ {"attiny40", AVR2K, AVR256, 0UL},
+
+ {"at90s1200", AVR1K, 0UL, AVR64},
+ {"attiny9", AVR1K, 32UL, 0UL},
+ {"attiny10", AVR1K, 32UL, 0UL},
+ {"attiny11", AVR1K, 0UL, AVR64},
+ {"attiny12", AVR1K, 0UL, AVR64},
+ {"attiny13", AVR1K, AVR64, AVR64},
+ {"attiny13a", AVR1K, AVR64, AVR64},
+ {"attiny15", AVR1K, 0UL, AVR64},
+
+ {"attiny4", AVR512, 32UL, 0UL},
+ {"attiny5", AVR512, 32UL, 0UL},
+};
+
+static char *avrmcu = NULL;
+
+
static char *target = NULL;
/* Forward declarations. */
@@ -89,7 +330,8 @@ usage (FILE *stream, int status)
fprintf (stream, _(" Displays the sizes of sections inside binary files\n"));
fprintf (stream, _(" If no input file(s) are specified, a.out is
assumed\n"));
fprintf (stream, _(" The options are:\n\
- -A|-B|-G --format={sysv|berkeley|gnu} Select output style (default is
%s)\n\
+ -A|-B|-C|-G --format={sysv|berkeley|avr|gnu} Select output style (default
is %s)\n\
+ --mcu=<avrmcu> MCU name for AVR format only\n\
-o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or
hex\n\
-t --totals Display the total sizes (Berkeley
only)\n\
--common Display total size for *COM* syms\n\
@@ -113,6 +355,7 @@ usage (FILE *stream, int status)
#define OPTION_FORMAT (200)
#define OPTION_RADIX (OPTION_FORMAT + 1)
#define OPTION_TARGET (OPTION_RADIX + 1)
+#define OPTION_MCU (OPTION_TARGET + 1)
static struct option long_options[] =
{
@@ -120,6 +363,7 @@ static struct option long_options[] =
{"format", required_argument, 0, OPTION_FORMAT},
{"radix", required_argument, 0, OPTION_RADIX},
{"target", required_argument, 0, OPTION_TARGET},
+ {"mcu", required_argument, 0, 203},
{"totals", no_argument, &show_totals, 1},
{"version", no_argument, &show_version, 1},
{"help", no_argument, &show_help, 1},
@@ -153,13 +397,17 @@ main (int argc, char **argv)
fatal (_("fatal error: libbfd ABI mismatch"));
set_default_bfd_target ();
- while ((c = getopt_long (argc, argv, "ABGHhVvdfotx", long_options,
+ while ((c = getopt_long (argc, argv, "ABCGHhVvdfotx", long_options,
(int *) 0)) != EOF)
switch (c)
{
case OPTION_FORMAT:
switch (*optarg)
{
+ case 'A':
+ case 'a':
+ selected_output_format = FORMAT_AVR;
+ break;
case 'B':
case 'b':
selected_output_format = FORMAT_BERKLEY;
@@ -178,6 +426,10 @@ main (int argc, char **argv)
}
break;
+ case OPTION_MCU:
+ avrmcu = optarg;
+ break;
+
case OPTION_TARGET:
target = optarg;
break;
@@ -211,6 +463,9 @@ main (int argc, char **argv)
case 'B':
selected_output_format = FORMAT_BERKLEY;
break;
+ case 'C':
+ selected_output_format = FORMAT_AVR;
+ break;
case 'G':
selected_output_format = FORMAT_GNU;
break;
@@ -648,13 +903,115 @@ print_sysv_format (bfd *file)
printf ("\n\n");
}
+static avr_device_t *
+avr_find_device (void)
+{
+ unsigned int i;
+ if (avrmcu != NULL)
+ {
+ for (i = 0; i < sizeof(avr) / sizeof(avr[0]); i++)
+ {
+ if (strcmp(avr[i].name, avrmcu) == 0)
+ {
+ /* Match found */
+ return (&avr[i]);
+ }
+ }
+ }
+ return (NULL);
+}
+
+static void
+print_avr_format (bfd *file)
+{
+ char *avr_name = "Unknown";
+ int flashmax = 0;
+ int rammax = 0;
+ int eeprommax = 0;
+ asection *section;
+ datasize = 0;
+ textsize = 0;
+ bsssize = 0;
+ bfd_size_type bootloadersize = 0;
+ bfd_size_type noinitsize = 0;
+ bfd_size_type eepromsize = 0;
+
+ avr_device_t *avrdevice = avr_find_device();
+ if (avrdevice != NULL)
+ {
+ avr_name = avrdevice->name;
+ flashmax = avrdevice->flash;
+ rammax = avrdevice->ram;
+ eeprommax = avrdevice->eeprom;
+ }
+
+ if ((section = bfd_get_section_by_name (file, ".data")) != NULL)
+ datasize = bfd_section_size (section);
+ if ((section = bfd_get_section_by_name (file, ".text")) != NULL)
+ textsize = bfd_section_size (section);
+ if ((section = bfd_get_section_by_name (file, ".bss")) != NULL)
+ bsssize = bfd_section_size (section);
+ if ((section = bfd_get_section_by_name (file, ".bootloader")) != NULL)
+ bootloadersize = bfd_section_size (section);
+ if ((section = bfd_get_section_by_name (file, ".noinit")) != NULL)
+ noinitsize = bfd_section_size (section);
+ if ((section = bfd_get_section_by_name (file, ".eeprom")) != NULL)
+ eepromsize = bfd_section_size (section);
+
+ bfd_size_type text = textsize + datasize + bootloadersize;
+ bfd_size_type data = datasize + bsssize + noinitsize;
+ bfd_size_type eeprom = eepromsize;
+
+ printf ("AVR Memory Usage\n"
+ "----------------\n"
+ "Device: %s\n\n", avr_name);
+
+ /* Text size */
+ printf ("Program:%8ld bytes", text);
+ if (flashmax > 0)
+ {
+ printf (" (%2.1f%% Full)", ((float)text / flashmax) * 100);
+ }
+ printf ("\n(.text + .data + .bootloader)\n\n");
+
+ /* Data size */
+ printf ("Data: %8ld bytes", data);
+ if (rammax > 0)
+ {
+ printf (" (%2.1f%% Full)", ((float)data / rammax) * 100);
+ }
+ printf ("\n(.data + .bss + .noinit)\n\n");
+
+ /* EEPROM size */
+ if (eeprom > 0)
+ {
+ printf ("EEPROM: %8ld bytes", eeprom);
+ if (eeprommax > 0)
+ {
+ printf (" (%2.1f%% Full)", ((float)eeprom / eeprommax) * 100);
+ }
+ printf ("\n(.eeprom)\n\n");
+ }
+}
+
+
static void
print_sizes (bfd *file)
{
if (show_common)
calculate_common_size (file);
- if (selected_output_format == FORMAT_SYSV)
- print_sysv_format (file);
- else
- print_berkeley_or_gnu_format (file);
+ switch (selected_output_format)
+ {
+ case FORMAT_SYSV:
+ print_sysv_format (file);
+ break;
+ case FORMAT_BERKLEY:
+ case FORMAT_GNU:
+ print_berkeley_or_gnu_format (file);
+ break;
+ case FORMAT_AVR:
+ default:
+ print_avr_format (file);
+ break;
+ }
}
++++++ enable-targets-gold.diff ++++++
Index: gold/configure
===================================================================
--- gold/configure.orig 2018-07-16 09:55:04.675278145 +0200
+++ gold/configure 2018-07-16 09:55:36.007836031 +0200
@@ -5180,7 +5180,8 @@ for targ in $target $canon_targets; do
. ${srcdir}/configure.tgt
if test "$targ_obj" = "UNKNOWN"; then
- as_fn_error $? "\"unsupported target $targ\"" "$LINENO" 5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"unsupported target
$targ\"" >&5
+ $as_echo "$as_me: WARNING: \"unsupported target $targ\"" >&2;}
else
targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
if test "$targ_extra_obj" != ""; then
++++++ ld-relro.diff ++++++
Index: ld/lexsup.c
===================================================================
--- ld/lexsup.c.orig 2014-10-14 17:43:07.000000000 +0200
+++ ld/lexsup.c 2014-10-14 17:43:26.000000000 +0200
@@ -623,6 +623,9 @@ parse_args (unsigned argc, char **argv)
}
}
+ optarg = "relro";
+ ldemul_handle_option ('z');
+
last_optind = -1;
while (1)
{
Index: ld/testsuite/config/default.exp
===================================================================
--- ld/testsuite/config/default.exp.orig 2014-10-14 17:43:07.000000000
+0200
+++ ld/testsuite/config/default.exp 2014-10-14 17:44:58.000000000 +0200
@@ -22,7 +22,7 @@
#
if ![info exists ld] then {
- set ld [findfile $base_dir/ld-new $base_dir/ld-new [transform ld]]
+ set ld "[findfile $base_dir/ld-new $base_dir/ld-new [transform ld]]
-znorelro"
}
if ![info exists as] then {
@@ -60,7 +60,7 @@ if {![file isdirectory tmpdir/ld]} then
catch "exec ln -s ld tmpdir/ld/collect-ld" status
catch "exec ln -s ../../../gas/as-new tmpdir/ld/as" status
}
-set gcc_B_opt "-B[pwd]/tmpdir/ld/"
+set gcc_B_opt "-B[pwd]/tmpdir/ld/ -Wl,-z,norelro"
# load the linker path
set ld_L_opt ""
@@ -272,7 +272,7 @@ if ![info exists READELFFLAGS] then {
}
if ![info exists LD] then {
- set LD [findfile $base_dir/ld-new ./ld-new [transform ld]]
+ set LD "[findfile $base_dir/ld-new ./ld-new [transform ld]] -znorelro"
}
if ![info exists LDFLAGS] then {
Index: ld/testsuite/ld-bootstrap/bootstrap.exp
===================================================================
--- ld/testsuite/ld-bootstrap/bootstrap.exp.orig 2014-10-14
17:43:07.000000000 +0200
+++ ld/testsuite/ld-bootstrap/bootstrap.exp 2014-10-14 17:43:26.000000000
+0200
@@ -78,7 +78,12 @@ foreach flags $test_flags {
# This test can only be run if we have the ld build directory,
# since we need the object files.
- if {$ld != "$objdir/ld-new"} {
+ set ldexe $ld
+ set ldparm [string first " " $ld]
+ if { $ldparm > 0 } then {
+ set ldexe [string range $ld 0 $ldparm]
+ }
+ if {$ldexe != "$objdir/ld-new"} {
untested $testname
continue
}
++++++ pre_checkin.sh ++++++
#!/bin/bash
# the script takes binutils* and creates the cross-* packages
rm -f cross-*-binutils.spec cross-*-binutils.changes
# sh4 is stuck in the testsuite
for arch in aarch64 hppa hppa64 arm i386 x86_64 s390 s390x ppc ppc64 ppc64le
ia64 sparc sparc64 spu avr mips m68k epiphany rx riscv64 xtensa; do
echo -n "Building package for $arch --> cross-$arch-binutils ..."
ln -f binutils.changes cross-$arch-binutils.changes
targetarch=`echo $arch | sed -e "s/parisc/hppa/;s/i.86/i586/;s/ppc/powerpc/"`
exclarch=`echo $arch | sed -e 's/parisc/hppa/;s/i.86/%ix86/;s/arm/%arm/'`
sed -e "s/^Name:.*binutils\$/Name:
cross-$arch-binutils\nExcludeArch: $exclarch\n%define cross 1\n%define TARGET
$targetarch/;" \
< binutils.spec > cross-$arch-binutils.spec
echo " done."
done
osc service localrun format_spec_file
++++++ s390-biarch.diff ++++++
Index: ld/emulparams/elf_s390.sh
===================================================================
--- ld/emulparams/elf_s390.sh.orig 2019-09-09 18:48:59.000000000 +0200
+++ ld/emulparams/elf_s390.sh 2019-09-09 18:49:02.000000000 +0200
@@ -12,3 +12,18 @@ GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
NO_SMALL_DATA=yes
IREL_IN_PLT=
+
+# Treat a host that matches the target with the possible exception of "x"
+# in the name as if it were native.
+if test `echo "$host" | sed -e s/x//` = `echo "$target" | sed -e s/x//`; then
+ case " $EMULATION_LIBPATH " in
+ *" ${EMULATION_NAME} "*)
+ NATIVE=yes
+ ;;
+ esac
+fi
+
+# Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first.
+case "$EMULATION_NAME" in
+ *64*) LIBPATH_SUFFIX=64 ;;
+esac
++++++ s390-pic-dso.diff ++++++
Index: bfd/elf32-s390.c
===================================================================
--- bfd/elf32-s390.c.orig 2016-01-25 09:51:06.000000000 +0100
+++ bfd/elf32-s390.c 2016-01-27 15:24:52.947115619 +0100
@@ -2782,6 +2782,27 @@ elf_s390_relocate_section (bfd *output_b
case R_390_PC24DBL:
case R_390_PC32DBL:
case R_390_PC32:
+ /* This is strictly required only for PC32DBL, which
+ is not handled by ld.so, but let's be helpful to the user also
+ in the other cases. */
+ if (bfd_link_pic (info)
+ && !SYMBOL_REFERENCES_LOCAL (info, h)
+ && (input_section->flags & SEC_ALLOC) != 0
+ && (input_section->flags & SEC_READONLY) != 0
+ && (!h->def_regular
+ || r_type != R_390_PC32DBL
+ || h->type != STT_FUNC
+ || ELF_ST_VISIBILITY (h->other) != STV_PROTECTED))
+ {
+ (*_bfd_error_handler)
+ (_("%B: relocation %s against `%s' can not be used when "
+ "making a shared object; recompile with -fPIC"),
+ input_bfd, elf_howto_table[r_type].name,
+ h->root.root.string);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+
if (h != NULL
&& s390_is_ifunc_symbol_p (h)
&& h->def_regular
++++++ testsuite.diff ++++++
Index: binutils/testsuite/binutils-all/windres/windres.exp
===================================================================
--- binutils/testsuite/binutils-all/windres/windres.exp.orig
+++ binutils/testsuite/binutils-all/windres/windres.exp
@@ -36,6 +36,7 @@ set wr "$WINDRES --include-dir $srcdir/$
if [file exists "$srcdir/../../winsup/w32api/include"] {
set wr "$wr --include-dir $srcdir/../../winsup/w32api/include"
} else {
+ return
send_log "\nWarning: Assuming windres can find the win32 headers\n\n"
}
Index: ld/testsuite/ld-srec/srec.exp
===================================================================
--- ld/testsuite/ld-srec/srec.exp.orig
+++ ld/testsuite/ld-srec/srec.exp
@@ -20,6 +20,9 @@
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
+# Too fragile.
+return
+
# Get the offset from an S-record line to the start of the data.
proc srec_off { l } {
++++++ unit-at-a-time.patch ++++++
Index: ld/testsuite/ld-selective/selective.exp
===================================================================
--- ld/testsuite/ld-selective/selective.exp
+++ ld/testsuite/ld-selective/selective.exp
@@ -46,8 +46,8 @@ set seltests {
{A::foo() B::foo() dropme1() dropme2()} {*-*-*}}
}
-set cflags "-w -O -ffunction-sections -fdata-sections $NOSANITIZE_CFLAGS
$NOLTO_CFLAGS"
-set cxxflags "-fno-exceptions -fno-rtti $NOSANITIZE_CFLAGS $NOLTO_CFLAGS"
+set cflags "-w -O -ffunction-sections -fdata-sections -fno-unit-at-a-time
$NOSANITIZE_CFLAGS $NOLTO_CFLAGS"
+set cxxflags "-fno-exceptions -fno-rtti -fno-unit-at-a-time $NOSANITIZE_CFLAGS
$NOLTO_CFLAGS"
set ldflags "--gc-sections -Bstatic"
if [istarget mips*-*] {
++++++ x86-64-biarch.patch ++++++
Index: ld/emulparams/elf_i386.sh
===================================================================
--- ld/emulparams/elf_i386.sh.orig 2014-10-14 17:39:02.000000000 +0200
+++ ld/emulparams/elf_i386.sh 2014-10-14 17:39:44.000000000 +0200
@@ -23,6 +23,10 @@ case "$target" in
LIBPATH_SUFFIX=32
LIBPATH_SUFFIX_SKIP=64
;;
+ *64*)
+ LIBPATH_SUFFIX=64
+ LIBPATH_SUFFIX_SKIP=32
+ ;;
esac
;;
esac