public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@seketeli.org>
To: Giuliano Procida <gprocida@google.com>
Cc: libabigail@sourceware.org,  kernel-team@android.com,
	 maennich@google.com
Subject: Re: [PATCH v5 4/4] add Linux kernel symbol namespace support
Date: Fri, 01 Jul 2022 14:54:53 +0200	[thread overview]
Message-ID: <87pmipc7s2.fsf@seketeli.org> (raw)
In-Reply-To: <20220613142533.3676501-5-gprocida@google.com> (Giuliano Procida's message of "Mon, 13 Jun 2022 15:25:33 +0100")

Hello,

Giuliano Procida <gprocida@google.com> a écrit:

> Bug 28954 - add Linux Kernel symbol namespace support
>
> Each Linux kernel symbol can be exported to a specified named
> namespace or left in the global (nameless) namespace.
>
> One complexity is that the symbol values which identify a string in
> the __ksymtab_strings section must be interpretated differently for
> vmlinux and .ko loadable modules as the former has a fixed load
> address but the latter are relocatable. For vmlinux, the section base
> address needs to be subtracted to obtain a section-relative offset.
>
> The global namespace is explicitly represented as the empty string, at
> least when it comes to the value of __kstrtabns_FOO symbols, but the
> common interpretation is that such symbols lack an export namespace.
>
> I would rather not have to make use of "empty implies missing" in many
> places, so the code here represents namespace as optional<string> and
> only the symtab reader cares about empty strings in __ksymtab_strings.
>
> 	* include/abg-ir.h (elf_symbol::elf_symbol): Add ns argument.
> 	(elf_symbol::create): Add ns argument.
> 	(elf_symbol::get_namespace): Declare new function.
> 	(elf_symbol::set_namespace): Declare new function.
> 	and set_namespace.
> 	* src/abg-comp-filter.cc (namespace_changed): Define new
> 	helper functions.
> 	(categorize_harmful_diff_node): Also call namespace_changed().
> 	* src/abg-ir.cc (elf_symbol::priv): Add namespace_ member.
> 	(elf_symbol::priv::priv): Add namespace_ to initialisers.
> 	(elf_symbol::elf_symbol): Take new ns argument and pass it to
> 	priv constructor.
> 	(elf_symbol::create): Take new ns argument and pass it to
> 	elf_symbol constructor.
> 	(elf_symbol::get_namespace): Define new function.
> 	(elf_symbol::set_namespace): Define new function.
> 	* src/abg-reader.cc (build_elf_symbol): If namespace
> 	attribute is present, set symbol namespace.
> 	* src/abg-reporter-priv.cc (maybe_report_diff_for_symbol): If
> 	symbol namespaces differ, report this.
> 	* src/abg-symtab-reader.cc (symtab::load): Get ELF header to
> 	distinguish vmlinux from .ko. Try to get __ksymtab_strings
> 	metadata and data. Use these to look up __kstrtabns_FOO
> 	namespace entries. Set symbol namespace where found.
> 	* src/abg-writer.cc (write_elf_symbol): Emit namespace
> 	attribute, if symbol has a namespace.
> 	* tests/data/Makefile.am: Add new test files.
> 	* tests/data/test-abidiff/test-namespace-0.xml: New test file.
> 	* tests/data/test-abidiff/test-namespace-1.xml: Likewise
> 	* tests/data/test-abidiff/test-namespace-report.txt: Likewise.
> 	* tests/test-abidiff.cc: Add new test case.
>
> Reviewed-by: Matthias Maennich <maennich@google.com>
> Signed-off-by: Giuliano Procida <gprocida@google.com>

Applied to master, thanks!

[...]

Cheers,

-- 
		Dodji

      reply	other threads:[~2022-07-01 12:54 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14 18:13 [PATCH 0/2] Bug 28954 - add Linux Kernel " Giuliano Procida
2022-03-14 18:13 ` [PATCH 1/2] optional: add operator== and operator!= Giuliano Procida
2022-03-15 11:02   ` Matthias Maennich
2022-03-16  9:31     ` Giuliano Procida
2022-03-14 18:13 ` [PATCH 2/2] add Linux kernel symbol namespace support Giuliano Procida
2022-03-15 11:25   ` Matthias Maennich
2022-03-16 16:30 ` [PATCH v2 0/4] add symbol namespace support, update symbol CRC support Giuliano Procida
2022-03-16 16:30   ` [PATCH v2 1/4] optional: minor improvements Giuliano Procida
2022-03-17 10:56     ` Matthias Maennich
2022-03-16 16:30   ` [PATCH v2 2/4] crc_changed: eliminate copying of shared_ptr values Giuliano Procida
2022-03-17 11:01     ` Matthias Maennich
2022-03-16 16:30   ` [PATCH v2 3/4] add Linux kernel symbol namespace support Giuliano Procida
2022-03-17 11:57     ` Matthias Maennich
2022-03-16 16:30   ` [PATCH v2 4/4] Linux symbol CRCs: support 0 and report presence changes Giuliano Procida
2022-03-17 12:01     ` Matthias Maennich
2022-03-17 16:38   ` [PATCH v3 0/4] add symbol namespace support, update symbol CRC support Giuliano Procida
2022-03-17 16:38     ` [PATCH v3 1/4] crc_changed: eliminate copying of shared_ptr values Giuliano Procida
2022-03-17 16:38     ` [PATCH v3 2/4] optional: minor improvements Giuliano Procida
2022-03-17 16:38     ` [PATCH v3 3/4] Linux symbol CRCs: support 0 and report presence changes Giuliano Procida
2022-03-17 16:38     ` [PATCH v3 4/4] add Linux kernel symbol namespace support Giuliano Procida
2022-03-21 12:53       ` Matthias Maennich
2022-03-21 15:52         ` Giuliano Procida
2022-03-21 16:02     ` [PATCH v4 0/4] add symbol namespace support, update symbol CRC support Giuliano Procida
2022-03-21 16:02       ` [PATCH v4 1/4] crc_changed: eliminate copying of shared_ptr values Giuliano Procida
2022-03-21 16:02       ` [PATCH v4 2/4] optional: minor improvements Giuliano Procida
2022-03-21 16:02       ` [PATCH v4 3/4] Linux symbol CRCs: support 0 and report presence changes Giuliano Procida
2022-03-21 16:02       ` [PATCH v4 4/4] add Linux kernel symbol namespace support Giuliano Procida
2022-06-13 14:25       ` [PATCH v5 0/4] add symbol namespace support, update symbol CRC support Giuliano Procida
2022-06-30 16:39         ` Dodji Seketeli
2022-06-13 14:25       ` [PATCH v5 1/4] crc_changed: eliminate copying of shared_ptr values Giuliano Procida
2022-06-30 16:40         ` Dodji Seketeli
2022-06-13 14:25       ` [PATCH v5 2/4] optional: minor improvements Giuliano Procida
2022-06-30 16:40         ` Dodji Seketeli
2022-06-13 14:25       ` [PATCH v5 3/4] Linux symbol CRCs: support 0 and report presence changes Giuliano Procida
2022-06-30 16:41         ` Dodji Seketeli
2022-06-13 14:25       ` [PATCH v5 4/4] add Linux kernel symbol namespace support Giuliano Procida
2022-07-01 12:54         ` Dodji Seketeli [this message]

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=87pmipc7s2.fsf@seketeli.org \
    --to=dodji@seketeli.org \
    --cc=gprocida@google.com \
    --cc=kernel-team@android.com \
    --cc=libabigail@sourceware.org \
    --cc=maennich@google.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).