From ff4bc37d77a0ca7286883a477adcb3aa145fc782 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Mon, 14 Dec 2020 15:46:47 -0800 Subject: Keep input SHF_GNU_RETAIN sections and strip output SHF_GNU_RETAIN for GNU/FreBSD ELFOSABIs. 2020-12-14 H.J. Lu Cary Coutant elfcpp/ PR gold/27039 * elfcpp.h (SHF): Add SHF_GNU_RETAIN. gold/ PR gold/27039 * layout.cc (Layout::layout): Strip SHF_GNU_RETAIN. * object.cc (Sized_relobj_file::Sized_relobj_file): Initialize osabi_. (Sized_relobj_file::do_layout): Keep SHF_GNU_RETAIN sections for GNU/FreBSD ELFOSABIs. * object.h (Osabi) New class. (Sized_relobj_file): Add osabi() and osabi_. * testsuite/Makefile.am (check_SCRIPTS): Add retain.sh. (check_DATA): Add retain_1.out retain_2.out. (MOSTLYCLEANFILES): Add retain_1 retain_2. (retain_1.out): New target. (retain_1): Likewise. (retain_1.o): Likewise. (retain_2.out): Likewise. (retain_2): Likewise. (retain_2.o): Likewise. * testsuite/Makefile.in: Regenerate. * testsuite/retain.sh: New file. * testsuite/retain_1.s: Likewise. * testsuite/retain_2.s: Likewise. --- elfcpp/elfcpp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'elfcpp/elfcpp.h') diff --git a/elfcpp/elfcpp.h b/elfcpp/elfcpp.h index 4b6ff94..2d333e9 100644 --- a/elfcpp/elfcpp.h +++ b/elfcpp/elfcpp.h @@ -438,6 +438,7 @@ enum SHF SHF_TLS = 0x400, SHF_COMPRESSED = 0x800, SHF_MASKOS = 0x0ff00000, + SHF_GNU_RETAIN = 0x200000, SHF_MASKPROC = 0xf0000000, // Indicates this section requires ordering in relation to -- cgit v1.1