Skip to contentSkip to conversation

arm64: vmlinux.lds: account for spurious empty .igot.plt sections

PATCH Applied Ard Biesheuvel 3 participants 5 messages Oct 28, 2020 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: vmlinux.lds: account for spurious empty .igot.plt sections

Now that we started making the linker warn about orphan sections (input sections that are not explicitly consumed by an output section), some configurations produce the following warning:

aarch64-linux-gnu-ld: warning: orphan section `.igot.plt' from
arch/arm64/kernel/head.o' being placed in section .igot.plt'

It could be any file that triggers this - head.o is simply the first input file in the link - and the resulting .igot.plt section never actually appears in vmlinux as it turns out to be empty.

So let's add .igot.plt to our collection of input sections to disregard unless they are empty.

Cc Jessica Yu <[email protected]>
Cc Kees Cook <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Nick Desaulniers <[email protected]>
---
 arch/arm64/kernel/vmlinux.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/vmlinux.lds.S +1 -1
index 6567d80dd15f..48b222f1c700 100644
@@ -278,7 +278,7 @@ SECTIONS
 	 * explicitly check instead of blindly discarding.
 	 */
 	.plt : {
-		*(.plt) *(.plt.*) *(.iplt) *(.igot)
+		*(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt)
 	}
 	ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
 
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Applied
#1 lore raw
Quoted 8 lines · Ard Biesheuvel

Now that we started making the linker warn about orphan sections (input sections that are not explicitly consumed by an output section), some configurations produce the following warning:

aarch64-linux-gnu-ld: warning: orphan section `.igot.plt' from
arch/arm64/kernel/head.o' being placed in section .igot.plt'

[...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: vmlinux.lds: account for spurious empty .igot.plt sections

      https://git.kernel.org/arm64/c/5f692a81b4e9

Cheers,

Signature · 10 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 1/1
#2 lore raw
In reply to Ard Biesheuvel
Quoted 7 lines · Ard Biesheuvel

Now that we started making the linker warn about orphan sections (input sections that are not explicitly consumed by an output section), some configurations produce the following warning:

aarch64-linux-gnu-ld: warning: orphan section `.igot.plt' from
arch/arm64/kernel/head.o' being placed in section .igot.plt'

Quoted 6 lines

It could be any file that triggers this - head.o is simply the first input file in the link - and the resulting .igot.plt section never actually appears in vmlinux as it turns out to be empty.

So let's add .igot.plt to our collection of input sections to disregard unless they are empty.

typo: "non-empty"?

Quoted 5 lines
Cc Jessica Yu <[email protected]>
Cc Kees Cook <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Nick Desaulniers <[email protected]>

Thanks! Any idea what causes this?

Though I think Will already snagged the patch :)

Signature · 6 lines
Kees Cook

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#3 lore raw
Quoted 9 lines · Kees Cook
Quoted 7 lines · Ard Biesheuvel

Now that we started making the linker warn about orphan sections (input sections that are not explicitly consumed by an output section), some configurations produce the following warning:

aarch64-linux-gnu-ld: warning: orphan section `.igot.plt' from
arch/arm64/kernel/head.o' being placed in section .igot.plt'

Quoted 9 lines
Quoted 6 lines

It could be any file that triggers this - head.o is simply the first input file in the link - and the resulting .igot.plt section never actually appears in vmlinux as it turns out to be empty.

So let's add .igot.plt to our collection of input sections to disregard unless they are empty.

typo: "non-empty"?

Indeed.

Quoted 8 lines
Quoted 5 lines
Cc Jessica Yu <[email protected]>
Cc Kees Cook <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Nick Desaulniers <[email protected]>

Thanks! Any idea what causes this?

Not a clue.

Quoted 2 lines

Thanks,

Quoted 4 lines

Though I think Will already snagged the patch :)

--
Kees Cook

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#4 lore raw
In reply to Kees Cook
Quoted 23 lines · Kees Cook
Quoted 7 lines · Ard Biesheuvel

Now that we started making the linker warn about orphan sections (input sections that are not explicitly consumed by an output section), some configurations produce the following warning:

aarch64-linux-gnu-ld: warning: orphan section `.igot.plt' from
arch/arm64/kernel/head.o' being placed in section .igot.plt'

Quoted 6 lines

It could be any file that triggers this - head.o is simply the first input file in the link - and the resulting .igot.plt section never actually appears in vmlinux as it turns out to be empty.

So let's add .igot.plt to our collection of input sections to disregard unless they are empty.

typo: "non-empty"?

Quoted 5 lines
Cc Jessica Yu <[email protected]>
Cc Kees Cook <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Nick Desaulniers <[email protected]>
Quoted 5 lines

Thanks! Any idea what causes this?

Though I think Will already snagged the patch :)

Yeah, sorry -- I was keen to get rid of that annoying warning!

Will

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel