binutils: Upgrade to 2.35 release

assembler supports dwarf-5 format line numbers
linker has -M -MP gcc-like option

for detailed release notes see [1]

[1] https://lists.gnu.org/archive/html/info-gnu/2020-07/msg00008.html

(From OE-Core rev: 7a7667127625244aae2b1ff179e431fc9ad25737)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Khem Raj
2020-07-30 00:53:43 -07:00
committed by Richard Purdie
parent 4a832bc5d5
commit 56b201df77
27 changed files with 2490 additions and 1080 deletions

View File

@@ -18,7 +18,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext"
GCCVERSION ?= "10.%"
SDKGCCVERSION ?= "${GCCVERSION}"
BINUVERSION ?= "2.34%"
BINUVERSION ?= "2.35%"
GDBVERSION ?= "9.%"
GLIBCVERSION ?= "2.31%"
LINUXLIBCVERSION ?= "5.4%"

View File

@@ -16,32 +16,31 @@ def binutils_branch_version(d):
# When upgrading to 2.35, please make sure there is no trailing .0, so
# that upstream version check can work correctly.
PV = "2.34"
CVE_VERSION = "2.34"
PV = "2.35"
CVE_VERSION = "2.35"
BINUPV = "${@binutils_branch_version(d)}"
#BRANCH = "binutils-${BINUPV}-branch"
BRANCH ?= "binutils-2_34-branch"
BRANCH ?= "binutils-2_35-branch"
UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)"
SRCREV ?= "d4b50999b3b287b5f984ade2f8734aa8c9359440"
SRCREV ?= "89a9065674a14a8bd94bb326b27d19a2f3583efb"
BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${BRANCH};protocol=git"
SRC_URI = "\
${BINUTILS_GIT_URI} \
file://0004-configure-widen-the-regexp-for-SH-architectures.patch \
file://0005-Point-scripts-location-to-libdir.patch \
file://0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
file://0007-Use-libtool-2.4.patch \
file://0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \
file://0009-warn-for-uses-of-system-directories-when-cross-linki.patch \
file://0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
file://0011-Change-default-emulation-for-mips64-linux.patch \
file://0012-Add-support-for-Netlogic-XLP.patch \
file://0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \
file://0014-Detect-64-bit-MIPS-targets.patch \
file://0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \
file://0008-warn-for-uses-of-system-directories-when-cross-linki.patch \
file://0009-Change-default-emulation-for-mips64-linux.patch \
file://0010-Add-support-for-Netlogic-XLP.patch \
file://0011-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \
file://0012-Detect-64-bit-MIPS-targets.patch \
file://0013-Use-libtool-2.4.patch \
file://0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
file://0015-sync-with-OE-libtool-changes.patch \
file://0016-Check-for-clang-before-checking-gcc-version.patch \
file://0017-binutils-drop-redundant-program_name-definition-fno-.patch \
file://CVE-2020-0551.patch \
file://0017-Do-not-emit-R_RISCV_NONE-reloc-in-the-extra-unused-r.patch \
"
S = "${WORKDIR}/git"

View File

@@ -1,7 +1,7 @@
From b05f0be13aadf0b26a0b39dfe7daf2c47a300338 Mon Sep 17 00:00:00 2001
From b8d182865081d17549fb9a4b9bc3062b526caf65 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 2 Mar 2015 01:58:54 +0000
Subject: [PATCH] binutils-crosssdk: Generate relocatable SDKs
Subject: [PATCH 01/17] binutils-crosssdk: Generate relocatable SDKs
This patch will modify the ELF linker scripts so that the crosssdk
linker will generate binaries with a 4096 bytes PT_INTERP section. When the binaries
@@ -18,7 +18,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ld/genscripts.sh b/ld/genscripts.sh
index 03392d265c..435689ea14 100755
index 03392d265c7..435689ea144 100755
--- a/ld/genscripts.sh
+++ b/ld/genscripts.sh
@@ -304,6 +304,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}"
@@ -43,7 +43,7 @@ index 03392d265c..435689ea14 100755
DATA_ALIGNMENT=${DATA_ALIGNMENT_}
RELOCATING=" "
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index 0b8b32a440..ee6b71075d 100644
index 0b8b32a4407..ee6b71075d7 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -140,8 +140,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then
@@ -57,3 +57,6 @@ index 0b8b32a440..ee6b71075d 100644
fi
if test -z "$PLT"; then
IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }"
--
2.28.0

View File

@@ -1,7 +1,8 @@
From 6d79f81336e7cbe727b5a51134f5d314a455379d Mon Sep 17 00:00:00 2001
From 0d14f8f333a9b519202246ce779f3e380491826c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 6 Mar 2017 23:37:05 -0800
Subject: [PATCH] binutils-cross: Do not generate linker script directories
Subject: [PATCH 02/17] binutils-cross: Do not generate linker script
directories
We don't place target libraries within ${exec_prefix}, we'd always place these
within the target sysroot within the standard library directories. Worse, the
@@ -22,7 +23,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 25 deletions(-)
diff --git a/ld/genscripts.sh b/ld/genscripts.sh
index 435689ea14..cff8a1467f 100755
index 435689ea144..cff8a1467f9 100755
--- a/ld/genscripts.sh
+++ b/ld/genscripts.sh
@@ -235,31 +235,6 @@ append_to_lib_path()
@@ -57,3 +58,6 @@ index 435689ea14..cff8a1467f 100755
if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
libs=${NATIVE_LIB_DIRS}
if [ "x${NATIVE}" = "xyes" ] ; then
--
2.28.0

View File

@@ -1,8 +1,8 @@
From d057b215f114f6158b4010ab44a19cae9dcc8386 Mon Sep 17 00:00:00 2001
From 3bbec749ec9fe681ade6812c48c541a752fcffd5 Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Date: Wed, 19 Feb 2020 09:51:16 -0800
Subject: [PATCH] binutils-nativesdk: Search for alternative ld.so.conf in SDK
installation
Subject: [PATCH 03/17] binutils-nativesdk: Search for alternative ld.so.conf
in SDK installation
We need binutils to look at our ld.so.conf file within the SDK to ensure
we search the SDK's libdirs as well as those from the host system.
@@ -29,7 +29,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
5 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 4a9b8404b7..1c132d3ce4 100644
index 02c4fc16395..a5762227f0a 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -42,7 +42,8 @@ ZLIBINC = @zlibinc@
@@ -43,10 +43,10 @@ index 4a9b8404b7..1c132d3ce4 100644
NO_WERROR = @NO_WERROR@
AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 46d9b14077..e453bc1b33 100644
index 2fe12e14f63..8f0c83ac8d2 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -555,7 +555,8 @@ ZLIB = @zlibdir@ -lz
@@ -548,7 +548,8 @@ ZLIB = @zlibdir@ -lz
ZLIBINC = @zlibinc@
ELF_CLFAGS = -DELF_LIST_OPTIONS=@elf_list_options@ \
-DELF_SHLIB_LIST_OPTIONS=@elf_shlib_list_options@ \
@@ -55,25 +55,25 @@ index 46d9b14077..e453bc1b33 100644
+ -DSYSCONFDIR="\"$(sysconfdir)\""
AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
@ENABLE_PLUGINS_FALSE@PLUGIN_C =
diff --git a/ld/ldelf.c b/ld/ldelf.c
index 2e27cf48a8..a095d6aac5 100644
index bada3ade2d7..b4784009d7a 100644
--- a/ld/ldelf.c
+++ b/ld/ldelf.c
@@ -907,7 +907,7 @@ ldelf_check_ld_so_conf (const struct bfd_link_needed_list *l, int force,
@@ -911,7 +911,7 @@ ldelf_check_ld_so_conf (const struct bfd_link_needed_list *l, int force,
info.path = NULL;
info.len = info.alloc = 0;
- tmppath = concat (ld_sysroot, prefix, "/etc/ld.so.conf",
+ tmppath = concat (ld_sysconfdir, "/ld.so.conf",
+ tmppath = concat (ld_sysconfdir, "/etc/ld.so.conf",
(const char *) NULL);
if (!ldelf_parse_ld_so_conf (&info, tmppath))
{
diff --git a/ld/ldmain.c b/ld/ldmain.c
index c4af10f4e9..da1ad17763 100644
index 08be9030cb5..f5c5a336320 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -69,6 +69,7 @@ char *program_name;
@@ -70,6 +70,7 @@ char *program_name;
/* The prefix for system library directories. */
const char *ld_sysroot;
@@ -82,7 +82,7 @@ index c4af10f4e9..da1ad17763 100644
/* The canonical representation of ld_sysroot. */
char *ld_canon_sysroot;
diff --git a/ld/ldmain.h b/ld/ldmain.h
index 0f05821d1e..54c36a94ce 100644
index ac7db5720d5..1cbe1771912 100644
--- a/ld/ldmain.h
+++ b/ld/ldmain.h
@@ -23,6 +23,7 @@
@@ -93,3 +93,6 @@ index 0f05821d1e..54c36a94ce 100644
extern char *ld_canon_sysroot;
extern int ld_canon_sysroot_len;
extern FILE *saved_script_handle;
--
2.28.0

View File

@@ -1,7 +1,7 @@
From f7ad8a44c10f01e03680f093fd7af71c9f5e8606 Mon Sep 17 00:00:00 2001
From 361c2c313196c095d12d17cecf0a069107dd629b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 2 Mar 2015 01:07:33 +0000
Subject: [PATCH] configure: widen the regexp for SH architectures
Subject: [PATCH 04/17] configure: widen the regexp for SH architectures
gprof needs to know about uclibc
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 91dc42f6c7..7c1b747e7c 100755
index 54d0339ab9e..6782f8b6ab8 100755
--- a/configure
+++ b/configure
@@ -3915,7 +3915,7 @@ case "${target}" in
@@ -3937,7 +3937,7 @@ case "${target}" in
nvptx*-*-*)
noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
;;
@@ -27,10 +27,10 @@ index 91dc42f6c7..7c1b747e7c 100755
sh*-*-elf)
;;
diff --git a/configure.ac b/configure.ac
index 4bd869a63a..7187b34dfc 100644
index a910c4fd6ba..55beb1dea46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1159,7 +1159,7 @@ case "${target}" in
@@ -1178,7 +1178,7 @@ case "${target}" in
nvptx*-*-*)
noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
;;
@@ -39,3 +39,6 @@ index 4bd869a63a..7187b34dfc 100644
case "${target}" in
sh*-*-elf)
;;
--
2.28.0

View File

@@ -1,7 +1,7 @@
From 08b088b7dd3d9707ed66948a7271ffb438eeddf5 Mon Sep 17 00:00:00 2001
From 39b478b7e52fb1b892a392f3c3750b9023cfabc8 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 2 Mar 2015 01:09:58 +0000
Subject: [PATCH] Point scripts location to libdir
Subject: [PATCH 05/17] Point scripts location to libdir
Upstream-Status: Inappropriate [debian patch]
@@ -12,10 +12,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 1c132d3ce4..8d82cf2e16 100644
index a5762227f0a..e1c665898f3 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -64,7 +64,7 @@ endif
@@ -51,7 +51,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
@@ -25,10 +25,10 @@ index 1c132d3ce4..8d82cf2e16 100644
EMUL = @EMUL@
EMULATION_OFILES = @EMULATION_OFILES@
diff --git a/ld/Makefile.in b/ld/Makefile.in
index e453bc1b33..2dcd72f809 100644
index 8f0c83ac8d2..acc24ec4130 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -573,7 +573,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
@@ -556,7 +556,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
@@ -37,3 +37,6 @@ index e453bc1b33..2dcd72f809 100644
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include
--
2.28.0

View File

@@ -1,7 +1,8 @@
From 13791636abf518f0db209dc51c29445d80421f2e Mon Sep 17 00:00:00 2001
From 59640ddf11104a604ccf7c078a48359d711c2f9c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 2 Mar 2015 01:27:17 +0000
Subject: [PATCH] Only generate an RPATH entry if LD_RUN_PATH is not empty
Subject: [PATCH 06/17] Only generate an RPATH entry if LD_RUN_PATH is not
empty
for cases where -rpath isn't specified. debian (#151024)
@@ -14,10 +15,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 4 insertions(+)
diff --git a/ld/ldelf.c b/ld/ldelf.c
index a095d6aac5..a2455a8793 100644
index b4784009d7a..541772f4604 100644
--- a/ld/ldelf.c
+++ b/ld/ldelf.c
@@ -1229,6 +1229,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
@@ -1247,6 +1247,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
&& command_line.rpath == NULL)
{
path = (const char *) getenv ("LD_RUN_PATH");
@@ -26,7 +27,7 @@ index a095d6aac5..a2455a8793 100644
if (path
&& ldelf_search_needed (path, &n, force,
is_linux, elfsize))
@@ -1573,6 +1575,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
@@ -1605,6 +1607,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
rpath = command_line.rpath;
if (rpath == NULL)
rpath = (const char *) getenv ("LD_RUN_PATH");
@@ -35,3 +36,6 @@ index a095d6aac5..a2455a8793 100644
for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
--
2.28.0

View File

@@ -1,8 +1,8 @@
From e36a4e05f900bbe6a8d744a93f3a407bc55c96f7 Mon Sep 17 00:00:00 2001
From 2b81508b9af76db292cd756432b03035cb8157e0 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 2 Mar 2015 01:39:01 +0000
Subject: [PATCH] don't let the distro compiler point to the wrong installation
location
Subject: [PATCH 07/17] don't let the distro compiler point to the wrong
installation location
Thanks to RP for helping find the source code causing the issue.
@@ -17,10 +17,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index fe738d0db4..27d818f253 100644
index 895f701bcd0..97a53f15bb6 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -365,7 +365,8 @@ install-strip: install
@@ -367,7 +367,8 @@ install-strip: install
# multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
# default multilib, so we have to take CFLAGS into account as well,
# since it will be passed the multilib flags.
@@ -30,3 +30,6 @@ index fe738d0db4..27d818f253 100644
install_to_libdir: all
if test -n "${target_header_dir}"; then \
${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \
--
2.28.0

View File

@@ -1,7 +1,7 @@
From 7b24f81e04c9d00d96de7dbd250beade6d2c6e44 Mon Sep 17 00:00:00 2001
From 413075afbdb16e7cc05511682ca9e3c880acb5a7 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 15 Jan 2016 06:31:09 +0000
Subject: [PATCH] warn for uses of system directories when cross linking
Subject: [PATCH 08/17] warn for uses of system directories when cross linking
2008-07-02 Joseph Myers <joseph@codesourcery.com>
@@ -57,16 +57,16 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
ld/ld.h | 8 ++++++++
ld/ld.texi | 12 ++++++++++++
ld/ldfile.c | 17 +++++++++++++++++
ld/ldlex.h | 2 ++
ld/ldlex.h | 5 +++++
ld/ldmain.c | 2 ++
ld/lexsup.c | 15 +++++++++++++++
9 files changed, 85 insertions(+)
ld/lexsup.c | 27 +++++++++++++++++++++++++++
9 files changed, 100 insertions(+)
diff --git a/ld/config.in b/ld/config.in
index d93c9b0830..5da2742bea 100644
index f1712107367..308e0173c16 100644
--- a/ld/config.in
+++ b/ld/config.in
@@ -31,6 +31,9 @@
@@ -40,6 +40,9 @@
language is requested. */
#undef ENABLE_NLS
@@ -77,7 +77,7 @@ index d93c9b0830..5da2742bea 100644
#undef EXTRA_SHLIB_EXTENSION
diff --git a/ld/configure b/ld/configure
index 811134a503..f8c17c19ae 100755
index f08ce9969ea..1c872c0db5f 100755
--- a/ld/configure
+++ b/ld/configure
@@ -826,6 +826,7 @@ with_lib_path
@@ -88,7 +88,7 @@ index 811134a503..f8c17c19ae 100755
enable_gold
enable_got
enable_compressed_debug_sections
@@ -1491,6 +1492,8 @@ Optional Features:
@@ -1493,6 +1494,8 @@ Optional Features:
--disable-largefile omit support for large files
--enable-targets alternative target configurations
--enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
@@ -97,7 +97,7 @@ index 811134a503..f8c17c19ae 100755
--enable-gold[=ARG] build gold [ARG={default,yes,no}]
--enable-got=<type> GOT handling scheme (target, single, negative,
multigot)
@@ -15788,6 +15791,19 @@ fi
@@ -15793,6 +15796,19 @@ fi
@@ -118,7 +118,7 @@ index 811134a503..f8c17c19ae 100755
if test "${enable_gold+set}" = set; then :
enableval=$enable_gold; case "${enableval}" in
diff --git a/ld/configure.ac b/ld/configure.ac
index b5e849d84a..22e022ec03 100644
index 5a4938afdb0..dbbbde74b04 100644
--- a/ld/configure.ac
+++ b/ld/configure.ac
@@ -94,6 +94,16 @@ AC_SUBST(use_sysroot)
@@ -139,7 +139,7 @@ index b5e849d84a..22e022ec03 100644
dnl "install_as_default" is set to false if gold is the default linker.
dnl "installed_linker" is the installed BFD linker name.
diff --git a/ld/ld.h b/ld/ld.h
index 71fd781267..5c7843100b 100644
index 1790dc81a66..73f832eb169 100644
--- a/ld/ld.h
+++ b/ld/ld.h
@@ -166,6 +166,14 @@ typedef struct
@@ -158,10 +158,10 @@ index 71fd781267..5c7843100b 100644
enum endian_enum endian;
diff --git a/ld/ld.texi b/ld/ld.texi
index eb7bcb9933..3c73d445a0 100644
index 2a93e9456ac..3eeb70607fd 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -2551,6 +2551,18 @@ string identifying the original linked file does not change.
@@ -2655,6 +2655,18 @@ string identifying the original linked file does not change.
Passing @code{none} for @var{style} disables the setting from any
@code{--build-id} options earlier on the command line.
@@ -181,7 +181,7 @@ index eb7bcb9933..3c73d445a0 100644
@c man end
diff --git a/ld/ldfile.c b/ld/ldfile.c
index 411f7ddf97..17db16c2cc 100644
index e39170b5d94..fadc248a140 100644
--- a/ld/ldfile.c
+++ b/ld/ldfile.c
@@ -117,6 +117,23 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline)
@@ -209,23 +209,26 @@ index 411f7ddf97..17db16c2cc 100644
/* Try to open a BFD for a lang_input_statement. */
diff --git a/ld/ldlex.h b/ld/ldlex.h
index 5287f19a7f..55096e4fc9 100644
index 5ea083ebeb3..941dc5f3dc8 100644
--- a/ld/ldlex.h
+++ b/ld/ldlex.h
@@ -150,6 +150,8 @@ enum option_values
OPTION_FORCE_GROUP_ALLOCATION,
OPTION_PRINT_MAP_DISCARDED,
OPTION_NO_PRINT_MAP_DISCARDED,
@@ -155,6 +155,11 @@ enum option_values
OPTION_NON_CONTIGUOUS_REGIONS,
OPTION_NON_CONTIGUOUS_REGIONS_WARNINGS,
OPTION_DEPENDENCY_FILE,
+ OPTION_CTF_VARIABLES,
+ OPTION_NO_CTF_VARIABLES,
+ OPTION_CTF_SHARE_TYPES,
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
};
/* The initial parser states. */
diff --git a/ld/ldmain.c b/ld/ldmain.c
index da1ad17763..12d0b07d8a 100644
index f5c5a336320..516ba0360e2 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -274,6 +274,8 @@ main (int argc, char **argv)
@@ -322,6 +322,8 @@ main (int argc, char **argv)
command_line.warn_mismatch = TRUE;
command_line.warn_search_mismatch = TRUE;
command_line.check_section_addresses = -1;
@@ -235,13 +238,25 @@ index da1ad17763..12d0b07d8a 100644
/* We initialize DEMANGLING based on the environment variable
COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
diff --git a/ld/lexsup.c b/ld/lexsup.c
index 3d15cc491d..0e8b4f2b7a 100644
index 58c6c078325..879e7bb7658 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -550,6 +550,14 @@ static const struct ld_option ld_options[] =
@@ -572,6 +572,26 @@ static const struct ld_option ld_options[] =
{ {"no-print-map-discarded", no_argument, NULL, OPTION_NO_PRINT_MAP_DISCARDED},
'\0', NULL, N_("Do not show discarded sections in map file output"),
TWO_DASHES },
+ { {"ctf-variables", no_argument, NULL, OPTION_CTF_VARIABLES},
+ '\0', NULL, N_("Emit names and types of static variables in CTF"),
+ TWO_DASHES },
+ { {"no-ctf-variables", no_argument, NULL, OPTION_NO_CTF_VARIABLES},
+ '\0', NULL, N_("Do not emit names and types of static variables in CTF"),
+ TWO_DASHES },
+ { {"ctf-share-types=<method>", required_argument, NULL,
+ OPTION_CTF_SHARE_TYPES},
+ '\0', NULL, N_("How to share CTF types between translation units.\n"
+ " <method> is: share-unconflicted (default),\n"
+ " share-duplicated"),
+ TWO_DASHES },
+ { {"no-poison-system-directories", no_argument, NULL,
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES},
+ '\0', NULL, N_("Do not warn for -L options using system directories"),
@@ -253,7 +268,7 @@ index 3d15cc491d..0e8b4f2b7a 100644
};
#define OPTION_COUNT ARRAY_SIZE (ld_options)
@@ -1603,6 +1611,13 @@ parse_args (unsigned argc, char **argv)
@@ -1632,6 +1652,13 @@ parse_args (unsigned argc, char **argv)
case OPTION_PRINT_MAP_DISCARDED:
config.print_map_discarded = TRUE;
@@ -265,5 +280,8 @@ index 3d15cc491d..0e8b4f2b7a 100644
+ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
+ command_line.error_poison_system_directories = TRUE;
break;
}
}
case OPTION_DEPENDENCY_FILE:
--
2.28.0

View File

@@ -1,7 +1,7 @@
From 2182791a453f34bee6968b3e72848608cf7d7abe Mon Sep 17 00:00:00 2001
From 13a67e9040c01abd284fe506471e0eab668ee3dc Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 2 Mar 2015 01:44:14 +0000
Subject: [PATCH] Change default emulation for mips64*-*-linux
Subject: [PATCH 09/17] Change default emulation for mips64*-*-linux
we change the default emulations to be N64 instead of N32
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/bfd/config.bfd b/bfd/config.bfd
index b96931f52e..847f9f0ba9 100644
index 14523caf0c5..e5233cd1f7e 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -911,12 +911,12 @@ case "${targ}" in
@@ -894,12 +894,12 @@ case "${targ}" in
targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
;;
mips64*el-*-linux*)
@@ -35,10 +35,10 @@ index b96931f52e..847f9f0ba9 100644
mips*el-*-linux*)
targ_defvec=mips_elf32_trad_le_vec
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 23194e357f..f4f0eaf9b2 100644
index 87c7d9a4cad..9b4bf2ca964 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -541,12 +541,12 @@ mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
@@ -531,12 +531,12 @@ mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
;;
mips*-*-windiss) targ_emul=elf32mipswindiss
;;
@@ -55,3 +55,6 @@ index 23194e357f..f4f0eaf9b2 100644
targ_extra_libpath=$targ_extra_emuls
;;
mips*el-*-linux-*) targ_emul=elf32ltsmip
--
2.28.0

View File

@@ -1,7 +1,7 @@
From a0237ec2d1e58bd35c236df39dd5a06504c6d2ed Mon Sep 17 00:00:00 2001
From 69ab45c16f80f18fa78121f6e774750b9e9a200b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 14 Feb 2016 17:06:19 +0000
Subject: [PATCH] Add support for Netlogic XLP
Subject: [PATCH 10/17] Add support for Netlogic XLP
Patch From: Nebu Philips <nphilips@netlogicmicro.com>
@@ -35,10 +35,10 @@ Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
15 files changed, 65 insertions(+), 21 deletions(-)
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index fa3a9746b6..5078024fd5 100644
index d352a1a3e44..2e2c3c1af86 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -799,6 +799,7 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
@@ -810,6 +810,7 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
case bfd_mach_mipsisa64r6:
case bfd_mach_mips_sb1:
case bfd_mach_mips_xlr:
@@ -47,7 +47,7 @@ index fa3a9746b6..5078024fd5 100644
arch_flags = M_MIPS2;
break;
diff --git a/bfd/archures.c b/bfd/archures.c
index 232103817c..b2b3b8c124 100644
index 551ec8732f0..2665b378623 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -185,6 +185,7 @@ DESCRIPTION
@@ -59,10 +59,10 @@ index 232103817c..b2b3b8c124 100644
.#define bfd_mach_mipsisa32r2 33
.#define bfd_mach_mipsisa32r3 34
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 7c13bc8c91..2e453c50c1 100644
index 35ef4d755bb..48db00af80b 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1568,6 +1568,7 @@ enum bfd_architecture
@@ -1585,6 +1585,7 @@ enum bfd_architecture
#define bfd_mach_mips_octeon3 6503
#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
@@ -71,10 +71,10 @@ index 7c13bc8c91..2e453c50c1 100644
#define bfd_mach_mipsisa32r2 33
#define bfd_mach_mipsisa32r3 34
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 847f9f0ba9..a12707f827 100644
index e5233cd1f7e..2e4ae6bbdff 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -894,6 +894,11 @@ case "${targ}" in
@@ -877,6 +877,11 @@ case "${targ}" in
targ_defvec=mips_elf32_le_vec
targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec"
;;
@@ -87,7 +87,7 @@ index 847f9f0ba9..a12707f827 100644
targ_defvec=mips_elf32_be_vec
targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
diff --git a/bfd/cpu-mips.c b/bfd/cpu-mips.c
index 802acb45f1..fd9ec4c0ad 100644
index 802acb45f1e..fd9ec4c0ad4 100644
--- a/bfd/cpu-mips.c
+++ b/bfd/cpu-mips.c
@@ -108,7 +108,8 @@ enum
@@ -111,10 +111,10 @@ index 802acb45f1..fd9ec4c0ad 100644
/* The default architecture is mips:3000, but with a machine number of
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index d7e3aed3b6..7baeee9ee3 100644
index 160febec94c..4c9499cc2cf 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -6999,6 +6999,9 @@ _bfd_elf_mips_mach (flagword flags)
@@ -6982,6 +6982,9 @@ _bfd_elf_mips_mach (flagword flags)
case E_MIPS_MACH_IAMR2:
return bfd_mach_mips_interaptiv_mr2;
@@ -124,7 +124,7 @@ index d7e3aed3b6..7baeee9ee3 100644
default:
switch (flags & EF_MIPS_ARCH)
{
@@ -12355,6 +12358,10 @@ mips_set_isa_flags (bfd *abfd)
@@ -12356,6 +12359,10 @@ mips_set_isa_flags (bfd *abfd)
val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON2;
break;
@@ -135,7 +135,7 @@ index d7e3aed3b6..7baeee9ee3 100644
case bfd_mach_mipsisa32:
val = E_MIPS_ARCH_32;
break;
@@ -14379,6 +14386,7 @@ static const struct mips_mach_extension mips_mach_extensions[] =
@@ -14373,6 +14380,7 @@ static const struct mips_mach_extension mips_mach_extensions[] =
{ bfd_mach_mips_gs264e, bfd_mach_mips_gs464e },
{ bfd_mach_mips_gs464e, bfd_mach_mips_gs464 },
{ bfd_mach_mips_gs464, bfd_mach_mipsisa64r2 },
@@ -144,10 +144,10 @@ index d7e3aed3b6..7baeee9ee3 100644
/* MIPS64 extensions. */
{ bfd_mach_mipsisa64r2, bfd_mach_mipsisa64 },
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 6b5bebe743..d15a7828db 100644
index 6057515a89b..ea119b0b254 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -3440,6 +3440,7 @@ get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine)
@@ -3483,6 +3483,7 @@ get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine)
case E_MIPS_MACH_OCTEON3: strcat (buf, ", octeon3"); break;
case E_MIPS_MACH_XLR: strcat (buf, ", xlr"); break;
case E_MIPS_MACH_IAMR2: strcat (buf, ", interaptiv-mr2"); break;
@@ -156,7 +156,7 @@ index 6b5bebe743..d15a7828db 100644
/* We simply ignore the field in this case to avoid confusion:
MIPS ELF does not specify EF_MIPS_MACH, it is a GNU
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index fc6898834e..2c7151ccdb 100644
index 31acb77d78a..0ead168d51e 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -568,6 +568,7 @@ static int mips_32bitmode = 0;
@@ -175,7 +175,7 @@ index fc6898834e..2c7151ccdb 100644
)
/* Whether the processor uses hardware interlocks to protect reads
@@ -20135,7 +20137,7 @@ static const struct mips_cpu_info mips_cpu_info_table[] =
@@ -20174,7 +20176,7 @@ static const struct mips_cpu_info mips_cpu_info_table[] =
/* Broadcom XLP.
XLP is mostly like XLR, with the prominent exception that it is
MIPS64R2 rather than MIPS64. */
@@ -185,7 +185,7 @@ index fc6898834e..2c7151ccdb 100644
/* MIPS 64 Release 6. */
{ "i6400", 0, ASE_VIRT | ASE_MSA, ISA_MIPS64R6, CPU_MIPS64R6},
diff --git a/gas/configure b/gas/configure
index 60c1a055ae..59d6d11215 100755
index 5bccfd9d1b7..d4b13e6fc8b 100755
--- a/gas/configure
+++ b/gas/configure
@@ -12722,6 +12722,9 @@ _ACEOF
@@ -199,7 +199,7 @@ index 60c1a055ae..59d6d11215 100755
mips_cpu=r3900
;;
diff --git a/gas/configure.ac b/gas/configure.ac
index 6f32e55a1a..11c2e0d273 100644
index b65108fecb2..ce1f2dad9bc 100644
--- a/gas/configure.ac
+++ b/gas/configure.ac
@@ -325,6 +325,9 @@ changequote([,])dnl
@@ -213,7 +213,7 @@ index 6f32e55a1a..11c2e0d273 100644
mips_cpu=r3900
;;
diff --git a/include/elf/mips.h b/include/elf/mips.h
index d116b036b6..dceeb3f156 100644
index cc08ebd4318..bb518575ce1 100644
--- a/include/elf/mips.h
+++ b/include/elf/mips.h
@@ -290,6 +290,7 @@ END_RELOC_NUMBERS (R_MIPS_maxext)
@@ -225,7 +225,7 @@ index d116b036b6..dceeb3f156 100644
#define E_MIPS_MACH_OCTEON3 0x008e0000
#define E_MIPS_MACH_5400 0x00910000
diff --git a/include/opcode/mips.h b/include/opcode/mips.h
index fd031f3758..a96a44df84 100644
index fd031f37588..a96a44df840 100644
--- a/include/opcode/mips.h
+++ b/include/opcode/mips.h
@@ -1260,6 +1260,8 @@ static const unsigned int mips_isa_table[] = {
@@ -256,10 +256,10 @@ index fd031f3758..a96a44df84 100644
return FALSE;
}
diff --git a/ld/configure.tgt b/ld/configure.tgt
index f4f0eaf9b2..0da3eca19c 100644
index 9b4bf2ca964..f6d7171dff7 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -520,6 +520,9 @@ mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
@@ -510,6 +510,9 @@ mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
targ_emul=elf32btsmip
targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
;;
@@ -270,7 +270,7 @@ index f4f0eaf9b2..0da3eca19c 100644
targ_extra_emuls="elf32lr5900"
targ_extra_libpath=$targ_extra_emuls
diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
index 755bbe294b..ce22ef683a 100644
index 755bbe294bd..ce22ef683a6 100644
--- a/opcodes/mips-dis.c
+++ b/opcodes/mips-dis.c
@@ -674,13 +674,11 @@ const struct mips_arch_choice mips_arch_choices[] =
@@ -293,7 +293,7 @@ index 755bbe294b..ce22ef683a 100644
/* This entry, mips16, is here only for ISA/processor selection; do
not print its name. */
diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
index 5270aeefa8..d17dc78cd7 100644
index 5270aeefa80..d17dc78cd71 100644
--- a/opcodes/mips-opc.c
+++ b/opcodes/mips-opc.c
@@ -328,6 +328,7 @@ decode_mips_operand (const char *p)
@@ -404,3 +404,6 @@ index 5270aeefa8..d17dc78cd7 100644
{"swc0", "E,o(b)", 0xe0000000, 0xfc000000, RD_3|RD_C0|SM, 0, I1, 0, IOCT|IOCTP|IOCT2|I37 },
{"swc0", "E,A(b)", 0, (int) M_SWC0_AB, INSN_MACRO, 0, I1, 0, IOCT|IOCTP|IOCT2|I37 },
{"swc1", "T,o(b)", 0xe4000000, 0xfc000000, RD_1|RD_3|SM|FP_S, 0, I1, 0, 0 },
--
2.28.0

View File

@@ -0,0 +1,37 @@
From 7836f8aa56ef0f18c8658dc7e4952a9d097ba7e8 Mon Sep 17 00:00:00 2001
From: Zhenhua Luo <zhenhua.luo@nxp.com>
Date: Sat, 11 Jun 2016 22:08:29 -0500
Subject: [PATCH 11/17] fix the incorrect assembling for ppc wait mnemonic
Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com>
Upstream-Status: Pending
---
opcodes/ppc-opc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index 5e20d617664..4c9656ecf08 100644
--- a/opcodes/ppc-opc.c
+++ b/opcodes/ppc-opc.c
@@ -6265,8 +6265,6 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{"waitasec", X(31,30), XRTRARB_MASK, POWER8, POWER9, {0}},
{"waitrsv", XWCPL(31,30,1,0),0xffffffff, POWER10, 0, {0}},
{"pause_short", XWCPL(31,30,2,0),0xffffffff, POWER10, 0, {0}},
-{"wait", X(31,30), XWCPL_MASK, POWER10, 0, {WC, PL}},
-{"wait", X(31,30), XWC_MASK, POWER9, POWER10, {WC}},
{"lwepx", X(31,31), X_MASK, E500MC|PPCA2, 0, {RT, RA0, RB}},
@@ -6326,7 +6324,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{"waitrsv", X(31,62)|(1<<21), 0xffffffff, E500MC|PPCA2, 0, {0}},
{"waitimpl", X(31,62)|(2<<21), 0xffffffff, E500MC|PPCA2, 0, {0}},
-{"wait", X(31,62), XWC_MASK, E500MC|PPCA2, 0, {WC}},
+{"wait", X(31,62), XWC_MASK, E500MC|PPCA2|POWER9|POWER10, 0, {WC}},
{"dcbstep", XRT(31,63,0), XRT_MASK, E500MC|PPCA2, 0, {RA0, RB}},
--
2.28.0

