public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Doug Kwan (關振德)" <dougkwan@google.com>
To: Ian Lance Taylor <iant@google.com>, binutils <binutils@sourceware.org>
Subject: [GOLD][PATCH] Set SHF_LINK_ORDER flags of ARM EXIDX sections.
Date: Tue, 19 Oct 2010 08:17:00 -0000	[thread overview]
Message-ID: <AANLkTik85+uiwZ8K4Yo236CnfpnYY6UhX3FzD-CKQgXr@mail.gmail.com> (raw)

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());

             reply	other threads:[~2010-10-19  8:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19  8:17 Doug Kwan (關振德) [this message]
2010-10-19 14:08 ` Ian Lance Taylor
2010-10-19 16:12   ` Doug Kwan (關振德)
2010-10-19 16:33     ` Cary Coutant
2010-10-19 16:52       ` Doug Kwan (關振德)
2010-10-19 16:54     ` Ian Lance Taylor
2010-10-19 18:54       ` Doug Kwan (關振德)
2010-10-19 19:29         ` Ian Lance Taylor
     [not found]         ` <AANLkTimBgvCfeY3gTPV8UkUPH2igcmhzd=LJDVF5gRgd@mail.gmail.com>
2010-10-19 20:29           ` Ian Lance Taylor
     [not found]           ` <AANLkTi=4DTSjUz5HCbU8uARWHEd8Deh3jhFYgrxqpaU2@mail.gmail.com>
2010-10-20 10:39             ` Doug Kwan (關振德)
2010-10-20 14:54               ` Ian Lance Taylor
2010-10-20 17:41               ` Cary Coutant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTik85+uiwZ8K4Yo236CnfpnYY6UhX3FzD-CKQgXr@mail.gmail.com \
    --to=dougkwan@google.com \
    --cc=binutils@sourceware.org \
    --cc=iant@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).