This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy] Add --add-gnu-debuglink
ClosedPublic

Authored by jakehehrlich on Jan 4 2018, 9:43 AM.

Details

Summary

This change adds support for --add-gnu-debuglink to llvm-objcopy

Diff Detail

Repository
rL LLVM

Event Timeline

jakehehrlich created this revision.Jan 4 2018, 9:43 AM
jhenderson added inline comments.Jan 8 2018, 3:28 AM
tools/llvm-objcopy/Object.cpp
359–360

"turns out to be fine" implies that you don't know the underlying code. I think it might be better to remove this first sentence and simply say "For sections not found in segments, OriginalOffset is only used to establish the order that sections should go in."

364

Why not use std::numeric_limits<uint64_t>::max()?

384

Could this also supply the appropriate error message, please, e.g. "file not found" or "access denied".

tools/llvm-objcopy/llvm-objcopy.cpp
121

Has this line been clang-formatted?

  1. Used numeric limits max instead of a cast and bitwise hack
  2. Modified comment
  3. Clang formated add-gnu-debuglink
  4. Updated error message to display the specific error not just the vague "could not be opened" message.
jhenderson accepted this revision.Jan 9 2018, 2:17 AM

LGTM, with one change.

tools/llvm-objcopy/Object.h
362–363

Do you need this constructor? It's not called anywhere as far as I can see?

This revision is now accepted and ready to land.Jan 9 2018, 2:17 AM
jakehehrlich closed this revision.Jan 10 2018, 10:22 AM