Linux Modules
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "Giuliano Procida" <gprocida@google.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	rust-for-linux@vger.kernel.org,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	linux-modules@vger.kernel.org,
	"Luis Chamberlain" <mcgrof@kernel.org>,
	"Petr Pavlu" <petr.pavlu@suse.com>,
	"Daniel Gomez" <da.gomez@kernel.org>,
	"Sami Tolvanen" <samitolvanen@google.com>,
	"Aaron Tomlin" <atomlin@atomlin.com>
Subject: Re: [PATCH v5 3/4] gpu: nova-core: convert nova_core_exports.c to assembly
Date: Wed, 2 Dec 2026 14:43:30 -0800	[thread overview]
Message-ID: <axCZ2ANJN5rUWkHN@jpoimboe> (raw)
In-Reply-To: <CANiq72m3X0j+tu8rX7fDhcPYHA+9e3jyvHeyj801Hf5m43KeUA@mail.gmail.com>

On Mon, Nov 30, 2026 at 06:10:37PM +0100, Miguel Ojeda wrote:
> On Thu, Nov 12, 2026 at 1:15 PM Giuliano Procida <gprocida@google.com> wrote:
> >
> > Convert `nova_core_exports.c` to `nova_core_exports.S`, emit
> > `EXPORT_SYMBOL_GPL(sym)` directly in `exports_nova_core_generated.h`
> 
> With GCC, `X86_KERNEL_IBT=n` and `NOVA_CORE` without `DRM_NOVA`, I see:
> 
>     drivers/gpu/nova-core/nova_core_exports.o: error: objtool: no .symtab
> 
> The export list is empty in that case, GNU as does not write a symbol
> table for an empty file, and objtool rejects such an object since
> commit 4ed9d82bf5b2 ("objtool: Speed up SHT_GROUP reindexing") -- any
> empty `.S` would.
> 
> Cc'ing Josh and Peter: is that intended? `read_symbols()` still has a
> comment saying that a missing symbol table is possible for an empty
> `.o`.

Definitely a bug, presumably the below fixes it?  Feel free to take this
patch if it's exposed by one of yours, otherwise let me know.

---

From: Josh Poimboeuf <jpoimboe@kernel.org>
Subject: [PATCH] objtool: Fix "no .symtab" error for empty object files

Since commit 4ed9d82bf5b2 ("objtool: Speed up SHT_GROUP reindexing"),
objtool no longer gracefully handles .o files with no symbols:

  drivers/gpu/nova-core/nova_core_exports.o: error: objtool: no .symtab

A file without a symbol table section can't have any SHT_GROUP sections
referencing said section, so it shouldn't be an error.

Fixes: 4ed9d82bf5b2 ("objtool: Speed up SHT_GROUP reindexing")
Reported-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Closes: https://lore.kernel.org/CANiq72m3X0j+tu8rX7fDhcPYHA+9e3jyvHeyj801Hf5m43KeUA@mail.gmail.com
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 tools/objtool/elf.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index a791f4ea6ec19..755ac77ca9c2c 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -732,10 +732,8 @@ static int mark_group_syms(struct elf *elf)
 	struct symbol *sym;
 
 	symtab = find_section_by_name(elf, ".symtab");
-	if (!symtab) {
-		ERROR("no .symtab");
-		return -1;
-	}
+	if (!symtab)
+		return 0;
 
 	for_each_sec(elf, sec) {
 		if (sec->sh.sh_type == SHT_GROUP &&
-- 
2.56.1


  reply	other threads:[~2026-12-02 22:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 12:15 [PATCH v5 0/4] clean up EXPORT_SYMBOL_RUST_GPL Giuliano Procida
2026-11-12 12:15 ` [PATCH v5 1/4] kbuild: respect skip_gendwarfksyms in cmd_gensymtypes_S Giuliano Procida
2026-11-12 12:15 ` [PATCH v5 2/4] rust: convert exports.c to assembly Giuliano Procida
2026-11-12 14:20   ` Miguel Ojeda
2026-11-12 12:15 ` [PATCH v5 3/4] gpu: nova-core: convert nova_core_exports.c " Giuliano Procida
2026-11-30 17:10   ` Miguel Ojeda
2026-12-02 22:43     ` Josh Poimboeuf [this message]
2026-11-12 12:15 ` [PATCH v5 4/4] scripts/sbom: update rust export macro in nm parser test Giuliano Procida
2026-11-12 12:21 ` [PATCH v5 0/4] clean up EXPORT_SYMBOL_RUST_GPL Giuliano Procida
2026-11-24 23:18 ` Sami Tolvanen

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=axCZ2ANJN5rUWkHN@jpoimboe \
    --to=jpoimboe@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=atomlin@atomlin.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=da.gomez@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=gprocida@google.com \
    --cc=linux-modules@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=petr.pavlu@suse.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=samitolvanen@google.com \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /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