[llvm-bugs] [Bug 40885] New: llvm-objcopy --compress-debug-sections does not work on any non-trivial example
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Feb 27 06:56:18 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=40885
Bug ID: 40885
Summary: llvm-objcopy --compress-debug-sections does not work
on any non-trivial example
Product: tools
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: llvm-objcopy
Assignee: unassignedbugs at nondot.org
Reporter: jh7370.2008 at my.bristol.ac.uk
CC: alexander.v.shaposhnikov at gmail.com,
jake.h.ehrlich at gmail.com,
jh7370.2008 at my.bristol.ac.uk,
llvm-bugs at lists.llvm.org, rupprecht at google.com
I stumbled on this and filed bug 40818, whilst trying to test
https://reviews.llvm.org/D58510. Bug 40818 fixed the invalidation of
relocations (by emitting a new error message), but as a result, the new error
message now always fires with any non-trivial example:
// test.cpp - could be basically anything...
int foo();
int bar ()
{
return foo();
}
$ clang -c -g test.cpp
$ llvm-objcopy --compress-debug-sections test.o test2.o
llvm-objcopy: error: Section .debug_abbrev cannot be removed because of symbol
'' used by the relocation patching offset 0x6 from section .rela.debug_info.
The problem is that --compress-debug-sections attempts to replace (by removing
and adding a new section) debug sections containing section symbols referred to
by relocations (usually which patch other debug sections). The relocations are
supposed to remain unchanged, which implies that the symbols in these sections
(including the section symbols) must remain unchanged. Instead, llvm-objcopy
attempts to remove them and emits an error. Conclusion: when replacing the
sections due to --compress-debug-sections, we should update the symbols in
those sections to reference the new sections.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190227/c3735d3f/attachment.html>
More information about the llvm-bugs
mailing list