public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Mark Wielaard <mjw@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: find-debuginfo.sh: Remove non-allocated NOBITS sections from minisymtab.
Date: Mon, 23 Nov 2026 09:31:14 GMT	[thread overview]
Message-ID: <179542627400.1.6425798023289094200.rpms-rpm-b7548d7b539a@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : b7548d7b539a5fc27e8b50ccd2da40e6631b65a9
Author : Mark Wielaard <mjw@fedoraproject.org>
Date   : 2017-07-21T16:13:51+02:00
Stats  : +51/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/b7548d7b539a5fc27e8b50ccd2da40e6631b65a9?branch=pmatilai-v6

Log:
find-debuginfo.sh: Remove non-allocated NOBITS sections from minisymtab.

---
diff --git a/0057-find-debuginfo.sh-Remove-non-allocated-NOBITS-sectio.patch b/0057-find-debuginfo.sh-Remove-non-allocated-NOBITS-sectio.patch
new file mode 100644
index 0000000..9970105
--- /dev/null
+++ b/0057-find-debuginfo.sh-Remove-non-allocated-NOBITS-sectio.patch
@@ -0,0 +1,46 @@
+From 1fb19a11f6d6a4c221f2e1c08fe246761a4d1e82 Mon Sep 17 00:00:00 2001
+From: Mark Wielaard <mark@klomp.org>
+Date: Wed, 19 Jul 2017 14:53:53 +0200
+Subject: [PATCH] find-debuginfo.sh: Remove non-allocated NOBITS sections from
+ minisymtab.
+
+In the minisymtab section (the .gnu_debugdata embedded ELF image) we
+do not need unallocated sections (except for the SYMTAB and STRTAB
+sections we are creating). We already remove PROGBITS and NOTES. Also
+remove NOBITS sections. They should not really take up much (any) space
+but they still add to the section tables. These sections might be created
+with the new --keep-section support (which puts the actual section in
+the main ELF binary, and a NOBITS variant in the .debug file).
+
+Also binutils objcopy seems to sometimes add them anyway filled with
+zeros instead of marking them NOBITS.
+
+Signed-off-by: Mark Wielaard <mark@klomp.org>
+(cherry picked from commit 860c04e0c3603f4697b7be5fe15ad325369f082c)
+---
+ scripts/find-debuginfo.sh | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
+index 5ec52d3..b83e4c6 100644
+--- a/scripts/find-debuginfo.sh
++++ b/scripts/find-debuginfo.sh
+@@ -247,12 +247,16 @@ add_minidebug()
+   local mini_debuginfo=`mktemp`
+ 
+   # In the minisymtab we don't need the .debug_ sections (already removed
+-  # by -S) but also not any other non-allocated PROGBITS or NOTE sections.
++  # by -S) but also not other non-allocated PROGBITS, NOTE or NOBITS sections.
+   # List and remove them explicitly. We do want to keep the allocated,
+   # symbol and NOBITS sections so cannot use --keep-only because that is
+   # too agressive. Field $2 is the section name, $3 is the section type
+   # and $8 are the section flags.
+-  local remove_sections=`readelf -W -S "$debuginfo" | awk '{ if (index($2,".debug_") != 1 && ($3 == "PROGBITS" || $3 == "NOTE") && index($8,"A") == 0) printf "--remove-section "$2" " }'`
++  local remove_sections=`readelf -W -S "$debuginfo" \
++	| awk '{ if (index($2,".debug_") != 1 \
++		     && ($3 == "PROGBITS" || $3 == "NOTE" || $3 == "NOBITS") \
++		     && index($8,"A") == 0) \
++		   printf "--remove-section "$2" " }'`
+ 
+   # Extract the dynamic symbols from the main binary, there is no need to also have these
+   # in the normal symbol table

diff --git a/rpm.spec b/rpm.spec
index 0c4cc61..40da531 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -29,7 +29,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}33%{?dist}
+Release: %{?snapver:0.%{snapver}.}34%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://ftp.rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2
@@ -146,6 +146,7 @@ Patch331: 0055-let-debuginfo-packages-provide-the-build-id.patch
 # find-debuginfo.sh: Add --keep-section and --remove-section for eu-strip.
 # https://bugzilla.redhat.com/show_bug.cgi?id=1465997
 Patch332: 0056-find-debuginfo.sh-Add-keep-section-and-remove-sectio.patch
+Patch333: 0057-find-debuginfo.sh-Remove-non-allocated-NOBITS-sectio.patch
 
 # These are not yet upstream
 Patch902: rpm-4.7.1-geode-i686.patch
@@ -643,6 +644,9 @@ exit 0
 %doc doc/librpm/html/*
 
 %changelog
+* Fri Jul 21 2017 Mark Wielaard <mjw@fedoraproject.org> - 4.13.0.1-34
+- find-debuginfo.sh: Remove non-allocated NOBITS sections from minisymtab.
+
 * Thu Jul 20 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.13.0.1-33
 - Remove strict requirement on python libs
 

                 reply	other threads:[~2026-11-23  9:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=179542627400.1.6425798023289094200.rpms-rpm-b7548d7b539a@fedoraproject.org \
    --to=mjw@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /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