PR29542, PowerPC gold internal error in get_output_view,
authorAlan Modra <amodra@gmail.com>
Sun, 25 Sep 2022 02:37:36 +0000 (12:07 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 26 Sep 2022 04:53:29 +0000 (14:23 +0930)
We were attempting to set a BSS style section contents.

PR 29542
* powerpc.cc (Output_data_plt_powerpc::do_write): Don't set .plt,
.iplt or .lplt section contents when position independent.

gold/powerpc.cc

index 22c0462326db25698ea51aa1998665195caa6696..b950869d0b6d1b15dbc1a29465443d955d0967bd 100644 (file)
@@ -4338,7 +4338,8 @@ template<int size, bool big_endian>
 void
 Output_data_plt_powerpc<size, big_endian>::do_write(Output_file* of)
 {
-  if (!this->sym_ents_.empty())
+  if (!this->sym_ents_.empty()
+      && !parameters->options().output_is_position_independent())
     {
       const section_size_type offset = this->offset();
       const section_size_type oview_size