View File

@@ -1,7 +1,7 @@
From 2f7f2389764ef1d699f6ad32057314024b7e84e7 Mon Sep 17 00:00:00 2001
From dbff6bdf2123f5495b8be930304d9aa5e88006a7 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 31 Mar 2017 11:42:03 -0700
Subject: [PATCH] Detect 64-bit MIPS targets
Subject: [PATCH 12/17] Detect 64-bit MIPS targets
Add mips64 target triplets and default to N64
@@ -14,7 +14,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 14 insertions(+)
diff --git a/gold/configure.tgt b/gold/configure.tgt
index aa7ec552ae..470515062e 100644
index aa7ec552aec..470515062e4 100644
--- a/gold/configure.tgt
+++ b/gold/configure.tgt
@@ -153,6 +153,13 @@ aarch64*-*)
@@ -45,3 +45,6 @@ index aa7ec552ae..470515062e 100644
mips*-*-*)
targ_obj=mips
targ_machine=EM_MIPS
--
2.28.0

View File

@@ -1,33 +0,0 @@
From ef4ad1cb9ff1b5a871ffa792a71b3ad6d14eb3dc Mon Sep 17 00:00:00 2001
From: Zhenhua Luo <zhenhua.luo@nxp.com>
Date: Sat, 11 Jun 2016 22:08:29 -0500
Subject: [PATCH] fix the incorrect assembling for ppc wait mnemonic
Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com>
Upstream-Status: Pending
---
opcodes/ppc-opc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index 7ef91d819b..145953d3c4 100644
--- a/opcodes/ppc-opc.c
+++ b/opcodes/ppc-opc.c
@@ -5709,7 +5709,6 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{"ldepx", X(31,29), X_MASK, E500MC|PPCA2, 0, {RT, RA0, RB}},
{"waitasec", X(31,30), XRTRARB_MASK, POWER8, POWER9, {0}},
-{"wait", X(31,30), XWC_MASK, POWER9, 0, {WC}},
{"lwepx", X(31,31), X_MASK, E500MC|PPCA2, 0, {RT, RA0, RB}},
@@ -5763,7 +5762,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{"waitrsv", X(31,62)|(1<<21), 0xffffffff, E500MC|PPCA2, 0, {0}},
{"waitimpl", X(31,62)|(2<<21), 0xffffffff, E500MC|PPCA2, 0, {0}},
-{"wait", X(31,62), XWC_MASK, E500MC|PPCA2, 0, {WC}},
+{"wait", X(31,62), XWC_MASK, E500MC|PPCA2|POWER9, 0, {WC}},
{"dcbstep", XRT(31,63,0), XRT_MASK, E500MC|PPCA2, 0, {RA0, RB}},

