[GOLD][PATCH] Set SHF_LINK_ORDER flags of ARM EXIDX sections.
Doug Kwan (關振德)
dougkwan@google.com
Tue Oct 19 08:17:00 GMT 2010
Hi
This patch changes code writing output section headers so that the
SHF_LINK_ORDER flag of a section of type SHT_ARM_EXIDX is always set.
The flag is required to be set for such a section by the ARM EHABI.
The existing code drops the SHF_LINK_ORDER flag and that confuses
other tools. Gold does not handle SHF_LINK_ORDER in general but the
ARM back-end can handle the EXIDX sections.
-Doug
2010-10-19 Doug Kwan <dougkwan@google.com>
* output.cc(Output_section::write_header): Set SHF_LINK_ORDER flags of
ARM EXIDX sections.
Index: gold/output.cc
===================================================================
RCS file: /cvs/src/src/gold/output.cc,v
retrieving revision 1.136
diff -u -u -p -r1.136 output.cc
--- gold/output.cc 18 Oct 2010 05:39:23 -0000 1.136
+++ gold/output.cc 19 Oct 2010 08:09:15 -0000
@@ -3091,6 +3091,10 @@ Output_section::write_header(const Layou
elfcpp::Elf_Xword flags = this->flags_;
if (this->info_section_ != NULL && this->info_uses_section_index_)
flags |= elfcpp::SHF_INFO_LINK;
+ // ARM EHABI requires a SHT_ARM_EXIDX section to have the SHF_LINK_ORDER
+ // flag set.
+ if (this->type_ == elfcpp::SHT_ARM_EXIDX)
+ flags |= elfcpp::SHF_LINK_ORDER;
oshdr->put_sh_flags(flags);
oshdr->put_sh_addr(this->address());
More information about the Binutils
mailing list