aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-10-25 08:42:24 -0700
committerH.J. Lu <hjl.tools@gmail.com>2021-10-26 16:24:24 -0700
commitf85dcfc3af9cf7c2859241253f1d37b1133abea2 (patch)
treee1ccd878a523c3cfd340abcd5b12e7f952acf8fa /gold/layout.cc
parenta4b0231e179607e47b1cdf1fe15c5dc25e482fad (diff)
downloadfsf-binutils-gdb-f85dcfc3af9cf7c2859241253f1d37b1133abea2.zip
fsf-binutils-gdb-f85dcfc3af9cf7c2859241253f1d37b1133abea2.tar.gz
fsf-binutils-gdb-f85dcfc3af9cf7c2859241253f1d37b1133abea2.tar.bz2
gold: Place .note.gnu.property section before other note sections
Place the .note.gnu.property section before all other note sections to avoid being placed between other note sections with different alignments. PR gold/28494 * layout.cc (Layout::create_note): Set order to ORDER_PROPERTY_NOTE for the .note.gnu.property section. * layout.h (Output_section_order): Add ORDER_PROPERTY_NOTE.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index a27cb07..38e9bce 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -3245,7 +3245,8 @@ Layout::create_note(const char* name, int note_type,
if (allocate)
{
flags = elfcpp::SHF_ALLOC;
- order = ORDER_RO_NOTE;
+ order = (note_type == elfcpp::NT_GNU_PROPERTY_TYPE_0
+ ? ORDER_PROPERTY_NOTE : ORDER_RO_NOTE);
}
Output_section* os = this->choose_output_section(NULL, section_name,
elfcpp::SHT_NOTE,