From: Peter Zijlstra <peterz@infradead.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Michal Kubecek <mkubecek@suse.cz>, linux-kernel@vger.kernel.org
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")
Date: Wed, 28 Jun 2023 21:32:31 +0200 [thread overview]
Message-ID: <20230628193231.GX83892@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20230628181019.cmgfbygxfvwamzur@treble>
On Wed, Jun 28, 2023 at 11:10:19AM -0700, Josh Poimboeuf wrote:
> On Wed, Jun 28, 2023 at 07:26:59PM +0200, Michal Kubecek wrote:
> > I digged some more and my guess is that the problem is that
> > elf_open_read() does
> >
> > memset(elf, 0, offsetof(struct elf, sections));
> >
> > but commit eb0481bbc4ce ("objtool: Fix reloc_hash size") added
> > num_relocs after sections so that it is not zeroed (0xbabababababababa
> > is probably some kind of poison).
>
> Argh, that memset() is subtle as heck. Peter, why?!?
Well, at the time struct elf had a bunch of fairly large hash tables
embedded inside it. memset() on those was a significant performance fail
-- esp. since we called objtool on every .o file.
struct elf {
Elf *elf;
GElf_Ehdr ehdr;
int fd;
char *name;
struct list_head sections;
DECLARE_HASHTABLE(symbol_hash, 20);
DECLARE_HASHTABLE(symbol_name_hash, 20);
DECLARE_HASHTABLE(section_hash, 16);
DECLARE_HASHTABLE(section_name_hash, 16);
DECLARE_HASHTABLE(rela_hash, 20);
};
Those embedded hash-tables have gone away, but apparently someone forgot
about this thing :/
Yes, this can go, struct elf is no longer like that.
next prev parent reply other threads:[~2023-06-28 19:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 11:58 build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size") Michal Kubecek
2023-06-28 15:16 ` Josh Poimboeuf
2023-06-28 15:44 ` Michal Kubecek
2023-06-28 16:06 ` Michal Kubecek
2023-06-28 16:45 ` Michal Kubecek
2023-06-28 17:05 ` Josh Poimboeuf
2023-06-28 17:26 ` Michal Kubecek
2023-06-28 18:10 ` Josh Poimboeuf
2023-06-28 19:32 ` Peter Zijlstra [this message]
2023-07-08 13:40 ` Linux regression tracking (Thorsten Leemhuis)
2023-07-09 14:09 ` Michal Kubecek
2023-07-10 17:16 ` Josh Poimboeuf
2023-07-16 22:56 ` Michal Kubecek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230628193231.GX83892@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkubecek@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).