Dongkyun Son [Tue, 10 May 2022 03:13:13 +0000 (12:13 +0900)]
packaging: fix error
[ 211s] Installed (but unpackaged) file(s) found:
[ 211s] /usr/lib64/libbfd.la
[ 211s] /usr/lib64/libopcodes.la
Change-Id: I1beca706e75ae1afd869d3aac04537b02c6f5123
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
Dongkyun Son [Mon, 9 May 2022 08:46:27 +0000 (17:46 +0900)]
packaging: keep shared libraries for libbfd & libopcodes
Change-Id: I48e2d9bea9fb68fd7ab2c5d766f906ce385f645b
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
H.J. Lu [Tue, 25 Feb 2020 11:30:33 +0000 (03:30 -0800)]
Don't call lto-wrapper for ar and ranlib
Since ar and ranlib don't need to know symbol types to work properly,
we should avoid calling lto-wrapper for them to speed them up.
bfd/
PR binutils/25584
* plugin.c (need_lto_wrapper_p): New.
(bfd_plugin_set_program_name): Add an int argument to set
need_lto_wrapper_p.
(get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
set.
* plugin.h (bfd_plugin_set_program_name): Add an int argument.
binutils/
PR binutils/25584
* ar.c (main): Pass 0 to bfd_plugin_set_program_name.
* nm.c (main): Pass 1 to bfd_plugin_set_program_name.
(cherry picked from commit
ecda90163e2b0a6f0be96e3fc262c28820a27211)
Change-Id: I2110670d62156392eae11af1b51b03870b6715f7
Alan Modra [Wed, 19 Feb 2020 02:40:47 +0000 (13:10 +1030)]
Adjust PR25355 testcase
* testsuite/ld-plugin/pr25355.d: Allow alpha-linux nm result.
(cherry picked from commit
2e3cd5d013cee36c5bc26c0468d471878300ed22)
Change-Id: I8cda71d27939368988ff514e28049ffa6ac8e7f8
H.J. Lu [Wed, 19 Feb 2020 11:29:51 +0000 (03:29 -0800)]
plugin: Call dlclose before return in try_load_plugin
Since plugin can be used only once in try_load_plugin, call dlclose
before return.
PR binutils/25355
* plugin.c (plugin_list_entry): Remove handle.
(try_load_plugin): Call dlclose before return.
(cherry picked from commit
dcf06b89b9129da6988878a77afdd02d3acc2e30)
Change-Id: I734f92f6e92d66db4c22dddf7b247617d42daf88
Nick Clifton [Sun, 16 Feb 2020 11:33:15 +0000 (11:33 +0000)]
Import fixes for using the LTO plugin with nm.
PR 25355
bfd:
2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
* plugin.c (try_load_plugin): Make plugin_list_iter an argument
and use it if it isn't NULL. Remove has_plugin_p argument. Add
a build_list_p argument. Don't search plugin_list. Short circuit
when building the plugin list.
(has_plugin): Renamed to has_plugin_list.
(bfd_plugin_set_plugin): Don't set has_plugin.
(bfd_plugin_specified_p): Check plugin_list instead.
(build_plugin_list): New function.
(load_plugin): Call build_plugin_list and use plugin_list.
2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/25355
* plugin.c (try_claim): Always clean up for LTO wrapper.
(try_load_plugin): Treat each object as independent. Create a
copy for plugin name.
2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
* plugin.c (add_symbols): Clear plugin_data memory.
2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/25355
* configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
(EXECUTABLE_SUFFIX): Likewise.
* config.in: Regenerated.
* configure: Likewise.
* plugin.c (bfd_plugin_close_and_cleanup): Removed.
(plugin_list_entry): Add all_symbols_read, cleanup_handler,
gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
(get_lto_wrapper): New.
(setup_lto_wrapper_env): Likewise.
(current_plugin): Likewise.
(register_all_symbols_read): Likewise.
(register_cleanup): Likewise.
(get_symbols): Likewise.
(add_input_file): Likewise.
(bfd_plugin_close_and_cleanup): Likewise.
(claim_file): Removed.
(register_claim_file): Set current_plugin->claim_file.
(add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
lto_syms in current_plugin.
(try_claim): Use current_plugin->claim_file. Call LTO plugin
all_symbols_read handler. Copy real symbols to plugin_data.
Call LTO plugin cleanup handler. Clean up for LTO wrapper.
(try_load_plugin): Don't reuse the previous plugin for LTO
wrapper. Set up GCC LTO wrapper if possible. Don't set
plugin_list_iter->claim_file.
(bfd_plugin_canonicalize_symtab): Use real LTO symbols if
possible.
* plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
real_syms.
ld:
2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/25355
* testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test.
* testsuite/ld-plugin/pr25355.c: New file.
* testsuite/ld-plugin/pr25355.d: Likewise.
* testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile
only dump.
(cherry picked from commit
804b7fd4fdc545a6ed18aee3d4186574861634ef)
Change-Id: I66c47c2ea84f7ad7cf21d090dd7179eb2659a41c
Dongkyun Son [Wed, 17 Mar 2021 11:06:40 +0000 (20:06 +0900)]
packaging: disable binutils_run_tests of cross binutils
Cross-toolchain testing is not straightforward.
Change-Id: I4670e694b4e26cf4d94786cb6c3824b9cb42cacd
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
Slava Barinov [Fri, 25 Sep 2020 09:08:27 +0000 (12:08 +0300)]
packaging: Turn off separate-code for i586
Change-Id: Id1126e73b8bbe641f3c80fc84b016bfa5df10571
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Dongkyun Son [Thu, 24 Sep 2020 06:13:49 +0000 (15:13 +0900)]
Fix error while linking Tizen Apps
cherry-picked from RS-TizenStudio/gcc-9.2/pull/10
Change-Id: I30e8222f838680785c22527ab9295bb9c2f9e902
Signed-off-by: Karthik Bhat <kv.bhat@samsung.com>
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
Andrey Kazmin [Fri, 6 Mar 2020 14:01:37 +0000 (17:01 +0300)]
Add gnu.property new C++ dual ABI compiler flag
It denotes that object file doesn't rely on any C++ ABI.
Also this flag is used to skip C++ ABI validation in linker.
Change-Id: I1ed4be997190a2ffdc4642946743ee9908a30348
Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
Andrey Kazmin [Wed, 4 Mar 2020 11:41:56 +0000 (14:41 +0300)]
Add annobin cxx11 ABI verification exception list
It could be configured via --with-annobin-cxx11-abi-exceptions option.
Also add dual C++ ABI stuff to the exception list.
Change-Id: I6b4482661c2704a6081242fc1c0a8c4932eba527
Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
Slava Barinov [Thu, 4 Jun 2020 12:08:07 +0000 (15:08 +0300)]
packaging: Add support for configure-dumper
Change-Id: Icb766cf48e675d30a5843355679be786b6e531b7
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Slava Barinov [Mon, 3 Feb 2020 15:24:21 +0000 (18:24 +0300)]
packaging: Enable testing infrastructrure
Now Binutils can be tested just like GCC package, by defining run_tests to 1
Change-Id: I10a8667985ee3cd430ea8fbdbbd06653a4d72df8
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Andrey Kazmin [Thu, 23 Jan 2020 15:54:15 +0000 (18:54 +0300)]
Supported Tizen version parsing and verification
Change-Id: I9fefe81e0ffbf16eed3c806a18df03e67ff668c8
Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
Simon Marchi [Wed, 16 Oct 2019 15:11:28 +0000 (11:11 -0400)]
libctf: mark swap.h inline functions as static
When building binutils with mingw-w64, I get the following errors:
make[4]: Entering directory '/home/simark/build/binutils-gdb-mingw/binutils'
/bin/sh ./libtool --tag=CC --mode=link ccache x86_64-w64-mingw32-gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wno-format -Werror -I/home/simark/src/binutils-gdb/binutils/../zlib -g3 -O0 -D__USE_MINGW_ACCESS -Wl,--stack,
12582912 -o objdump.exe objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o ../opcodes/libopcodes.la ../libctf/libctf.la ../bfd/libbfd.la ../libiberty/libiberty.a -lintl
libtool: link: ccache x86_64-w64-mingw32-gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wno-format -Werror -I/home/simark/src/binutils-gdb/binutils/../zlib -g3 -O0 -D__USE_MINGW_ACCESS -Wl,--stack -Wl,
12582912 -o .libs/objdump.exe objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o ../opcodes/.libs/libopcodes.a ../libctf/.libs/libctf.a -L/home/simark/build/binutils-gdb-mingw/zlib ../bfd/.libs/libbfd.a -lz ../libiberty/libiberty.a -lintl
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: ../libctf/.libs/libctf.a(ctf-open.o): in function `flip_header':
/home/simark/src/binutils-gdb/libctf/ctf-open.c:964: undefined reference to `bswap_16'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/simark/src/binutils-gdb/libctf/ctf-open.c:967: undefined reference to `bswap_32'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/simark/src/binutils-gdb/libctf/ctf-open.c:968: undefined reference to `bswap_32'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/simark/src/binutils-gdb/libctf/ctf-open.c:969: undefined reference to `bswap_32'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/simark/src/binutils-gdb/libctf/ctf-open.c:970: undefined reference to `bswap_32'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/simark/src/binutils-gdb/libctf/ctf-open.c:971: undefined reference to `bswap_32'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: ../libctf/.libs/libctf.a(ctf-open.o):/home/simark/src/binutils-gdb/libctf/ctf-open.c:972: more undefined references to `bswap_32' follow
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: ../libctf/.libs/libctf.a(ctf-open.o): in function `flip_types':
/home/simark/src/binutils-gdb/libctf/ctf-open.c:1112: undefined reference to `bswap_16'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/simark/src/binutils-gdb/libctf/ctf-open.c:1113: undefined reference to `bswap_16'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/simark/src/binutils-gdb/libctf/ctf-open.c:1132: undefined reference to `bswap_32'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/simark/src/binutils-gdb/libctf/ctf-open.c:1133: undefined reference to `bswap_32'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/simark/src/binutils-gdb/libctf/ctf-open.c:1134: undefined reference to `bswap_32'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/simark/src/binutils-gdb/libctf/ctf-open.c:1135: undefined reference to `bswap_32'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/simark/src/binutils-gdb/libctf/ctf-open.c:1144: undefined reference to `bswap_32'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: ../libctf/.libs/libctf.a(ctf-open.o):/home/simark/src/binutils-gdb/libctf/ctf-open.c:1145: more undefined references to `bswap_32' follow
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: ../libctf/.libs/libctf.a(ctf-open.o): in function `ctf_bufopen_internal':
/home/simark/src/binutils-gdb/libctf/ctf-open.c:1342: undefined reference to `bswap_16'
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: ../libctf/.libs/libctf.a(ctf-open-bfd.o): in function `ctf_fdopen':
/home/simark/src/binutils-gdb/libctf/ctf-open-bfd.c:268: undefined reference to `bswap_16'
Apparently [1], if we have a function with `inline` but not `static`,
there should be a compilation unit defining the symbol too.
Alternatively, making those functions `static` fixes that.
[1] https://stackoverflow.com/questions/
16245521/c99-inline-function-in-c-file/
16254679#
16254679
libctf/ChangeLog:
* swap.h (bswap_16, bswap_32, bswap_64): Make static.
(cherry picked from commit
cbbbc402e059ee345cb781d3ceb757ae1cc679ee)
Change-Id: I8fd12aedf6c90f9b7418af948e5e0bae0c32eead
Dongkyun Son [Wed, 12 Feb 2020 02:54:00 +0000 (11:54 +0900)]
configure: diabled relro by default
Change-Id: I74fa9ab77b0bb1a4a9a9a461235d929d985bd4e7
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
Dongkyun Son [Mon, 20 Jan 2020 12:18:22 +0000 (21:18 +0900)]
Revert "packaging: Add gdb packages"
This reverts commit
1173d36d74e6a3f37e14eb74fe462b2fe21097b5.
Change-Id: Ib806f5d5937aaca855c24389e18861870e26bf81
Slava Barinov [Mon, 16 Dec 2019 11:19:19 +0000 (14:19 +0300)]
packaging: Add gdb packages
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Slava Barinov [Tue, 19 Nov 2019 10:59:16 +0000 (13:59 +0300)]
packaging: version bump
Change-Id: Id27d126ac3d940e72645de8f3e6b0f81c10c04c5
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Mikhail Kashkarov [Mon, 15 Apr 2019 11:15:49 +0000 (14:15 +0300)]
Add .note.gnu.property runtime verification and merge support
- Define annobin .note.gnu.property bits for sanitization/CxxABI checks
- New configure option --enable-annobin-verification=warn|strict to enable
runtime verification support for gnu property notes.
- Add merging support for compilation flags annobin gnu notes.
- Add readelf section text for compiler properties.
Change-Id: I452029baca753f6a97ef4b7297ef9a8905a7b79c
Andrey Drobyshev [Mon, 8 Oct 2018 12:41:37 +0000 (15:41 +0300)]
ld/testing: clear compiler & linker flags when running testsuite.
Passing CLFAGS, CXXFLAGS, LDFLAGS used previously on build stage cause failures
when running "make check". It's safer to clear them.
Change-Id: If2bba2baca0f99c3931af2a55739ff6a087f2b0f
Signed-off-by: Andrey Drobyshev <a.drobyshev@partner.samsung.com>
Andrey Drobyshev [Mon, 1 Oct 2018 13:35:47 +0000 (16:35 +0300)]
packaging: fix testsuite build.
* Add list of dependent packages needed to build & run tests along with
corresponding macro run_tests;
* Add %check section.
Signed-off-by: Andrey Drobyshev <a.drobyshev@partner.samsung.com>
Change-Id: I2cc277d6855247747025a4d3b744a5c7804f4fca
Mikhail Kashkarov [Thu, 11 May 2017 09:14:51 +0000 (12:14 +0300)]
Add armv7hl support.
Change-Id: I1abc28bf90731946353b86579e85bd391c1745d3
Sangmin Seo [Wed, 9 Aug 2017 10:07:59 +0000 (19:07 +0900)]
Add ChangeLog.Tizen
ChangeLog.Tizen is to keep track of private patches for Tizen binutils.
Change-Id: I1ca9709cbf7ef92f6d4b29ca7c71782c9541f94a
Sangmin Seo [Tue, 11 Jul 2017 10:45:45 +0000 (19:45 +0900)]
ASan build fix: resolve multiple definitions.
Put "extern" to multiply-defined variables in order to make
-fno-common work.
Change-Id: Ib5a882e3c536d868e8098e385823e50ac78f2d21
Slava Barinov [Thu, 25 May 2017 08:10:06 +0000 (11:10 +0300)]
Introduce --enable-new-dtags configure option.
ld/configure --enable-new-dtags sets ld.bfd --enable-new-dtags option by
default.
The ld option switches on generation of DT_RUNPATH tag instead of DT_RPATH tag
which is deprecated and breaks LD_LIBRARY_PATH usage.
Debian binutils bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835859
* ld/configure.ac: Add --enable-new-dtags option.
* ld/ldmain.c: Set link_info.new_dtags to 1 if when --enable-new-dtags is
switched on.
* ld/configure: Regenerate.
* ld/config.in: Regenerate.
* packaging/binutils.spec: Switch on --enable-new-dtags.
* packaging/binutils-armv7l.spec: Regenerate.
* packaging/binutils-aarch64.spec: Regenerate.
Change-Id: I0ec86f61a8b97d55c29bb441a9ae4db94060ea22
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Slava Barinov [Mon, 27 Feb 2017 11:29:01 +0000 (14:29 +0300)]
2.27 version
Yury Usishchev [Wed, 15 Jul 2015 17:06:43 +0000 (20:06 +0300)]
Ignore broken plugins
Allow cross-configured ld to ignore plugins that cannot be dlopened
Change-Id: I0bbca32123aeba869d843fdfb9179815af888f5c
Signed-off-by: Yury Usishchev <y.usishchev@samsung.com>
Slava Barinov [Mon, 27 Feb 2017 09:57:34 +0000 (12:57 +0300)]
Packaging added.
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Nick Clifton [Sat, 12 Oct 2019 14:07:18 +0000 (15:07 +0100)]
Release 2.33.1
GDB Administrator [Sat, 12 Oct 2019 00:01:24 +0000 (00:01 +0000)]
Automatic date update in version.in
GDB Administrator [Fri, 11 Oct 2019 00:01:29 +0000 (00:01 +0000)]
Automatic date update in version.in
Alan Modra [Wed, 9 Oct 2019 10:55:25 +0000 (21:25 +1030)]
PR25081, Discrepancy between VMA and LMA after ALIGN
The testcase in the PR has two empty output sections, .sec1 with an
ALIGN and symbol assignment, and .sec2 just with an empty input
section. The symbol assignment results in .sec1 being kept, but
because it is empty this section doesn't take space from the memory
region as you might expect from the ALIGN. Instead the next section
.sec2, has vma/lma as if .sec1 wasn't present. However, .sec2 is
discarded and os->ignored set, which unfortunately meant that dot
wasn't set from .sec2 vma. That in turn results in .sec2 lma being
set incorrectly. That vma/lma difference is then propagated to
.sec3 where it is seen as an overlap.
PR 25081
* ldlang.c (lang_size_sections_1): Set lma from section vma
rather than dot.
(cherry picked from commit
8610e0fd93ea253f9beb9ebb6e50e8807ed83327)
Szabolcs Nagy [Wed, 2 Oct 2019 18:46:46 +0000 (19:46 +0100)]
[PR ld/22263][PR ld/25056] arm: Avoid dynamic TLS relocs in PIE
Dynamic relocs are only needed in an executable for TLS symbols if
those are defined in an external module and even then TLS access
can be relaxed to use IE model instead of GD.
Several bfd_link_pic checks are turned into bfd_link_dll checks
to fix TLS handling in PIE, for the same fix some other targets
used !bfd_link_executable checks, but that includes relocatable
objects so dll seems safer (in most cases either should work, since
dynamic relocations are not applied in relocatable objects).
On arm* fixes
FAIL: Build pr22263-1
bfd/
PR ld/22263
PR ld/25056
* elf32-arm.c (elf32_arm_tls_transition): Use bfd_link_dll instead of
bfd_link_pic for TLS checks.
(elf32_arm_final_link_relocate): Likewise.
(allocate_dynrelocs_for_symbol): Likewise.
Szabolcs Nagy [Thu, 3 Oct 2019 18:11:50 +0000 (19:11 +0100)]
[PR ld/25062] arm: sign extend the addend of R_ARM_TLS_GOTDESC
On 64-bit host the 32-bit addend was loaded without sign extension into
an unsigned long.
bfd/ChangeLog:
PR ld/25062
* elf32-arm.c (elf32_arm_final_link_relocate): Sign extend data.
ld/ChangeLog:
PR ld/25062
* testsuite/ld-arm/arm-elf.exp: Update.
* testsuite/ld-arm/tls-gdesc-neg.d: New test.
* testsuite/ld-arm/tls-gdesc-neg.s: New test.
GDB Administrator [Thu, 10 Oct 2019 00:01:17 +0000 (00:01 +0000)]
Automatic date update in version.in
GDB Administrator [Wed, 9 Oct 2019 00:01:18 +0000 (00:01 +0000)]
Automatic date update in version.in
Alan Modra [Tue, 8 Oct 2019 13:41:28 +0000 (00:11 +1030)]
PR25079, "ar s" stopped working
's' is both a command and a modifier. If given as a command then we
aren't lacking an operation. I think the same goes when mri mode is
selected: any following command line used to be ignored.
PR 25079
* ar.c (decode_options): Don't try for command options if
write_armap or mri_mode is selected.
(cherry picked from commit
b7d9d3ee59236d6039d7d7ccd17ff6b47e07a8aa)
Alan Modra [Mon, 7 Oct 2019 02:51:02 +0000 (13:21 +1030)]
PowerPC TLS miscounting PLT for __tls_get_addr
ppc*_elf_tls_optimize decrements the PLT refcount for __tls_get_addr
when a GD or LD sequence can be optimized. Without tls marker relocs
this must be done when processing the argument setup relocations.
With marker relocs it's better done when processing the marker reloc.
But don't count them both ways.
Seen as "unresolvable R_PPC_REL24 relocation against symbol
`__tls_get_addr_opt'" (and other branch relocs).
* elf32-ppc.c (ppc_elf_tls_optimize): Don't process R_PPC_TLSLD
with non-local symbol. Don't double count __tls_get_addr calls
with marker relocs.
* elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
(cherry picked from commit
7d04a20ae4af0f1f6e75ec642413c27de4c1e1b8)
Alan Modra [Mon, 7 Oct 2019 02:47:59 +0000 (13:17 +1030)]
PowerPC section flag tidy
has_tls_get_addr_call is no longer named correctly as the flag is
only set on finding a __tls_get_addr call without tlsld/tlsgd marker
relocations.
* elf32-ppc.c (nomark_tls_get_addr): Rename from has_tls_get_addr_call
throughout.
* elf64-ppc.c (nomark_tls_get_addr): Likewise.
(cherry picked from commit
9737e8af48e257f24e860fbf36af8c314e73076a)
Alan Modra [Mon, 7 Oct 2019 12:44:31 +0000 (23:14 +1030)]
Re: PowerPC PIC vs. DLL TLS issues
A bug crept into commit
f749f26eea, which could cause linker
segfaults when creating PIEs. This patch fixes it.
* elf64-ppc.c (ppc64_elf_size_dynamic_sections): Do allocate
space for local got non-tls relocs when PIE.
(cherry picked from commit
93370e8e7b406cf0aeedcf57cf457c07d6a2c7e6)
Alan Modra [Thu, 3 Oct 2019 23:18:41 +0000 (08:48 +0930)]
PowerPC PIC vs. DLL TLS issues
1) GOT entries generated for any of the GOT TLS relocations don't need
dynamic relocations for locally defined symbols in PIEs. In the case
of a tls_index doubleword, the dtpmod entry is known to be 1, and the
dtprel entry is also known at link time and relative. Similarly,
dtprel and tprel words are known at link time and relative. (GOT
entries for other than TLS symbols are not relative and thus need
dynamic relocations in PIEs.)
2) Local dynamic TLS code is really only meant for accesses local to
the current binary. There was a cheapskate test for this before using
the common tlsld_got slot, but the test wasn't exactly correct and
might confuse anyone looking at the code. The proper test,
SYMBOL_REFERENCES_LOCAL isn't so expensive that it should be avoided.
3) The same cheap test for local syms when optimising TLS sequences
should be SYMBOL_REFERENCES_LOCAL too.
bfd/
* elf64-ppc.c (ppc64_elf_check_relocs): Move initialisation of vars.
(ppc64_elf_tls_optimize): Correct is_local condition.
(allocate_got): Don't reserve dynamic relocations for any of the
tls got relocs in PIEs when the symbol is local.
(allocate_dynrelocs): Correct validity test for local sym using
tlsld_got slot.
(ppc64_elf_size_dynamic_sections): Don't reserve dynamic relocations
for any of the tls got relocs in PIEs.
(ppc64_elf_layout_multitoc): Likewise.
(ppc64_elf_relocate_section): Correct validity test for local sym
using tlsld_got slot. Don't emit dynamic relocations for any of
the tls got relocs in PIEs when the symbol is local.
* elf32-ppc.c (ppc_elf_tls_optimize): Correct is_local condition.
(got_relocs_needed): Delete.
(allocate_dynrelocs): Correct validity test for local sym using
tlsld_got slot. Don't reserve dynamic relocations for any of the
tls got relocs in PIEs when the symbol is local.
(ppc_elf_size_dynamic_sections): Don't reserve dynamic relocations
for any of the tls got relocs in PIEs.
(ppc_elf_relocate_section): Correct validity test for local sym
using tlsld_got slot. Don't emit dynamic relocations for any of
the tls got relocs in PIEs when the symbol is local.
ld/
* testsuite/ld-powerpc/tlsso.d: Adjust to suit tlsld_got usage change.
* testsuite/ld-powerpc/tlsso.g: Likewise.
* testsuite/ld-powerpc/tlsso.r: Likewise.
* testsuite/ld-powerpc/tlsso32.d: Likewise.
* testsuite/ld-powerpc/tlsso32.g: Likewise.
* testsuite/ld-powerpc/tlsso32.r: Likewise.
(cherry picked from commit
f749f26eea052459c27e21d0d15f5fac060961dc)
Alan Modra [Mon, 30 Sep 2019 04:34:08 +0000 (14:04 +0930)]
PR25046, readelf "Reading xxx bytes extends past end of file for dynamic section"
PR 25046
* readelf.c (process_program_headers): Clear dynamic_addr and
dynamic_size earlier.
(cherry picked from commit
663f67df1e8a7ac0ab8c8c577817067ca32ea4be)
Alan Modra [Thu, 26 Sep 2019 06:50:35 +0000 (16:20 +0930)]
PR24262, plugin search dir doesn't respect --libdir
bfd/
PR 24262
* Makefile.am (AM_CPPFLAGS): Add -DLIBDIR.
* plugin.c (load_plugin): Search both ${libdir}/bfd-plugins and
${bindir}/../lib/bfd-plugins if different.
* Makefile.in: Regenerate.
ld/
PR 24262
* ld.texi (-plugin): Revert 2019-03-15 change.
(cherry picked from commit
41f37a6fb71f2a3de388108f5cdfca9cbe6e9d51)
GDB Administrator [Tue, 8 Oct 2019 00:02:20 +0000 (00:02 +0000)]
Automatic date update in version.in
GDB Administrator [Mon, 7 Oct 2019 00:01:23 +0000 (00:01 +0000)]
Automatic date update in version.in
GDB Administrator [Sun, 6 Oct 2019 00:02:54 +0000 (00:02 +0000)]
Automatic date update in version.in
GDB Administrator [Sat, 5 Oct 2019 00:01:15 +0000 (00:01 +0000)]
Automatic date update in version.in
Jan Beulich [Fri, 20 Sep 2019 08:18:15 +0000 (10:18 +0200)]
x86-64: fix handling of PUSH/POP of segment register
Commit
21df382b91 ("x86: fold SReg{2,3}") went too far: Folding 64-bit
PUSH/POP templates into non-64-bit ones isn't correct, due to the
different operand widths, and hence suffixes permitted. Restore the
separate templates.
Add tests of PUSH/POP with q suffix and %fs/%gs operands to the
testsuite. While doing so also add PUSHF/POPF ones _without_ suffix.
(cherry picked from commit
3f9aad111cea2f25877d0a6b404956769c14faee)
GDB Administrator [Fri, 4 Oct 2019 00:01:23 +0000 (00:01 +0000)]
Automatic date update in version.in
GDB Administrator [Thu, 3 Oct 2019 00:01:27 +0000 (00:01 +0000)]
Automatic date update in version.in
Nick Clifton [Wed, 2 Oct 2019 10:57:16 +0000 (11:57 +0100)]
Change objcopy's --set-section-alignment option so that it takes a byte alignment value rather than a power of two alignment value.
PR 24942
* objcopy.c (copy_usage): Update description of
--set-section-alignment.
(copy_main): Interpret numeric argument of --set-section-alignment
as a byte alignment, not a power of two alignment.
* doc/binutils.texi: Update description of
--set-section-alignment.
* testsuite/binutils-all/set-section-alignment.d: New test.
* testsuite/binutils-all/objcopy.exp: Run the new test.
GDB Administrator [Wed, 2 Oct 2019 00:01:15 +0000 (00:01 +0000)]
Automatic date update in version.in
GDB Administrator [Tue, 1 Oct 2019 00:01:32 +0000 (00:01 +0000)]
Automatic date update in version.in
Phil Blundell [Mon, 30 Sep 2019 10:10:14 +0000 (11:10 +0100)]
Update version number and generated files for 2.33 release.
GDB Administrator [Mon, 30 Sep 2019 00:01:50 +0000 (00:01 +0000)]
Automatic date update in version.in
GDB Administrator [Sun, 29 Sep 2019 00:02:28 +0000 (00:02 +0000)]
Automatic date update in version.in
GDB Administrator [Sat, 28 Sep 2019 00:01:20 +0000 (00:01 +0000)]
Automatic date update in version.in
GDB Administrator [Fri, 27 Sep 2019 00:01:23 +0000 (00:01 +0000)]
Automatic date update in version.in
GDB Administrator [Thu, 26 Sep 2019 00:01:38 +0000 (00:01 +0000)]
Automatic date update in version.in
Alan Modra [Tue, 24 Sep 2019 13:17:13 +0000 (22:47 +0930)]
PR25031, nm reports wrong address on 32bit
Using saved_format breaks when nm is presented with multiple object
files, some 32-bit and some 64-bit.
PR 25031
* nm.c (print_format_string): New.
(get_print_format): Delete saved_format. Move earlier.
(set_print_width): Call get_print_format.
(print_value): Use print_format_string.
(cherry picked from commit
352f6bc3e5b23e76d8e6f56fb7db4e57d8f5d5bd)
Alan Modra [Mon, 23 Sep 2019 11:00:22 +0000 (20:30 +0930)]
implicit conversion from enum ld_plugin_level to enum ld_plugin_status
This is a gcc10 warning fix.
gold/
* testsuite/plugin_new_section_layout.c (new_input_hook): Correct
return status enum values.
(cherry picked from commit
6831670dd3c0a64e332b316c95873c57ab19887a)
Alan Modra [Sun, 22 Sep 2019 23:23:07 +0000 (08:53 +0930)]
PR25018, readelf crash on 32bits
Pointer comparisons after adding an offset just don't work to catch
overflow when the offset is a larger type than the pointer.
PR 25018
* dwarf.c (get_type_signedness): Delete ineffective pointer
comparison check. Properly range check uvalue offset on
recursive call.
(read_and_display_attr_value): Range check uvalue offset before
calling get_type_signedness.
(cherry picked from commit
b3fe587ed2c78d46132bd33e14f42449d410354b)
Alan Modra [Sat, 21 Sep 2019 08:43:52 +0000 (18:13 +0930)]
Work around gcc10 FAIL: S-records with constructors
gcc10 on x86_64 and powerpc64le recognises that the loop in
Foo::operator= can be turned into a call to memmove, which then
results in an undefined symbol when linking. Avoid that by making the
loop smaller.
* testsuite/ld-srec/sr3.cc (FOO_MSG_LEN): Set to 4.
(cherry picked from commit
a13ba30840ba7a8450dcb4edd356de61fcb89130)
Alan Modra [Sat, 21 Sep 2019 01:29:50 +0000 (10:59 +0930)]
tc-i386.c gcc10 warning fix
.../gas/config/tc-i386.c: In function ‘md_parse_option’:
.../gas/config/tc-i386.c:11441:9: error: implicit conversion from ‘enum <anonymous>’ to ‘enum <anonymous>’ [-Werror=enum-conversion]
11441 | vexwig = evexw0;
| ^
.../gas/config/tc-i386.c:11443:9: error: implicit conversion from ‘enum <anonymous>’ to ‘enum <anonymous>’ [-Werror=enum-conversion]
11443 | vexwig = evexw1;
| ^
* config/tc-i386.c (md_parse_option): Fix warning on vexwig assignment.
(cherry picked from commit
40c9c8deb94be6576f5729172dce117cbe155856)
GDB Administrator [Wed, 25 Sep 2019 00:01:57 +0000 (00:01 +0000)]
Automatic date update in version.in
Nick Clifton [Tue, 24 Sep 2019 09:08:59 +0000 (10:08 +0100)]
Fix building gold with gcc-10.
* descriptors.cc: Include <string>
GDB Administrator [Tue, 24 Sep 2019 00:01:59 +0000 (00:01 +0000)]
Automatic date update in version.in
GDB Administrator [Mon, 23 Sep 2019 00:01:32 +0000 (00:01 +0000)]
Automatic date update in version.in
GDB Administrator [Sun, 22 Sep 2019 00:02:01 +0000 (00:02 +0000)]
Automatic date update in version.in
GDB Administrator [Sat, 21 Sep 2019 00:01:31 +0000 (00:01 +0000)]
Automatic date update in version.in
Alan Modra [Fri, 20 Sep 2019 05:22:54 +0000 (14:52 +0930)]
[GOLD] Fix spurious "plugin needed to handle lto object" warnings
lto_slim_object_ was unitialized. I also thought it worth adding
a sanity check on the .gnu.lto_.lto.* section size, and made some
other tidies.
PR 24768
* layout.cc (Layout::Layout): Init lto_slim_object_.
* object.cc (Sized_relobj_file::do_layout): Wrap overlong line.
Don't use C cast. Validate section size. Don't copy contents.
(cherry picked from commit
4c51dacacf8a97194a1241ad5e1cbf7be00a59a3)
GDB Administrator [Fri, 20 Sep 2019 00:01:19 +0000 (00:01 +0000)]
Automatic date update in version.in
Matthew Malcomson [Thu, 19 Sep 2019 13:21:51 +0000 (14:21 +0100)]
[gas][news] NEWS (2.33) note new SVE2 and TME instructions for AArch64
These NEWS entries had been missed when the instructions were added.
gas/ChangeLog:
2019-09-19 Matthew Malcomson <matthew.malcomson@arm.com>
* NEWS: Add SVE2 and TME entries.
Tamar Christina [Thu, 19 Sep 2019 12:15:02 +0000 (13:15 +0100)]
AArch64: Fix objdump tests
The newly added objdump -S tests check for source line mapping of a static
variable. But the test doesn't dump any data sections so this should never
pass.
This changes the test to dump all sections so the source mapping can be found.
binutils/ChangeLog:
* testsuite/binutils-all/objdump.exp (objdump -S): Update testcases.
(cherry picked from commit
4e28d4cc5b134a4027b4103ddaf09c19b8e0230b)
Alan Modra [Thu, 12 Sep 2019 07:55:46 +0000 (17:25 +0930)]
PR24981, Hit assertion failure in ld/ldlang.c:7504
This fixes a problem with commit
128bf1fe608, a patch I made
2019-08-06. Apparently it is possible to trigger the assertion I
added during an LTO bootstrap, something I haven't reproduced.
However, I did find a case triggered by an odd linker script feature
that allows a file to be loaded from the script without specifying
that file on the command line. Regarding input sections:
"When you use a file name which is not an archive:file specifier
and does not contain any wild card characters, the linker will
first see if you also specified the file name on the linker command
line or in an INPUT command. If you did not, the linker will
attempt to open the file as an input file, as though it appeared on
the command line."
So putting
.foo : { foo.a(*) }
into a script supposedly extracts foo.a into .foo. Except it doesn't,
since this feature is meant for object files only. Well anyway,
assuming --whole-archive was given on the command line, foo.a contains
a -flto object and no other objects involved were -flto then we'll hit
the assert due to files added like foo.a here *not* having their input
statement put on the general statement list. Why these are not put on
the statement list isn't obvious but it has been that way since commit
193c5f93a17 in 1994.
PR 24981
* ldlang.c (lang_process): Remove assertion. Comment.
(cherry picked from commit
a19826f4c41219be6fb1adb528fe5fd3a3dc4130)
GDB Administrator [Thu, 19 Sep 2019 00:01:36 +0000 (00:01 +0000)]
Automatic date update in version.in
H.J. Lu [Mon, 9 Sep 2019 16:21:36 +0000 (09:21 -0700)]
i386: Adjust for new output format from readelf
PR binutils/24887
* testsuite/ld-i386/property-1.r: Adjust for new output format
from readelf.
* testsuite/ld-i386/property-1a.r: Likewise.
* testsuite/ld-i386/property-2.r: Likewise.
* testsuite/ld-i386/property-2a.r: Likewise.
* testsuite/ld-i386/property-3.r: Likewise.
* testsuite/ld-i386/property-3a.r: Likewise.
* testsuite/ld-i386/property-4.r: Likewise.
* testsuite/ld-i386/property-4a.r: Likewise.
* testsuite/ld-i386/property-5.r: Likewise.
* testsuite/ld-i386/property-5a.r: Likewise.
* testsuite/ld-i386/property-6.r: Likewise.
* testsuite/ld-i386/property-7.r: Likewise.
* testsuite/ld-i386/property-7a.r: Likewise.
* testsuite/ld-i386/property-1.r: Likewise.
* testsuite/ld-i386/property-1a.r: Likewise.
* testsuite/ld-i386/property-2.r: Likewise.
* testsuite/ld-i386/property-2a.r: Likewise.
* testsuite/ld-i386/property-3.r: Likewise.
* testsuite/ld-i386/property-3a.r: Likewise.
* testsuite/ld-i386/property-4.r: Likewise.
* testsuite/ld-i386/property-4a.r: Likewise.
* testsuite/ld-i386/property-5.r: Likewise.
* testsuite/ld-i386/property-5a.r: Likewise.
* testsuite/ld-i386/property-6.r: Likewise.
* testsuite/ld-i386/property-7.r: Likewise.
* testsuite/ld-i386/property-7a.r: Likewise.
(cherry picked from commit
6715fe29ffcdbef026908fed62e993b238d04d77)
GDB Administrator [Wed, 18 Sep 2019 00:01:22 +0000 (00:01 +0000)]
Automatic date update in version.in
GDB Administrator [Tue, 17 Sep 2019 00:02:13 +0000 (00:02 +0000)]
Automatic date update in version.in
Phil Blundell [Mon, 16 Sep 2019 10:09:29 +0000 (11:09 +0100)]
Update version number to 2.32.90 for pre-release on 2.33 branch.
GDB Administrator [Mon, 16 Sep 2019 00:01:35 +0000 (00:01 +0000)]
Automatic date update in version.in
GDB Administrator [Sun, 15 Sep 2019 00:01:57 +0000 (00:01 +0000)]
Automatic date update in version.in
Phil Blundell [Mon, 9 Sep 2019 09:27:03 +0000 (10:27 +0100)]
Add markers for 2.33 branch to NEWS and ChangeLog files.
GDB Administrator [Mon, 9 Sep 2019 00:00:28 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom Tromey [Thu, 18 Jul 2019 21:07:01 +0000 (15:07 -0600)]
Truncate long TUI window titles
If a TUI window has a long title, it can overflow the title line.
This changes the TUI to use just the tail part of the title in this
case.
gdb/ChangeLog
2019-09-08 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (box_win): Truncate long window titles.
gdb/testsuite/ChangeLog
2019-09-08 Tom Tromey <tom@tromey.com>
* gdb.tui/resize.exp: Remove setup_xfail.
* gdb.tui/regs.exp: Remove setup_xfail.
* gdb.tui/basic.exp: Remove setup_xfail.
GDB Administrator [Sun, 8 Sep 2019 00:01:06 +0000 (00:01 +0000)]
Automatic date update in version.in
Simon Marchi [Sat, 7 Sep 2019 16:03:56 +0000 (12:03 -0400)]
Change lookup_symbol's block_index parameter type to block_enum
The only two values valid to pass to the block_index parameter of
quick_symbol_functions::lookup_symbol are GLOBAL_BLOCK and STATIC_BLOCK,
part of enum block_enum. Change the type of that parameter to
block_enum.
Change also the block_index field of dw2_symtab_iterator in the same
way.. This makes it consistent with dw2_debug_names_iterator, which
already uses block_enum for its block_index field.
This is a follow-up to this thread:
https://sourceware.org/ml/gdb-patches/2019-08/msg00097.html
gdb/ChangeLog:
* dwarf2read.c (struct dw2_symtab_iterator) <block_index>:
Change type to gdb::optional<block_enum>.
(dw2_symtab_iter_init): Change block_index parameter type
to gdb::optional<block_enum>.
(dw2_lookup_symbol): Change block_index parameter
type to block_enum.c
(dw2_debug_names_lookup_symbol): Likewise.
* psymtab.c (psym_lookup_symbol): Likewise.
* symfile-debug.c (debug_qf_lookup_symbol): Likewise.
* symfile.h (struct quick_symbol_functions) <lookup_symbol>:
Likewise.
GDB Administrator [Sat, 7 Sep 2019 00:00:16 +0000 (00:00 +0000)]
Automatic date update in version.in
David Blaikie [Thu, 5 Sep 2019 22:01:25 +0000 (15:01 -0700)]
un-XFAIL under Clang tests using labels
gdb/testsuite/
* gdb.base/label.exp: un-XFAIL label related tests under Clang.
* gdb.cp/cplabel.exp: Ditto.
* gdb.linespec/ls-errs.exp: Ditto.
Christian Biesinger [Fri, 6 Sep 2019 19:19:40 +0000 (14:19 -0500)]
Change int to bool for the relocate_* functions
These parameters are only used as bools. This also
renames "flag" to "relocatable" to make it clearer
what it does.
gdb/ChangeLog:
2019-09-06 Christian Biesinger <cbiesinger@google.com>
* defs.h (relocate_gdb_directory): Change int to bool in
signature and rename flag to relocatable.
* main.c (relocate_path): Likewise.
(relocate_gdb_directory): Likewise.
Alan Modra [Fri, 6 Sep 2019 02:53:41 +0000 (12:23 +0930)]
beos.em qsort predicate tidy
lang_input_section_type** is better than lang_statement_union_type**
here since that is in fact the type passed to the qsort predicate,
and I think it's worth factoring out the common indirections.
* emultempl/beos.em (sort_by_file_name): Use appropriate
intermediary variables.
(sort_by_section_name): Likewise.
Alan Modra [Fri, 6 Sep 2019 02:37:05 +0000 (12:07 +0930)]
bfd_get_filename
This macro says:
/* Cast from const char * to char * so that caller can assign to
a char * without a warning. */
I reckon that isn't such a good idea since it can result in char*
variables where const char* is appropriate. Not very many places
need the char* cast.
bfd/
* aout-target.h (object_p): Formatting.
* bfd-in.h (bfd_get_filename): Don't cast to char*.
* corefile.c (generic_core_file_matches_executable_p): Constify
variables and remove cast.
* bfd-in2.h: Regenerate.
binutils/
* nm.c (print_object_filename_bsd, print_object_filename_sysv),
(print_object_filename_posix, print_archive_filename_bsd),
(print_archive_filename_sysv, print_archive_filename_posix),
(print_archive_member_bsd, print_archive_member_sysv),
(print_archive_member_posix): Constify parameter.
(struct output_fns <print_object_filename, print_archive_filename>),
(<print_archive_member>): Likewise.
* objcopy.c (copy_archive): Add cast for make_tempdir.
ld/
* emultempl/elf32.em (gld${EMULATION_NAME}_search_needed): Constify
variable.
* emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Likewise.
* emultempl/pep.em (gld_${EMULATION_NAME}_after_open): Likewise.
gdb/
* coffread.c (coff_symfile_read): Constify filename variable.
* dbxread.c (dbx_symfile_init, coffstab_build_psymtabs),
(elfstab_build_psymtabs, stabsect_build_psymtabs): Likewise.
* gdb_bfd.c (gdb_bfd_close_or_warn): Likewise.
* solib.c (reload_shared_libraries_1): Likewise.
* symfile.c (reread_symbols): Likewise.
* solib-aix.c (solib_aix_bfd_open): Add cast for xfree of filename.
* solib-darwin.c (darwin_bfd_open): Likewise.
* symfile-mem.c (symbol_file_add_from_memory): Likewise.
sim/cris/
* sim-if.c (sim_open): Constify filename variable.
GDB Administrator [Fri, 6 Sep 2019 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in
Eric Botcazou [Thu, 5 Sep 2019 16:23:37 +0000 (18:23 +0200)]
Fix PR ld/24574
This restores a line that has been dropped when the auto-import feature
of the PE-COFF linker was overhauled about one year. It is necessary
for GDB to properly resolve extern symbol in DLLs.
ld/ChangeLog
* pe-dll.c (pe_find_data_imports): Replace again the original name
of the undefined symbol with the __imp_ prefixed one after it is
resolved.
Tom de Vries [Thu, 5 Sep 2019 12:33:10 +0000 (14:33 +0200)]
[gdb/testsuite] Restore breakpoint command in ui-redirect.exp
In gdb.base/ui-redirect.exp, the "save breakpoint" command is used to write
the current breakpoints to a file, but the actual output is not verified.
Consequently, the test has regressed in that the "print 1" command associated
with a breakpoint on main is removed by a subsequent runto_main, which first
deletes all breakpoints:
...
(gdb) break main
Breakpoint 1 at 0x4004d7: file start.c, line 34.
(gdb) commands
Type commands for breakpoint(s) 1, one per line.
End with a line saying just "end".
> PASS: gdb.base/ui-redirect.exp: commands
print 1
> PASS: gdb.base/ui-redirect.exp: print 1
end
(gdb) PASS: gdb.base/ui-redirect.exp: end
delete breakpoints
Delete all breakpoints? (y or n) y
...
and consequently the "save breakpoint" output is missing the breakpoint
command for main:
...
break main
- commands
- print 1
- end
break foo
break bar
...
Fix this by replacing "gdb_breakpoint main" with runto_main, and verifying the
"save breakpoints" output.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2019-09-05 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (cmp_file_string): New proc.
* gdb.base/ui-redirect.exp: Replace "gdb_breakpoint main" with
runto_main. Verify save breakpoints output.
Alan Modra [Thu, 5 Sep 2019 06:20:35 +0000 (15:50 +0930)]
PowerPC warning on symbol+offset@got
* config/tc-ppc.c (ppc_elf_suffix): Display the relocation
operator on GOT reloc warnings/errors.
Alan Modra [Thu, 5 Sep 2019 00:36:42 +0000 (10:06 +0930)]
PowerPC64 GOT_PCREL relocs
PC-relative relocs typically use the addend in adjusting what they are
relative to. For example:
bcl 20,31,1f
1: mflr 12
addi 12,12,xxx-1b
generates "R_PPC64_REL16 xxx+0x4" for the addi (when little-endian).
The addend reflects the fact that you want the offset relative to the
previous insn not the current one in this case.
So the question is, will we ever want to do something like that for an
instruction using R_PPC64_GOT_PCREL34? I thought so at the time I
first implemented support in ld but at the time I think the hardware
was possibly going to support pcrel+offset+reg addressing. In which
case you might want something like:
load_big_offset_into_r2
pld 3,sym-big_offset@got@pcrel(2)
which would be a way of supporting more than 8G offsets from code to
the GOT. We could do the same with
load_big_offset_into_r2
pla 9,sym-big_offset@got@pcrel
ldx 3,9,2
However, this is really a poor version of TOC-pointer relative code.
So let's go with an addend on R_PPC64_GOT_PCREL34 meaning that
sym+addend should be put in a GOT entry, and the relocation calculate
the pc-relative offset to that GOT entry.
Note that this is an extension to the ABI, which says (by the
expression given for GOT relocs) that non-zero addends on GOT and PLT
relocs are ignored. This is true for all GOT/PLT relocs, not just the
pcrel ones.
* elf64-ppc.c (ppc64_elf_check_relocs): Interpret an addend in
GOT_PCREL and PLT_PCREL relocs as affecting the value stored
in the GOT/PLT entry rather than affecting the offset to that
GOI/PLT entry.
(ppc64_elf_edit_toc, ppc64_elf_relocate_section): Likewise.
Alan Modra [Wed, 4 Sep 2019 06:00:37 +0000 (15:30 +0930)]
R_PPC64_PCREL_OPT
The loads and stores handled in the second instruction of a sequence
marked by R_PPC64_PCREL_OPT may be a prefix instruction. For example:
pld ra,symbol@got@pcrel
0:
pld rt,off(ra)
.reloc 0b-8,R_PPC64_PCREL_OPT,(.-8)-(0b-8)
can be optimised to
pld rt,symbol+off@pcrel
pnop
* elf64-ppc.c (xlate_pcrel_opt): Handle prefix loads and stores
in second instruction.
(ppc64_elf_relocate_section): Likewise.
Alan Modra [Mon, 2 Sep 2019 06:43:05 +0000 (16:13 +0930)]
PR24955, libbfd terminating program on out of memory
This patch fixes the worst of the cases where libbfd might terminate
a program due to calling xstrdup or xmalloc. I've also fixed some
error paths that didn't clean up properly.
PR 24955
* libbfd-in.h (bfd_strdup): New inline function.
* archive.c (_bfd_get_elt_at_filepos): Use bfd_strdup. Close
bfd on error.
* elfcode.h (_bfd_elf_bfd_from_remote_memory): Use bfd_strdup.
* opncls.c (bfd_fopen): Use bfd_strdup. Close fd and stream
on error.
(bfd_openstreamr): Use bfd_strdup.
(bfd_openr_iovec, bfd_openw, bfd_create): Likewise.
* plugin.c (try_load_plugin): Use bfd_malloc.
* libbfd.h: Regenerate.