From: Lubomir Kundrak <lkundrak@redhat.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: [PATCH] Preserve build IDs
Date: Tue, 15 Apr 2008 00:41:50 +0200 [thread overview]
Message-ID: <1208212910.3971.53.camel@localhost.localdomain> (raw)
[-- Attachment #1: Type: text/plain, Size: 758 bytes --]
This will make Fedora packagers have good sleep. I think we discussed
this already on the list. Rationale behind disabling build-ids
completely was that it caused images to grow a lot. Correct solution is
to disable it from images only and let it exists in elf files for
debugging purposes.
2008-04-15 Lubomir Kundrak <lkundrak@redhat.com>
* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): take only .text
section into account, newer toolchains generate unique build ids
* configure.ac: remove the test for --build-id=none acceptance,
we want build ids to bre preserved
* genmk.rb: add -R .note.gnu.build-id to objcopy, so build id
far from other sections don't cause the raw binary images grow
size
--
Lubomir Kundrak (Red Hat Security Response Team)
[-- Attachment #2: grub-1.95-buildid.patch --]
[-- Type: text/x-patch, Size: 1719 bytes --]
diff -urp grub-1.96.orig/aclocal.m4 grub-1.96/aclocal.m4
--- grub-1.96.orig/aclocal.m4 2008-04-15 00:32:05.000000000 +0200
+++ grub-1.96/aclocal.m4 2008-04-15 00:15:04.000000000 +0200
@@ -61,7 +61,7 @@ for link_addr in 2000 8000 7C00; do
else
AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
fi
- if AC_TRY_COMMAND([${OBJCOPY-objcopy} -O binary conftest.exec conftest]); then :
+ if AC_TRY_COMMAND([${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest]); then :
else
AC_MSG_ERROR([${OBJCOPY-objcopy} cannot create binary files])
fi
diff -urp grub-1.96.orig/configure.ac grub-1.96/configure.ac
--- grub-1.96.orig/configure.ac 2008-04-15 00:32:05.000000000 +0200
+++ grub-1.96/configure.ac 2008-04-15 00:33:20.000000000 +0200
@@ -237,16 +237,6 @@ if test "x$target_m32" = x1; then
TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
fi
-AC_MSG_CHECKING([whether the linker accepts `--build-id=none'])
-save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-AC_TRY_LINK(, , build_id_flag=yes, build_id_flag=no)
-AC_MSG_RESULT([$build_id_flag])
-LDFLAGS="$save_LDFLAGS"
-if test "x$build_id_flag" = xyes; then
- TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none"
-fi
-
#
# Compiler features.
#
diff -urp grub-1.96.orig/genmk.rb grub-1.96/genmk.rb
--- grub-1.96.orig/genmk.rb 2008-04-15 00:32:05.000000000 +0200
+++ grub-1.96/genmk.rb 2008-04-15 00:15:04.000000000 +0200
@@ -57,7 +57,7 @@ class Image
MOSTLYCLEANFILES += #{deps_str}
#{@name}: #{exe}
- $(OBJCOPY) -O binary -R .note -R .comment $< $@
+ $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@
#{exe}: #{objs_str}
$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
next reply other threads:[~2008-04-14 22:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-14 22:41 Lubomir Kundrak [this message]
2008-04-15 13:35 ` [PATCH] Preserve build IDs Robert Millan
2008-04-15 19:04 ` Pavel Roskin
2008-04-17 11:51 ` Lubomir Kundrak
2008-04-17 19:14 ` Pavel Roskin
2008-04-17 14:14 ` Robert Millan
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=1208212910.3971.53.camel@localhost.localdomain \
--to=lkundrak@redhat.com \
--cc=grub-devel@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.