minidebuginfo: Fix stripping/debuginfo
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 11 Sep 2013 08:31:44 +0000 (08:31 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 11 Sep 2013 08:31:44 +0000 (08:31 +0000)
gdb/doc/
2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.texinfo (MiniDebugInfo): Prepare file debug and use it to create
mini_debuginfo.  Strip binary before adding mini_debuginfo to it.

gdb/testsuite/
2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.base/gnu-debugdata.exp (objcopy 1): Move it lower and use only
debug part of the binary.

gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/gnu-debugdata.exp

index 442b6018b0e922eb7fdbfa460896c7eb6b4c169f..1b3e45c18273203d98d530a71b2082477b80b29b 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.texinfo (MiniDebugInfo): Prepare file debug and use it to create
+       mini_debuginfo.  Strip binary before adding mini_debuginfo to it.
+
 2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Sync documentation with gdb.base/gnu-debugdata.exp.
index 00f8e7774bc6a8ce4ae9677f644d00545c8180fe..b6ba23921a6ede16ed7482018c018841b6fbb6cf 100644 (file)
@@ -17340,10 +17340,16 @@ nm @var{binary} --format=posix --defined-only \
 # table.
 comm -13 dynsyms funcsyms > keep_symbols
 
+# Separate full debug info into debug binary.
+objcopy --only-keep-debug @var{binary} debug
+
 # Copy the full debuginfo, keeping only a minimal set of symbols and
 # removing some unnecessary sections.
 objcopy -S --remove-section .gdb_index --remove-section .comment \
-  --keep-symbols=keep_symbols @var{binary} mini_debuginfo
+  --keep-symbols=keep_symbols debug mini_debuginfo
+
+# Drop the full debug info from the original binary.
+strip --strip-all -R .comment @var{binary}
 
 # Inject the compressed data into the .gnu_debugdata section of the
 # original binary.
index 1bf8fb8a92a22ada6806b86a33dca566936411ed..aa7397e5179c19fe065d565c273a4e606fff4d16 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.base/gnu-debugdata.exp (objcopy 1): Move it lower and use only
+       debug part of the binary.
+
 2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * gdb.base/gnu-debugdata.exp (strip): Add -R .comment.
index bbd3a763726d98a75de910d4bf5c370654d82b63..e567ea8acda47d552e9f526d066944472ed6d6fc 100644 (file)
@@ -89,13 +89,6 @@ if {[run_on_host "comm" "comm" "-13 ${binfile}.dynsyms ${binfile}.funcsyms" "" \
     return -1
 }
 
-# Copy the full debuginfo, keeping only a minimal set of symbols and
-# removing some unnecessary sections.
-remote_file host delete ${binfile}.mini_debuginfo
-if {[run_on_host "objcopy 1" [transform objcopy] "-S --remove-section .gdb_index --remove-section .comment --keep-symbols=${binfile}.keep_symbols ${binfile} ${binfile}.mini_debuginfo"]} {
-    return -1
-}
-
 # GDB specific - we do not have split executable in advance.
 remote_file host delete ${binfile}.strip
 if {[run_on_host "strip" [transform strip] \
@@ -110,6 +103,13 @@ if {[run_on_host "copydebug" [transform objcopy] \
     return -1
 }
 
+# Copy the full debuginfo, keeping only a minimal set of symbols and
+# removing some unnecessary sections.
+remote_file host delete ${binfile}.mini_debuginfo
+if {[run_on_host "objcopy 1" [transform objcopy] "-S --remove-section .gdb_index --remove-section .comment --keep-symbols=${binfile}.keep_symbols ${binfile}.debug ${binfile}.mini_debuginfo"]} {
+    return -1
+}
+
 # Add the .gnu_debuglink section to the .gnu_debugdata file.
 # .gnu_debuglink is normally not present in the .gnu_debugdata section but in
 # some files there may be PT_NOTE with NT_GNU_BUILD_ID and GDB could look up
This page took 0.077063 seconds and 4 git commands to generate.