View File

@@ -1,7 +1,7 @@
From 70f3f2d9e912ea777fa113e02cdbc3465a66e40d Mon Sep 17 00:00:00 2001
From f791a5d84475c02356f16679b7f4ee9c9c3408aa Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 2 Mar 2015 01:42:38 +0000
Subject: [PATCH] Fix rpath in libtool when sysroot is enabled
Subject: [PATCH 14/17] Fix rpath in libtool when sysroot is enabled
Enabling sysroot support in libtool exposed a bug where the final
library had an RPATH encoded into it which still pointed to the
@@ -19,7 +19,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/ltmain.sh b/ltmain.sh
index 70e856e065..11ee684ccc 100644
index 70e856e0659..11ee684cccf 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -8035,9 +8035,11 @@ EOF
@@ -47,3 +47,6 @@ index 70e856e065..11ee684ccc 100644
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
--
2.28.0

View File

@@ -1,7 +1,7 @@
From 392d474a72d37b669f53ab9f0fa913b958af93f6 Mon Sep 17 00:00:00 2001
From e087f96e219d47c4d2244c3f32397e56d41bfdec Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@intel.com>
Date: Mon, 6 Mar 2017 23:33:27 -0800
Subject: [PATCH] sync with OE libtool changes
Subject: [PATCH 15/17] sync with OE libtool changes
Apply these patches from our libtool patches as not only are redundant RPATHs a
waste of space but they can cause incorrect linking when native packages are
@@ -26,7 +26,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 28 insertions(+), 6 deletions(-)
diff --git a/ltmain.sh b/ltmain.sh
index 11ee684ccc..3b19ac1532 100644
index 11ee684cccf..3b19ac15328 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -8053,8 +8053,16 @@ EOF
@@ -84,3 +84,6 @@ index 11ee684ccc..3b19ac1532 100644
fi
elif test -n "$runpath_var"; then
case "$finalize_perm_rpath " in
--
2.28.0

View File

