Re: [RFC 27/31] objtool: Fix weak symbol detection

2024-09-04 Thread Josh Poimboeuf
On Wed, Sep 04, 2024 at 09:42:54AM +0200, Peter Zijlstra wrote: > On Tue, Sep 03, 2024 at 08:55:13PM -0700, Josh Poimboeuf wrote: > > On Tue, Sep 03, 2024 at 10:26:45AM +0200, Peter Zijlstra wrote: > > > On Mon, Sep 02, 2024 at 09:00:10PM -0700, Josh Poimboeuf wrote: > > > > @@ -433,9 +433,13 @@ st

Re: [RFC 27/31] objtool: Fix weak symbol detection

2024-09-04 Thread Peter Zijlstra
On Tue, Sep 03, 2024 at 08:55:13PM -0700, Josh Poimboeuf wrote: > On Tue, Sep 03, 2024 at 10:26:45AM +0200, Peter Zijlstra wrote: > > On Mon, Sep 02, 2024 at 09:00:10PM -0700, Josh Poimboeuf wrote: > > > @@ -433,9 +433,13 @@ static void elf_add_symbol(struct elf *elf, struct > > > symbol *sym) > >

Re: [RFC 27/31] objtool: Fix weak symbol detection

2024-09-03 Thread Josh Poimboeuf
On Tue, Sep 03, 2024 at 10:26:45AM +0200, Peter Zijlstra wrote: > On Mon, Sep 02, 2024 at 09:00:10PM -0700, Josh Poimboeuf wrote: > > @@ -433,9 +433,13 @@ static void elf_add_symbol(struct elf *elf, struct > > symbol *sym) > > /* > > * Don't store empty STT_NOTYPE symbols in the rbtree.

Re: [RFC 27/31] objtool: Fix weak symbol detection

2024-09-03 Thread Peter Zijlstra
On Mon, Sep 02, 2024 at 09:00:10PM -0700, Josh Poimboeuf wrote: > @@ -433,9 +433,13 @@ static void elf_add_symbol(struct elf *elf, struct > symbol *sym) > /* >* Don't store empty STT_NOTYPE symbols in the rbtree. They >* can exist within a function, confusing the sorting. >

[RFC 27/31] objtool: Fix weak symbol detection

2024-09-02 Thread Josh Poimboeuf
find_symbol_hole_containing() fails to find a symbol hole (aka stripped weak symbol) if its section has no symbols before the hole. This breaks weak symbol detection if -ffunction-sections is enabled. Fix it by allowing the interval tree to contain section symbols, which are always at offset zero