toolchain/binutils: backport stable patches
[openwrt/staging/noltari.git] / toolchain / binutils / patches / 2.39 / 063-PR29542-PowerPC-gold-internal-error-in-get_output_vi.patch
1 From 041c22e35de06d22566f4c71e4425c3351215e66 Mon Sep 17 00:00:00 2001
2 From: Alan Modra <amodra@gmail.com>
3 Date: Sun, 25 Sep 2022 12:07:36 +0930
4 Subject: [PATCH 063/160] PR29542, PowerPC gold internal error in
5 get_output_view,
6
7 We were attempting to set a BSS style section contents.
8
9 PR 29542
10 * powerpc.cc (Output_data_plt_powerpc::do_write): Don't set .plt,
11 .iplt or .lplt section contents when position independent.
12
13 (cherry picked from commit c21736aed1d4877e090df60362413669dbdc391d)
14 ---
15 gold/powerpc.cc | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18 --- a/gold/powerpc.cc
19 +++ b/gold/powerpc.cc
20 @@ -4338,7 +4338,8 @@ template<int size, bool big_endian>
21 void
22 Output_data_plt_powerpc<size, big_endian>::do_write(Output_file* of)
23 {
24 - if (!this->sym_ents_.empty())
25 + if (!this->sym_ents_.empty()
26 + && !parameters->options().output_is_position_independent())
27 {
28 const section_size_type offset = this->offset();
29 const section_size_type oview_size