@@ -1,7 +1,7 @@
From 67590a44c1256491fa674426f0170d5d05377d05 Mon Sep 17 00:00:00 2001
From ae5a7d622dc9addb2ca9fc85889c45964c025a9c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 15 Apr 2020 14:17:20 -0700
Subject: [PATCH 16/16] Check for clang before checking gcc version
Subject: [PATCH 16/17] Check for clang before checking gcc version
Clang advertises itself to be gcc 4.2.1, so when compiling this test
here fails since gcc < 4.4.5 did not support -static-libstdc++ but thats
@@ -18,10 +18,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 590b03c2da0..46f116fdb54 100755
index 6782f8b6ab8..72f5766b363 100755
--- a/configure
+++ b/configure
@@ -5140,7 +5140,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
@@ -5143,7 +5143,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -31,10 +31,10 @@ index 590b03c2da0..46f116fdb54 100755
#endif
int main() {}
diff --git a/configure.ac b/configure.ac
index d3f85e6f5d5..c0eb1343121 100644
index 55beb1dea46..3f9e613e2d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1309,7 +1309,7 @@ if test "$GCC" = yes; then
@@ -1312,7 +1312,7 @@ if test "$GCC" = yes; then
AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
AC_LANG_PUSH(C++)
AC_LINK_IFELSE([AC_LANG_SOURCE([
@@ -44,5 +44,5 @@ index d3f85e6f5d5..c0eb1343121 100644
#endif
int main() {}])],
--
2.26.1
2.28.0

View File

@@ -0,0 +1,42 @@
From 5b61c40c34c3db699de723c3128ba704501ccdac Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 20 Apr 2020 14:23:57 -0700
Subject: [PATCH 17/17] Do not emit R_RISCV_NONE reloc in the extra unused
reloc space.
Redundant R_RISCV_DTPMOD* R_RISCV_DTPREL* results from Global Dynamic -> Local Exec relaxation
which generates
Patch from https://sourceware.org/bugzilla/show_bug.cgi?id=24673
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
bfd/elfnn-riscv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index a5fa415309a..1e582052aa9 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -2090,13 +2090,14 @@ riscv_elf_relocate_section (bfd *output_bfd,
pic = bfd_link_pic (info);
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, pic, h)
- && (!pic || !SYMBOL_REFERENCES_LOCAL (info, h)))
+ && (bfd_link_dll (info)
+ || !SYMBOL_REFERENCES_LOCAL (info, h)))
indx = h->dynindx;
}
/* The GOT entries have not been initialized yet. Do it
now, and emit any relocations. */
- if ((bfd_link_pic (info) || indx != 0)
+ if ((bfd_link_dll (info) || indx != 0)
&& (h == NULL
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak))
--
2.28.0

View File

@@ -1,61 +0,0 @@
From 57a3e055605b28a9449b1b27eda7125737c42b00 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <siarheit@google.com>
Date: Sat, 1 Feb 2020 23:16:11 +0000
Subject: [PATCH] binutils: drop redundant 'program_name' definition
(-fno-common)
* coffdump.c (program_name): Drop redundant definition.
* srconv.c (program_name): Likewise
* sysdump.c (program_name): Likewise
Upstream-Status: Backport (commit 0b398d69ac)
Signed-off-by: Sergei Trofimovich <siarheit@google.com>
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
---
binutils/coffdump.c | 2 --
binutils/srconv.c | 2 --
binutils/sysdump.c | 2 --
3 files changed, 6 deletions(-)
diff --git a/binutils/coffdump.c b/binutils/coffdump.c
index 531a4e46c3..336da57ca2 100644
--- a/binutils/coffdump.c
+++ b/binutils/coffdump.c
@@ -456,8 +456,6 @@ coff_dump (struct coff_ofile *ptr)
dump_coff_section (ptr->sections + i);
}
-char * program_name;
-
static void
show_usage (FILE *file, int status)
{
diff --git a/binutils/srconv.c b/binutils/srconv.c
index 5742b16759..f071794f0a 100644
--- a/binutils/srconv.c
+++ b/binutils/srconv.c
@@ -1687,8 +1687,6 @@ prescan (struct coff_ofile *otree)
}
}
-char *program_name;
-
ATTRIBUTE_NORETURN static void
show_usage (FILE *ffile, int status)
{
diff --git a/binutils/sysdump.c b/binutils/sysdump.c
index d433e71ed9..7eebbd61d3 100644
--- a/binutils/sysdump.c
+++ b/binutils/sysdump.c
@@ -633,8 +633,6 @@ module (void)
}
}
-char *program_name;
-
ATTRIBUTE_NORETURN static void
show_usage (FILE *ffile, int status)
{
--
2.26.2

View File

@@ -1,549 +0,0 @@
From ae531041c7c5956672342f89c486a011c84f027f Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 11 Mar 2020 09:46:19 -0700
Subject: [PATCH 1/1] i386: Generate lfence with load/indirect branch/ret
[CVE-2020-0551]
Add 3 command-line options to generate lfence for load, indirect near
branch and ret to help mitigate:
https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00334.html
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-0551
1. -mlfence-after-load=[no|yes]:
-mlfence-after-load=yes generates lfence after load instructions.
2. -mlfence-before-indirect-branch=[none|all|memory|register]:
a. -mlfence-before-indirect-branch=all generates lfence before indirect
near branches via register and a warning before indirect near branches
via memory.
b. -mlfence-before-indirect-branch=memory issue a warning before
indirect near branches via memory.
c. -mlfence-before-indirect-branch=register generates lfence before
indirect near branches via register.
Note that lfence won't be generated before indirect near branches via
register with -mlfence-after-load=yes since lfence will be generated
after loading branch target register.
3. -mlfence-before-ret=[none|or|not]
a. -mlfence-before-ret=or generates or with lfence before ret.
b. -mlfence-before-ret=not generates not with lfence before ret.
A warning will be issued and lfence won't be generated before indirect
near branch and ret if the previous item is a prefix or a constant
directive, which may be used to hardcode an instruction, since there
is no clear instruction boundary.
* config/tc-i386.c (lfence_after_load): New.
(lfence_before_indirect_branch_kind): New.
(lfence_before_indirect_branch): New.
(lfence_before_ret_kind): New.
(lfence_before_ret): New.
(last_insn): New.
(load_insn_p): New.
(insert_lfence_after): New.
(insert_lfence_before): New.
(md_assemble): Call insert_lfence_before and insert_lfence_after.
Set last_insn.
(OPTION_MLFENCE_AFTER_LOAD): New.
(OPTION_MLFENCE_BEFORE_INDIRECT_BRANCH): New.
(OPTION_MLFENCE_BEFORE_RET): New.
(md_longopts): Add -mlfence-after-load=,
-mlfence-before-indirect-branch= and -mlfence-before-ret=.
(md_parse_option): Handle -mlfence-after-load=,
-mlfence-before-indirect-branch= and -mlfence-before-ret=.
(md_show_usage): Display -mlfence-after-load=,
-mlfence-before-indirect-branch= and -mlfence-before-ret=.
(i386_cons_align): New.
* config/tc-i386.h (i386_cons_align): New.
(md_cons_align): New.
* doc/c-i386.texi: Document -mlfence-after-load=,
-mlfence-before-indirect-branch= and -mlfence-before-ret=.
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ae531041c7c5956672342f89c486a011c84f027f]
CVE: CVE-2020-0551
---
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index b020f39c863..09063f784b7 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -629,7 +629,29 @@ static int omit_lock_prefix = 0;
"lock addl $0, (%{re}sp)". */
static int avoid_fence = 0;
-/* Type of the previous instruction. */
+/* 1 if lfence should be inserted after every load. */
+static int lfence_after_load = 0;
+
+/* Non-zero if lfence should be inserted before indirect branch. */
+static enum lfence_before_indirect_branch_kind
+ {
+ lfence_branch_none = 0,
+ lfence_branch_register,
+ lfence_branch_memory,
+ lfence_branch_all
+ }
+lfence_before_indirect_branch;
+
+/* Non-zero if lfence should be inserted before ret. */
+static enum lfence_before_ret_kind
+ {
+ lfence_before_ret_none = 0,
+ lfence_before_ret_not,
+ lfence_before_ret_or
+ }
+lfence_before_ret;
+
+/* Types of previous instruction is .byte or prefix. */
static struct
{
segT seg;
@@ -4311,6 +4333,283 @@ optimize_encoding (void)
}
}
+/* Return non-zero for load instruction. */
+
+static int
+load_insn_p (void)
+{
+ unsigned int dest;
+ int any_vex_p = is_any_vex_encoding (&i.tm);
+ unsigned int base_opcode = i.tm.base_opcode | 1;
+
+ if (!any_vex_p)
+ {
+ /* lea */
+ if (i.tm.base_opcode == 0x8d)
+ return 0;
+
+ /* pop */
+ if ((i.tm.base_opcode & ~7) == 0x58
+ || (i.tm.base_opcode == 0x8f && i.tm.extension_opcode == 0))
+ return 1;
+
+ /* movs, cmps, lods, scas. */
+ if ((i.tm.base_opcode | 0xb) == 0xaf)
+ return 1;
+
+ /* outs */
+ if (base_opcode == 0x6f)
+ return 1;
+ }
+
+ /* No memory operand. */
+ if (!i.mem_operands)
+ return 0;
+
+ if (any_vex_p)
+ {
+ /* vldmxcsr. */
+ if (i.tm.base_opcode == 0xae
+ && i.tm.opcode_modifier.vex
+ && i.tm.opcode_modifier.vexopcode == VEX0F
+ && i.tm.extension_opcode == 2)
+ return 1;
+ }
+ else
+ {
+ /* test, not, neg, mul, imul, div, idiv. */
+ if ((i.tm.base_opcode == 0xf6 || i.tm.base_opcode == 0xf7)
+ && i.tm.extension_opcode != 1)
+ return 1;
+
+ /* inc, dec. */
+ if (base_opcode == 0xff && i.tm.extension_opcode <= 1)
+ return 1;
+
+ /* add, or, adc, sbb, and, sub, xor, cmp. */
+ if (i.tm.base_opcode >= 0x80 && i.tm.base_opcode <= 0x83)
+ return 1;
+
+ /* bt, bts, btr, btc. */
+ if (i.tm.base_opcode == 0xfba
+ && (i.tm.extension_opcode >= 4 && i.tm.extension_opcode <= 7))
+ return 1;
+
+ /* rol, ror, rcl, rcr, shl/sal, shr, sar. */
+ if ((base_opcode == 0xc1
+ || (i.tm.base_opcode >= 0xd0 && i.tm.base_opcode <= 0xd3))
+ && i.tm.extension_opcode != 6)
+ return 1;
+
+ /* cmpxchg8b, cmpxchg16b, xrstors. */
+ if (i.tm.base_opcode == 0xfc7
+ && (i.tm.extension_opcode == 1 || i.tm.extension_opcode == 3))
+ return 1;
+
+ /* fxrstor, ldmxcsr, xrstor. */
+ if (i.tm.base_opcode == 0xfae
+ && (i.tm.extension_opcode == 1
+ || i.tm.extension_opcode == 2
+ || i.tm.extension_opcode == 5))
+ return 1;
+
+ /* lgdt, lidt, lmsw. */
+ if (i.tm.base_opcode == 0xf01
+ && (i.tm.extension_opcode == 2
+ || i.tm.extension_opcode == 3
+ || i.tm.extension_opcode == 6))
+ return 1;
+
+ /* vmptrld */
+ if (i.tm.base_opcode == 0xfc7
+ && i.tm.extension_opcode == 6)
+ return 1;
+
+ /* Check for x87 instructions. */
+ if (i.tm.base_opcode >= 0xd8 && i.tm.base_opcode <= 0xdf)
+ {
+ /* Skip fst, fstp, fstenv, fstcw. */
+ if (i.tm.base_opcode == 0xd9
+ && (i.tm.extension_opcode == 2
+ || i.tm.extension_opcode == 3
+ || i.tm.extension_opcode == 6
+ || i.tm.extension_opcode == 7))
+ return 0;
+
+ /* Skip fisttp, fist, fistp, fstp. */
+ if (i.tm.base_opcode == 0xdb
+ && (i.tm.extension_opcode == 1
+ || i.tm.extension_opcode == 2
+ || i.tm.extension_opcode == 3
+ || i.tm.extension_opcode == 7))
+ return 0;
+
+ /* Skip fisttp, fst, fstp, fsave, fstsw. */
+ if (i.tm.base_opcode == 0xdd
+ && (i.tm.extension_opcode == 1
+ || i.tm.extension_opcode == 2
+ || i.tm.extension_opcode == 3
+ || i.tm.extension_opcode == 6
+ || i.tm.extension_opcode == 7))
+ return 0;
+
+ /* Skip fisttp, fist, fistp, fbstp, fistp. */
+ if (i.tm.base_opcode == 0xdf
+ && (i.tm.extension_opcode == 1
+ || i.tm.extension_opcode == 2
+ || i.tm.extension_opcode == 3
+ || i.tm.extension_opcode == 6
+ || i.tm.extension_opcode == 7))
+ return 0;
+
+ return 1;
+ }
+ }
+
+ dest = i.operands - 1;
+
+ /* Check fake imm8 operand and 3 source operands. */
+ if ((i.tm.opcode_modifier.immext
+ || i.tm.opcode_modifier.vexsources == VEX3SOURCES)
+ && i.types[dest].bitfield.imm8)
+ dest--;
+
+ /* add, or, adc, sbb, and, sub, xor, cmp, test, xchg, xadd */
+ if (!any_vex_p
+ && (base_opcode == 0x1
+ || base_opcode == 0x9
+ || base_opcode == 0x11
+ || base_opcode == 0x19
+ || base_opcode == 0x21
+ || base_opcode == 0x29
+ || base_opcode == 0x31
+ || base_opcode == 0x39
+ || (i.tm.base_opcode >= 0x84 && i.tm.base_opcode <= 0x87)
+ || base_opcode == 0xfc1))
+ return 1;
+
+ /* Check for load instruction. */
+ return (i.types[dest].bitfield.class != ClassNone
+ || i.types[dest].bitfield.instance == Accum);
+}
+
+/* Output lfence, 0xfaee8, after instruction. */
+
+static void
+insert_lfence_after (void)
+{
+ if (lfence_after_load && load_insn_p ())
+ {
+ char *p = frag_more (3);
+ *p++ = 0xf;
+ *p++ = 0xae;
+ *p = 0xe8;
+ }
+}
+
+/* Output lfence, 0xfaee8, before instruction. */
+
+static void
+insert_lfence_before (void)
+{
+ char *p;
+
+ if (is_any_vex_encoding (&i.tm))
+ return;
+
+ if (i.tm.base_opcode == 0xff
+ && (i.tm.extension_opcode == 2 || i.tm.extension_opcode == 4))
+ {
+ /* Insert lfence before indirect branch if needed. */
+
+ if (lfence_before_indirect_branch == lfence_branch_none)
+ return;
+
+ if (i.operands != 1)
+ abort ();
+
+ if (i.reg_operands == 1)
+ {
+ /* Indirect branch via register. Don't insert lfence with
+ -mlfence-after-load=yes. */
+ if (lfence_after_load
+ || lfence_before_indirect_branch == lfence_branch_memory)
+ return;
+ }
+ else if (i.mem_operands == 1
+ && lfence_before_indirect_branch != lfence_branch_register)
+ {
+ as_warn (_("indirect `%s` with memory operand should be avoided"),
+ i.tm.name);
+ return;
+ }
+ else
+ return;
+
+ if (last_insn.kind != last_insn_other
+ && last_insn.seg == now_seg)
+ {
+ as_warn_where (last_insn.file, last_insn.line,
+ _("`%s` skips -mlfence-before-indirect-branch on `%s`"),
+ last_insn.name, i.tm.name);
+ return;
+ }
+
+ p = frag_more (3);
+ *p++ = 0xf;
+ *p++ = 0xae;
+ *p = 0xe8;
+ return;
+ }
+
+ /* Output or/not and lfence before ret. */
+ if (lfence_before_ret != lfence_before_ret_none
+ && (i.tm.base_opcode == 0xc2
+ || i.tm.base_opcode == 0xc3
+ || i.tm.base_opcode == 0xca
+ || i.tm.base_opcode == 0xcb))
+ {
+ if (last_insn.kind != last_insn_other
+ && last_insn.seg == now_seg)
+ {
+ as_warn_where (last_insn.file, last_insn.line,
+ _("`%s` skips -mlfence-before-ret on `%s`"),
+ last_insn.name, i.tm.name);
+ return;
+ }
+ if (lfence_before_ret == lfence_before_ret_or)
+ {
+ /* orl: 0x830c2400. */
+ p = frag_more ((flag_code == CODE_64BIT ? 1 : 0) + 4 + 3);
+ if (flag_code == CODE_64BIT)
+ *p++ = 0x48;
+ *p++ = 0x83;
+ *p++ = 0xc;
+ *p++ = 0x24;
+ *p++ = 0x0;
+ }
+ else
+ {
+ p = frag_more ((flag_code == CODE_64BIT ? 2 : 0) + 6 + 3);
+ /* notl: 0xf71424. */
+ if (flag_code == CODE_64BIT)
+ *p++ = 0x48;
+ *p++ = 0xf7;
+ *p++ = 0x14;
+ *p++ = 0x24;
+ /* notl: 0xf71424. */
+ if (flag_code == CODE_64BIT)
+ *p++ = 0x48;
+ *p++ = 0xf7;
+ *p++ = 0x14;
+ *p++ = 0x24;
+ }
+ *p++ = 0xf;
+ *p++ = 0xae;
+ *p = 0xe8;
+ }
+}
+
/* This is the guts of the machine-dependent assembler. LINE points to a
machine dependent instruction. This function is supposed to emit
the frags/bytes it assembles to. */
@@ -4628,9 +4927,13 @@ md_assemble (char *line)
if (i.rex != 0)
add_prefix (REX_OPCODE | i.rex);
+ insert_lfence_before ();
+
/* We are ready to output the insn. */
output_insn ();
+ insert_lfence_after ();
+
last_insn.seg = now_seg;
if (i.tm.opcode_modifier.isprefix)
@@ -12250,6 +12553,9 @@ const char *md_shortopts = "qnO::";
#define OPTION_MALIGN_BRANCH_PREFIX_SIZE (OPTION_MD_BASE + 28)
#define OPTION_MALIGN_BRANCH (OPTION_MD_BASE + 29)
#define OPTION_MBRANCHES_WITH_32B_BOUNDARIES (OPTION_MD_BASE + 30)
+#define OPTION_MLFENCE_AFTER_LOAD (OPTION_MD_BASE + 31)
+#define OPTION_MLFENCE_BEFORE_INDIRECT_BRANCH (OPTION_MD_BASE + 32)
+#define OPTION_MLFENCE_BEFORE_RET (OPTION_MD_BASE + 33)
struct option md_longopts[] =
{
@@ -12289,6 +12595,10 @@ struct option md_longopts[] =
{"malign-branch-prefix-size", required_argument, NULL, OPTION_MALIGN_BRANCH_PREFIX_SIZE},
{"malign-branch", required_argument, NULL, OPTION_MALIGN_BRANCH},
{"mbranches-within-32B-boundaries", no_argument, NULL, OPTION_MBRANCHES_WITH_32B_BOUNDARIES},
+ {"mlfence-after-load", required_argument, NULL, OPTION_MLFENCE_AFTER_LOAD},
+ {"mlfence-before-indirect-branch", required_argument, NULL,
+ OPTION_MLFENCE_BEFORE_INDIRECT_BRANCH},
+ {"mlfence-before-ret", required_argument, NULL, OPTION_MLFENCE_BEFORE_RET},
{"mamd64", no_argument, NULL, OPTION_MAMD64},
{"mintel64", no_argument, NULL, OPTION_MINTEL64},
{NULL, no_argument, NULL, 0}
@@ -12668,6 +12978,41 @@ md_parse_option (int c, const char *arg)
as_fatal (_("invalid -mfence-as-lock-add= option: `%s'"), arg);
break;
+ case OPTION_MLFENCE_AFTER_LOAD:
+ if (strcasecmp (arg, "yes") == 0)
+ lfence_after_load = 1;
+ else if (strcasecmp (arg, "no") == 0)
+ lfence_after_load = 0;
+ else
+ as_fatal (_("invalid -mlfence-after-load= option: `%s'"), arg);
+ break;
+
+ case OPTION_MLFENCE_BEFORE_INDIRECT_BRANCH:
+ if (strcasecmp (arg, "all") == 0)
+ lfence_before_indirect_branch = lfence_branch_all;
+ else if (strcasecmp (arg, "memory") == 0)
+ lfence_before_indirect_branch = lfence_branch_memory;
+ else if (strcasecmp (arg, "register") == 0)
+ lfence_before_indirect_branch = lfence_branch_register;
+ else if (strcasecmp (arg, "none") == 0)
+ lfence_before_indirect_branch = lfence_branch_none;
+ else
+ as_fatal (_("invalid -mlfence-before-indirect-branch= option: `%s'"),
+ arg);
+ break;
+
+ case OPTION_MLFENCE_BEFORE_RET:
+ if (strcasecmp (arg, "or") == 0)
+ lfence_before_ret = lfence_before_ret_or;
+ else if (strcasecmp (arg, "not") == 0)
+ lfence_before_ret = lfence_before_ret_not;
+ else if (strcasecmp (arg, "none") == 0)
+ lfence_before_ret = lfence_before_ret_none;
+ else
+ as_fatal (_("invalid -mlfence-before-ret= option: `%s'"),
+ arg);
+ break;
+
case OPTION_MRELAX_RELOCATIONS:
if (strcasecmp (arg, "yes") == 0)
generate_relax_relocations = 1;
@@ -13025,6 +13370,15 @@ md_show_usage (FILE *stream)
-mbranches-within-32B-boundaries\n\
align branches within 32 byte boundary\n"));
fprintf (stream, _("\
+ -mlfence-after-load=[no|yes] (default: no)\n\
+ generate lfence after load\n"));
+ fprintf (stream, _("\
+ -mlfence-before-indirect-branch=[none|all|register|memory] (default: none)\n\
+ generate lfence before indirect near branch\n"));
+ fprintf (stream, _("\
+ -mlfence-before-ret=[none|or|not] (default: none)\n\
+ generate lfence before ret\n"));
+ fprintf (stream, _("\
-mamd64 accept only AMD64 ISA [default]\n"));
fprintf (stream, _("\
-mintel64 accept only Intel64 ISA\n"));
@@ -13254,6 +13608,16 @@ i386_cons_align (int ignore ATTRIBUTE_UNUSED)
last_insn.kind = last_insn_directive;
last_insn.name = "constant directive";
last_insn.file = as_where (&last_insn.line);
+ if (lfence_before_ret != lfence_before_ret_none)
+ {
+ if (lfence_before_indirect_branch != lfence_branch_none)
+ as_warn (_("constant directive skips -mlfence-before-ret "
+ "and -mlfence-before-indirect-branch"));
+ else
+ as_warn (_("constant directive skips -mlfence-before-ret"));
+ }
+ else if (lfence_before_indirect_branch != lfence_branch_none)
+ as_warn (_("constant directive skips -mlfence-before-indirect-branch"));
}
}
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index c536759cb38..1dd99f91bb0 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -464,6 +464,49 @@ on an instruction. It is equivalent to
@option{-malign-branch-prefix-size=5}.
The default doesn't align branches.
+@cindex @samp{-mlfence-after-load=} option, i386
+@cindex @samp{-mlfence-after-load=} option, x86-64
+@item -mlfence-after-load=@var{no}
+@itemx -mlfence-after-load=@var{yes}
+These options control whether the assembler should generate lfence
+after load instructions. @option{-mlfence-after-load=@var{yes}} will
+generate lfence. @option{-mlfence-after-load=@var{no}} will not generate
+lfence, which is the default.
+
+@cindex @samp{-mlfence-before-indirect-branch=} option, i386
+@cindex @samp{-mlfence-before-indirect-branch=} option, x86-64
+@item -mlfence-before-indirect-branch=@var{none}
+@item -mlfence-before-indirect-branch=@var{all}
+@item -mlfence-before-indirect-branch=@var{register}
+@itemx -mlfence-before-indirect-branch=@var{memory}
+These options control whether the assembler should generate lfence
+after indirect near branch instructions.
+@option{-mlfence-before-indirect-branch=@var{all}} will generate lfence
+after indirect near branch via register and issue a warning before
+indirect near branch via memory.
+@option{-mlfence-before-indirect-branch=@var{register}} will generate
+lfence after indirect near branch via register.
+@option{-mlfence-before-indirect-branch=@var{memory}} will issue a
+warning before indirect near branch via memory.
+@option{-mlfence-before-indirect-branch=@var{none}} will not generate
+lfence nor issue warning, which is the default. Note that lfence won't
+be generated before indirect near branch via register with
+@option{-mlfence-after-load=@var{yes}} since lfence will be generated
+after loading branch target register.
+
+@cindex @samp{-mlfence-before-ret=} option, i386
+@cindex @samp{-mlfence-before-ret=} option, x86-64
+@item -mlfence-before-ret=@var{none}
+@item -mlfence-before-ret=@var{or}
+@itemx -mlfence-before-ret=@var{not}
+These options control whether the assembler should generate lfence
+before ret. @option{-mlfence-before-ret=@var{or}} will generate
+generate or instruction with lfence.
+@option{-mlfence-before-ret=@var{not}} will generate not instruction
+with lfence.
+@option{-mlfence-before-ret=@var{none}} will not generate lfence,
+which is the default.
+
@cindex @samp{-mx86-used-note=} option, i386
@cindex @samp{-mx86-used-note=} option, x86-64
@item -mx86-used-note=@var{no}
--
2.18.2