diff options
author | Alexander Richardson <arichardson.kde@gmail.com> | 2018-02-19 19:53:44 +0000 |
---|---|---|
committer | Alexander Richardson <arichardson.kde@gmail.com> | 2018-02-19 19:53:44 +0000 |
commit | 6c85992c6da7ee88265e4ff7f69776b520d54891 (patch) | |
tree | b41e06d475201e6bf98b034d42ff90d5f2464076 /llvm/tools/llvm-objcopy/Object.cpp | |
parent | e60f1472f144be13170f072b160c39b34d731e6b (diff) | |
download | bcm5719-llvm-6c85992c6da7ee88265e4ff7f69776b520d54891.tar.gz bcm5719-llvm-6c85992c6da7ee88265e4ff7f69776b520d54891.zip |
[llvm-objcopy] Use the full filename in --add-gnu-debuglink
Summary:
The current implementation was writing the file name without the extension
whereas GNU objcopy writes the full filename. With this change GDB will now
load the .debug file instead of silently ignoring it.
Reviewers: jakehehrlich, jhenderson
Reviewed By: jakehehrlich
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D43474
llvm-svn: 325528
Diffstat (limited to 'llvm/tools/llvm-objcopy/Object.cpp')
-rw-r--r-- | llvm/tools/llvm-objcopy/Object.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/llvm-objcopy/Object.cpp b/llvm/tools/llvm-objcopy/Object.cpp index 53291a35d27..b3ad7329bb6 100644 --- a/llvm/tools/llvm-objcopy/Object.cpp +++ b/llvm/tools/llvm-objcopy/Object.cpp @@ -371,8 +371,8 @@ void SectionWithStrTab::initialize(SectionTableRef SecTable) { void SectionWithStrTab::finalize() { this->Link = StrTab->Index; } void GnuDebugLinkSection::init(StringRef File, StringRef Data) { - FileName = sys::path::stem(File); - // The format for the .gnu_debuglink starts with the stemmed file name and is + FileName = sys::path::filename(File); + // The format for the .gnu_debuglink starts with the file name and is // followed by a null terminator and then the CRC32 of the file. The CRC32 // should be 4 byte aligned. So we add the FileName size, a 1 for the null // byte, and then finally push the size to alignment and add 4. |