From 775358fd5cbb692f59734b80151dd85102964fc3 Mon Sep 17 00:00:00 2001 From: Mikael Pettersson Date: Sun, 24 May 2020 17:40:46 +0200 Subject: [PATCH] ld: ld_phase1: only collect SHF_ALLOC sections --- erlang/apps/ld/src/ld_phase1.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erlang/apps/ld/src/ld_phase1.erl b/erlang/apps/ld/src/ld_phase1.erl index 969c147..0a4ea68 100644 --- a/erlang/apps/ld/src/ld_phase1.erl +++ b/erlang/apps/ld/src/ld_phase1.erl @@ -32,7 +32,7 @@ %% flags should be concatenated into single sections. The concatenation order %% should satisfy the requirements of any known input section attributes (e.g, %% SHF_MERGE and SHF_LINK_ORDER). When not otherwise constrained, sections -%% should be emitted in input order. " +%% should be emitted in input order." -spec phase1([#input{}]) -> [#section{}]. phase1(Inputs) -> @@ -146,6 +146,7 @@ should_output_type(Type) -> end. should_output_flags(Flags) -> + (Flags band ?SHF_ALLOC) =/= 0 andalso (Flags band bnot (?SHF_WRITE bor ?SHF_ALLOC bor ?SHF_EXECINSTR bor