From 00e4281cfbf0286ffaed1431e2f274d730c5f122 Mon Sep 17 00:00:00 2001 From: GUO Zihua Date: Thu, 25 Aug 2022 21:06:35 +0800 Subject: [PATCH 1/2] Revert "arm64: vmlinux.lds: account for spurious empty .igot.plt sections" ohos inclusion category: bugfix bugzilla: I5N7BV CVE: NA Revert this patch to workaround a build error with LTO and CFI Signed-off-by: GUO Zihua -------------------------------- This reverts commit 5f692a81b4e923d0e856d35a708e53b97e8f8755. Change-Id: Ia43d4fff26acc91576e2dde05ffb972d94985266 Signed-off-by: GUO Zihua Change-Id: Id8697edacfd21fad9c4f4f5034a0e567242d3d21 --- arch/arm64/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 71f4b5f24d15..08a26523aaeb 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -276,7 +276,7 @@ SECTIONS * explicitly check instead of blindly discarding. */ .plt : { - *(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt) + *(.plt) *(.plt.*) *(.iplt) *(.igot) } ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!") -- Gitee From e1137742cd73044f73f8656fdcf88cb786411f5d Mon Sep 17 00:00:00 2001 From: GUO Zihua Date: Thu, 25 Aug 2022 21:07:04 +0800 Subject: [PATCH 2/2] Revert "arm64/build: Assert for unwanted sections" ohos inclusion category: bugfix bugzilla: I5N7BV CVE: NA Revert this patch to workaround a build error with LTO and CFI Signed-off-by: GUO Zihua -------------------------------- This reverts commit be2881824ae9eb92a35b094f734f9ca7339ddf6d. Change-Id: I49433b5befd519bddffed8dec678bde650e59bee Signed-off-by: GUO Zihua Change-Id: I496e6d091e5ed68589e30889a19c5320ba683735 --- arch/arm64/kernel/vmlinux.lds.S | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 08a26523aaeb..ac8bafbda139 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -141,14 +141,6 @@ SECTIONS *(.got) /* Global offset table */ } - /* - * Make sure that the .got.plt is either completely empty or it - * contains only the lazy dispatch entries. - */ - .got.plt : { *(.got.plt) } - ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, - "Unexpected GOT/PLT entries detected!") - . = ALIGN(SEGMENT_ALIGN); _etext = .; /* End of text section */ @@ -270,18 +262,6 @@ SECTIONS ELF_DETAILS HEAD_SYMBOLS - - /* - * Sections that should stay zero sized, which is safer to - * explicitly check instead of blindly discarding. - */ - .plt : { - *(.plt) *(.plt.*) *(.iplt) *(.igot) - } - ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!") - - .data.rel.ro : { *(.data.rel.ro) } - ASSERT(SIZEOF(.data.rel.ro) == 0, "Unexpected RELRO detected!") } #include "image-vars.h" -- Gitee