mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
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.
This commit is contained in:
@ -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,
|
||||
|
@ -399,8 +399,13 @@ enum Output_section_order
|
||||
// linker can pick it up quickly.
|
||||
ORDER_INTERP,
|
||||
|
||||
// Loadable read-only note sections come next so that the PT_NOTE
|
||||
// segment is on the first page of the executable.
|
||||
// The .note.gnu.property section comes next so that the PT_NOTE
|
||||
// segment is on the first page of the executable and it won't be
|
||||
// placed between other note sections with different alignments.
|
||||
ORDER_PROPERTY_NOTE,
|
||||
|
||||
// Loadable read-only note sections come after the .note.gnu.property
|
||||
// section.
|
||||
ORDER_RO_NOTE,
|
||||
|
||||
// Put read-only sections used by the dynamic linker early in the
|
||||
|
Reference in New Issue
Block a user