* [PATCH] powerpc: Include .BTF section
@ 2020-02-20 11:31 Naveen N. Rao
2020-02-24 0:29 ` Michael Ellerman
2020-02-27 12:31 ` Michael Ellerman
0 siblings, 2 replies; 5+ messages in thread
From: Naveen N. Rao @ 2020-02-20 11:31 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
Selecting CONFIG_DEBUG_INFO_BTF results in the below warning from ld:
ld: warning: orphan section `.BTF' from `.btf.vmlinux.bin.o' being placed in section `.BTF'
Include .BTF section in vmlinux explicitly to fix the same.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
arch/powerpc/kernel/vmlinux.lds.S | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index b4c89a1acebb..a32d478a7f41 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -303,6 +303,12 @@ SECTIONS
*(.branch_lt)
}
+#ifdef CONFIG_DEBUG_INFO_BTF
+ .BTF : AT(ADDR(.BTF) - LOAD_OFFSET) {
+ *(.BTF)
+ }
+#endif
+
.opd : AT(ADDR(.opd) - LOAD_OFFSET) {
__start_opd = .;
KEEP(*(.opd))
--
2.24.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: Include .BTF section
2020-02-20 11:31 [PATCH] powerpc: Include .BTF section Naveen N. Rao
@ 2020-02-24 0:29 ` Michael Ellerman
2020-02-24 4:03 ` Naveen N. Rao
2020-02-27 12:31 ` Michael Ellerman
1 sibling, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2020-02-24 0:29 UTC (permalink / raw)
To: Naveen N. Rao; +Cc: linuxppc-dev
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:
> Selecting CONFIG_DEBUG_INFO_BTF results in the below warning from ld:
> ld: warning: orphan section `.BTF' from `.btf.vmlinux.bin.o' being placed in section `.BTF'
>
> Include .BTF section in vmlinux explicitly to fix the same.
I don't see any other architectures doing this in their linker script.
Why are we special?
cheers
> diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
> index b4c89a1acebb..a32d478a7f41 100644
> --- a/arch/powerpc/kernel/vmlinux.lds.S
> +++ b/arch/powerpc/kernel/vmlinux.lds.S
> @@ -303,6 +303,12 @@ SECTIONS
> *(.branch_lt)
> }
>
> +#ifdef CONFIG_DEBUG_INFO_BTF
> + .BTF : AT(ADDR(.BTF) - LOAD_OFFSET) {
> + *(.BTF)
> + }
> +#endif
> +
> .opd : AT(ADDR(.opd) - LOAD_OFFSET) {
> __start_opd = .;
> KEEP(*(.opd))
> --
> 2.24.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: Include .BTF section
2020-02-24 0:29 ` Michael Ellerman
@ 2020-02-24 4:03 ` Naveen N. Rao
2020-02-24 11:03 ` Michael Ellerman
0 siblings, 1 reply; 5+ messages in thread
From: Naveen N. Rao @ 2020-02-24 4:03 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
Michael Ellerman wrote:
> "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:
>> Selecting CONFIG_DEBUG_INFO_BTF results in the below warning from ld:
>> ld: warning: orphan section `.BTF' from `.btf.vmlinux.bin.o' being placed in section `.BTF'
>>
>> Include .BTF section in vmlinux explicitly to fix the same.
>
> I don't see any other architectures doing this in their linker script.
> Why are we special?
I think this is due to commit 83a092cf95f28 ("powerpc: Link warning for
orphan sections"):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=83a092cf95f28
If your question was why I didn't include the .BTF section in .data,
it's because libbpf seems to expect the .BTF section to be separate.
- Naveen
PS: I also see a linker warning for '.gnu.hash' if I enable
CONFIG_RELOCATABLE, but I couldn't decipher what that was for, and if it
should be retained.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: Include .BTF section
2020-02-24 4:03 ` Naveen N. Rao
@ 2020-02-24 11:03 ` Michael Ellerman
0 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2020-02-24 11:03 UTC (permalink / raw)
To: Naveen N. Rao; +Cc: linuxppc-dev
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:
> Michael Ellerman wrote:
>> "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:
>>> Selecting CONFIG_DEBUG_INFO_BTF results in the below warning from ld:
>>> ld: warning: orphan section `.BTF' from `.btf.vmlinux.bin.o' being placed in section `.BTF'
>>>
>>> Include .BTF section in vmlinux explicitly to fix the same.
>>
>> I don't see any other architectures doing this in their linker script.
>> Why are we special?
>
> I think this is due to commit 83a092cf95f28 ("powerpc: Link warning for
> orphan sections"):
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=83a092cf95f28
Oh haha, right :}
> PS: I also see a linker warning for '.gnu.hash' if I enable
> CONFIG_RELOCATABLE, but I couldn't decipher what that was for, and if it
> should be retained.
Yeah, Joel tried to remove it but it caused breakage:
https://lore.kernel.org/linuxppc-dev/87d0pwqweg.fsf@concordia.ellerman.id.au/
I never got around to looking at it.
cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: Include .BTF section
2020-02-20 11:31 [PATCH] powerpc: Include .BTF section Naveen N. Rao
2020-02-24 0:29 ` Michael Ellerman
@ 2020-02-27 12:31 ` Michael Ellerman
1 sibling, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2020-02-27 12:31 UTC (permalink / raw)
To: Naveen N. Rao; +Cc: linuxppc-dev
On Thu, 2020-02-20 at 11:31:32 UTC, "Naveen N. Rao" wrote:
> Selecting CONFIG_DEBUG_INFO_BTF results in the below warning from ld:
> ld: warning: orphan section `.BTF' from `.btf.vmlinux.bin.o' being placed in section `.BTF'
>
> Include .BTF section in vmlinux explicitly to fix the same.
>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/cb0cc635c7a9fa8a3a0f75d4d896721819c63add
cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-02-27 12:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20 11:31 [PATCH] powerpc: Include .BTF section Naveen N. Rao
2020-02-24 0:29 ` Michael Ellerman
2020-02-24 4:03 ` Naveen N. Rao
2020-02-24 11:03 ` Michael Ellerman
2020-02-27 12:31 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).