diff options
author | Hans-Christian Noren Egtvedt <hegtvedt@cisco.com> | 2022-02-02 18:14:39 (GMT) |
---|---|---|
committer | Chris Packham <judge.packham@gmail.com> | 2022-02-03 20:55:25 (GMT) |
commit | 5a4c95d658eddaf7e7cd3b4c2951875a8e427e2e (patch) | |
tree | 5556b6fdab05cb41960bf40da5d20e3e128c6e46 /packages/binutils/2.37/0018-gold-place-note-gnu-property-section-before-other-note-sections.patch | |
parent | 392955a293573451baf3a9294139d0558b08ca2e (diff) |
binutils-2.37: add more patches from upstream release branch
Fetch in various patches from binutils-2_37-branch upstream.
The most vital change is the
0012-pr28391-strip-objcopy-preserve-dates-a-cannot-set-time.patch which
allows building large upstream projects like Qt WebEngine without need
100k's of file descriptors open.
Signed-off-by: Hans-Christian Noren Egtvedt <hegtvedt@cisco.com>
Diffstat (limited to 'packages/binutils/2.37/0018-gold-place-note-gnu-property-section-before-other-note-sections.patch')
-rw-r--r-- | packages/binutils/2.37/0018-gold-place-note-gnu-property-section-before-other-note-sections.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/packages/binutils/2.37/0018-gold-place-note-gnu-property-section-before-other-note-sections.patch b/packages/binutils/2.37/0018-gold-place-note-gnu-property-section-before-other-note-sections.patch new file mode 100644 index 0000000..9b53a90 --- /dev/null +++ b/packages/binutils/2.37/0018-gold-place-note-gnu-property-section-before-other-note-sections.patch @@ -0,0 +1,57 @@ +From bd711d6329ebb9328a99bd4be501932082248e44 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" <hjl.tools@gmail.com> +Date: Mon, 25 Oct 2021 08:42:24 -0700 +Subject: [PATCH] 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. + +(cherry picked from commit f85dcfc3af9cf7c2859241253f1d37b1133abea2) +--- + gold/layout.cc | 3 ++- + gold/layout.h | 9 +++++++-- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/gold/layout.cc b/gold/layout.cc +index a27cb071c75..38e9bceec7e 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, +diff --git a/gold/layout.h b/gold/layout.h +index 0b378003679..05c31714e47 100644 +--- a/gold/layout.h ++++ b/gold/layout.h +@@ -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 +-- +2.27.0 + |