From 30dc2aebd7e88d43d620bba765edd21fcd20f3be Mon Sep 17 00:00:00 2001 From: Brandon Bergren Date: Mon, 1 Jun 2020 19:40:59 +0000 Subject: [PATCH] [PowerPC] Fix build-id note on powerpc64 kernel Due to the ordering of the powerpc64 linker script, we were discarding all notes before emitting .note.gnu.build-id. This had the effect of generating an empty build id section and breaking the kern.build_id sysctl added in r348611. powerpc and powerpcspe are uneffected. PR: 246430 MFC after: 3 days Sponsored by: Tag1 Consulting, Inc. --- sys/conf/ldscript.powerpc64 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/conf/ldscript.powerpc64 b/sys/conf/ldscript.powerpc64 index 3ed6e083248c..5dd84c65c09f 100644 --- a/sys/conf/ldscript.powerpc64 +++ b/sys/conf/ldscript.powerpc64 @@ -37,9 +37,6 @@ SECTIONS /* Do not emit PT_INTERP section, which confuses some loaders (kexec-lite) */ /DISCARD/ : { *(.interp) } - /* Also delete notes */ - /DISCARD/ : { *(.note.*) } - .hash : { *(.hash) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } @@ -51,6 +48,10 @@ SECTIONS *(.note.gnu.build-id) PROVIDE (__build_id_end = .); } + + /* Do not emit any additional notes. */ + /DISCARD/ : { *(.note.*) } + .rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) } .rela.data :