[Bug binutils/14663] strip --only-keep-debug doesn't remove .text, etc.
https://sourceware.org/bugzilla/show_bug.cgi?id=14663 Alan Modra changed: What|Removed |Added Resolution|--- |FIXED Status|REOPENED|RESOLVED --- Comment #9 from Alan Modra --- (In reply to Fangrui Song from comment #8) > I want to ask a related question. Why have these sections to be kept in the > section header table while they are made SHT_NOBITS? It was for matching executables against their debug-only objects. There are better ways to do that, of course, but that was the original motivation. -- You are receiving this mail because: You are on the CC list for the bug.
[Bug binutils/14663] strip --only-keep-debug doesn't remove .text, etc.
https://sourceware.org/bugzilla/show_bug.cgi?id=14663 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #8 from Fangrui Song --- I want to ask a related question. Why have these sections to be kept in the section header table while they are made SHT_NOBITS? Don't debuggers/symbolizes just pick sections they are interested in, i.e. .debug_* (and probably SHF_ALLOC .note* if that is why SHF_ALLOC+SHT_NOTE is not made SHT_NOBITS)? In addition, can the program headers be removed? Currently sh_offset in the section header table, and p_offset/p_filesz in the program headers are rewritten. Their values no longer reflect the original values (a consequence of **removed section contents**). If you inspect such separate debug files with readelf -Sl, you can get weird section->segment attribution. I find gdb and lldb are still happy with such separate debug files w/o progam headers. -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/14663] strip --only-keep-debug doesn't remove .text, etc.
http://sourceware.org/bugzilla/show_bug.cgi?id=14663 --- Comment #7 from dje at google dot com 2012-10-26 22:37:54 UTC --- I think a few extra words, noting that the contents are gone, but the section headers remain, would go a long way. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/14663] strip --only-keep-debug doesn't remove .text, etc.
http://sourceware.org/bugzilla/show_bug.cgi?id=14663 --- Comment #6 from Andreas Schwab 2012-10-26 22:30:05 UTC --- It already says it: `--only-keep-debug' Strip a file, removing contents of any sections that would not be ^ stripped by `--strip-debug' and leaving the debugging sections intact. In ELF files, this preserves all note sections in the output. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/14663] strip --only-keep-debug doesn't remove .text, etc.
http://sourceware.org/bugzilla/show_bug.cgi?id=14663 dje at google dot com changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID | --- Comment #5 from dje at google dot com 2012-10-26 21:53:26 UTC --- Clarification in the documentation required then. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/14663] strip --only-keep-debug doesn't remove .text, etc.
http://sourceware.org/bugzilla/show_bug.cgi?id=14663 Alan Modra changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #4 from Alan Modra 2012-10-26 21:49:16 UTC --- Your grep misses the relevant line. Add -w to objdump or -2 to grep options. gcc -g hello.c && (objdump -w -h a.out | grep text) 11 .text 0430 1490 1490 0490 2**4 CONTENTS, ALLOC, LOAD, READONLY, CODE gcc -g hello.c && strip --only-keep-debug a.out && (objdump -w -h a.out | grep text) 11 .text 0430 1490 1490 0258 2**4 ALLOC, READONLY, CODE Notice lack of CONTENTS after stripping. Keeping the section headers like this gives a user confidence that a debug file matches his binary.. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/14663] strip --only-keep-debug doesn't remove .text, etc.
http://sourceware.org/bugzilla/show_bug.cgi?id=14663 --- Comment #3 from dje at google dot com 2012-10-26 15:55:37 UTC --- Testcase: gcc -g hello.c && strip --only-keep-debug a.out && (objdump -h a.out | grep text) -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/14663] strip --only-keep-debug doesn't remove .text, etc.
http://sourceware.org/bugzilla/show_bug.cgi?id=14663 Alan Modra changed: What|Removed |Added CC||amodra at gmail dot com --- Comment #2 from Alan Modra 2012-10-22 03:15:59 UTC --- Testcase? I think you misunderstand how --only-keep-debug is supposed to work. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/14663] strip --only-keep-debug doesn't remove .text, etc.
http://sourceware.org/bugzilla/show_bug.cgi?id=14663 --- Comment #1 from dje at google dot com 2012-10-03 19:06:33 UTC --- Partial patch posted here: http://sourceware.org/ml/binutils/2012-10/msg00019.html -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/14663] strip --only-keep-debug doesn't remove .text, etc.
http://sourceware.org/bugzilla/show_bug.cgi?id=14663 Paul Pluzhnikov changed: What|Removed |Added CC||ppluzhnikov at google dot ||com -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils