Page MenuHomePhabricator
Feed Advanced Search

Today

jhenderson updated the diff for D56791: [llvm-readobj][ELF]Add demangling support.

Add documentation update.

Wed, Jan 16, 9:24 AM
jhenderson updated the summary of D56791: [llvm-readobj][ELF]Add demangling support.
Wed, Jan 16, 9:16 AM
jhenderson added a parent revision for D56791: [llvm-readobj][ELF]Add demangling support: D56721: Move llvm-objdump demangle function into demangler library.
Wed, Jan 16, 9:16 AM
jhenderson added a child revision for D56721: Move llvm-objdump demangle function into demangler library: D56791: [llvm-readobj][ELF]Add demangling support.
Wed, Jan 16, 9:16 AM
jhenderson created D56791: [llvm-readobj][ELF]Add demangling support.
Wed, Jan 16, 9:14 AM
jhenderson added a comment to D56773: [llvm-symbolizer] Add -no-demangle as alias for -demangle=false.

-demangle=false is a weird option. Has it been ever documented? If not, probably we should remove it and document only -no-demangle.

I agree with you, hence why I filed the bug in the firsts place. The "=false" syntax is documented on the CommandLine library page (see https://llvm.org/docs/CommandLine.html#boolean-arguments), but I don't think it is documented explicit in the llvm-symbolizer page.

Wed, Jan 16, 8:35 AM
jhenderson added a comment to D56780: [llvm-objdump] - Dump the archive headers when -all-headers is specified.

The code change looks good to me, but I'd like a bit more testing, if it's okay. I assume that the output is something like the following for each archive member in turn:

Wed, Jan 16, 7:27 AM
jhenderson accepted D56778: [llvm-objdump] - Simplify the getRelocationValueString. NFCI..

LGTM, with one nit.

Wed, Jan 16, 5:38 AM
jhenderson added a comment to D56721: Move llvm-objdump demangle function into demangler library.

But this does not protect us from anything in release builds.

Isn't that the whole point of asserts? "Catch the things that are not supposed to happen in debug builds so that you don't have to pay the cost of checking them in release builds."

Exactly. The code isn't supposed to get into this state in the first place (it would be a programmer error if it did), so we can assume it isn't in our release builds.

Wed, Jan 16, 3:55 AM
jhenderson added a reviewer for D56721: Move llvm-objdump demangle function into demangler library: erik.pilkington.
Wed, Jan 16, 3:03 AM
jhenderson updated the diff for D56721: Move llvm-objdump demangle function into demangler library.

Address review comments:

  • Switch to .str().c_str() to ensure null-termination instead of assert
  • clang-format
  • Fix doc comment
  • Pass in nullptr into demangle functions explicitly
  • change namespacing style
Wed, Jan 16, 3:03 AM
jhenderson added a comment to D56773: [llvm-symbolizer] Add -no-demangle as alias for -demangle=false.

I had a look at an option to disable demangling, as I worked on PR40054, but didn't come up with a clean way of handling both --demangle and --no-demangle, using the cl interface. There, I decided to abandon it, as demangling will be off by default, so we don't need to explicitly disable it. Here is different, because demangling is on by default (and the --demangle switch needs to exist for GNU compatibility). Using tablegen would make it possible to have both sensibly (see examples in e.g. LLD), but I don't think we should do that at this point.

Wed, Jan 16, 2:04 AM
jhenderson accepted D55629: [elfabi] Add support for reading DT_SONAME from binaries.

I think it's fine to land this as is.

Wed, Jan 16, 1:42 AM
jhenderson accepted D56726: Include section start address when dumping hexadecimal output of a section, -x option.q.

LGTM, with a couple of minor nits in the test. I assume Section.getAddress() returns 0 for sections in an ET_REL file?

Wed, Jan 16, 1:37 AM

Yesterday

jhenderson accepted D56629: [llvm-readelf] Allow single-letter flags to be merged..

LGTM!

Tue, Jan 15, 7:44 AM
jhenderson created D56721: Move llvm-objdump demangle function into demangler library.
Tue, Jan 15, 7:41 AM
jhenderson accepted D56591: [llvm-symbolizer] Add -C as a short alias to -demangle.

LGTM. I'm happy with this, but I'd like @ruiu to give a final thumbs up with relation to his comment.

Tue, Jan 15, 4:21 AM
jhenderson added a comment to D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.

I agree that the design maybe needs a bit more discussion. Perhaps the message you posted in the comment thread should be posted as an RFC on the llvm-dev mailing list?

Tue, Jan 15, 2:34 AM
jhenderson added inline comments to D56629: [llvm-readelf] Allow single-letter flags to be merged..
Tue, Jan 15, 2:22 AM
jhenderson added inline comments to D56591: [llvm-symbolizer] Add -C as a short alias to -demangle.
Tue, Jan 15, 2:15 AM
jhenderson accepted D56570: [llvm-objcopy] Use SHT_NOTE for added note sections..

LGTM. I checked the test works for me after the modification.

Tue, Jan 15, 2:12 AM
jhenderson accepted D55629: [elfabi] Add support for reading DT_SONAME from binaries.

LGTM, aside from one small comment.

Tue, Jan 15, 2:05 AM

Mon, Jan 14

jhenderson accepted D56660: [llvm-objcopy] [COFF] Remove unreferenced undefined externals with --strip-unneeded..

LGTM.

Mon, Jan 14, 5:39 AM
jhenderson accepted D56659: [llvm-objcopy] [COFF] Test absolute symbols wrt --strip-unneeded and --discard-all. NFC..

LGTM. I'm assuming that the -1 SectionNumber is what makes them absolute?

Mon, Jan 14, 5:37 AM
jhenderson accepted D56637: [llvm-objdump] - Cleanup the code. NFCI..

LGTM.

Mon, Jan 14, 3:23 AM
jhenderson added inline comments to D56637: [llvm-objdump] - Cleanup the code. NFCI..
Mon, Jan 14, 3:13 AM
jhenderson added inline comments to D56637: [llvm-objdump] - Cleanup the code. NFCI..
Mon, Jan 14, 2:56 AM
jhenderson added a comment to D56591: [llvm-symbolizer] Add -C as a short alias to -demangle.

The Itanium demangler is used typically for ELF C++ symbols. If you take a look at test/tools/llvm-objdump/X86/demangle.s, you can see how the (de-)mangling happens. test/DebugInfo/llvm-symbolizer.test also uses the --demangle switch, and you could extend it to add -C alongside the demangle=false case or similar, if you want.

Mon, Jan 14, 2:54 AM
jhenderson accepted D56481: [llvm-objcopy] [COFF] Implement --strip-all[-gnu] for symbols.

Latest version LGTM, but I'd like someone else to give a thumbs up too, as I don't know enough about COFF to be able to spot any potential issues necessarily.

Mon, Jan 14, 2:48 AM
jhenderson added a comment to D56637: [llvm-objdump] - Cleanup the code. NFCI..

Normally, I wouldn't support whole-sale style changes like this, but the files have a weird mixture of styles, so I'm happy that we're normalising. Thanks!

Mon, Jan 14, 2:38 AM
jhenderson added a comment to D56635: [llvm-symbolizer] Add -addresses, -a as aliases for -print-address.

I'll file a bug for it, as it's probably worth fixing this all in one go.

https://bugs.llvm.org/show_bug.cgi?id=40304

Mon, Jan 14, 2:07 AM
jhenderson added a comment to D56635: [llvm-symbolizer] Add -addresses, -a as aliases for -print-address.

One thing I've noticed is that single-letter arguments can be combined in GNU addr2line (e.g. addr2line -aC means demangle and print addresses), but not llvm-symbolizer as things stand. I'll file a bug for it, as it's probably worth fixing this all in one go.

Mon, Jan 14, 2:01 AM
jhenderson accepted D56635: [llvm-symbolizer] Add -addresses, -a as aliases for -print-address.

LGTM.

Mon, Jan 14, 1:58 AM
jhenderson added a comment to D56629: [llvm-readelf] Allow single-letter flags to be merged..

One question: what happens if you do enable grouping, and there's an ambiguous alias?

Mon, Jan 14, 1:55 AM
jhenderson requested changes to D56570: [llvm-objcopy] Use SHT_NOTE for added note sections..

Is it possible to force the type of a section called ".note..." to something other than SHT_NOTE?

I don't think so, but that's also kind of the point of this patch -- without it, there isn't a way to add a .note section and have it be an actual SHT_NOTE. I think .note sections are always expected to be SHT_NOTE (with the noted exception of .note.GNU-stack), so adding it as PROGBITS is weird.

Good point.

Mon, Jan 14, 1:42 AM

Fri, Jan 11

jhenderson accepted D56480: [llvm-objcopy] [COFF] Implmement --strip-unneeded and -x/--discard-all for symbols.

LGTM.

Fri, Jan 11, 6:06 AM
jhenderson added inline comments to D56480: [llvm-objcopy] [COFF] Implmement --strip-unneeded and -x/--discard-all for symbols.
Fri, Jan 11, 5:35 AM
jhenderson accepted D56584: [llvm-objcopy] [COFF] Fix writing object files without symbols/string table.

LGTM.

Fri, Jan 11, 5:31 AM
jhenderson accepted D56588: [llvm-objdump] - Change the output for --all-headers..

LGTM.

Fri, Jan 11, 5:29 AM
jhenderson added a comment to D56591: [llvm-symbolizer] Add -C as a short alias to -demangle.

Could you add an ELF test for this too, please, to show the route through the Itanium demangler (and when it doesn't go through it for -C=false)?

Fri, Jan 11, 5:02 AM
jhenderson added inline comments to D56588: [llvm-objdump] - Change the output for --all-headers..
Fri, Jan 11, 4:53 AM
jhenderson accepted D56580: [llvm-symbolizer] Add -exe, -e as aliases to -obj.

LGTM.

Fri, Jan 11, 3:51 AM
jhenderson added a comment to D56584: [llvm-objcopy] [COFF] Fix writing object files without symbols/string table.

I'm not quite sure I follow why this only affects executable files? Why is this an issue in PE but not plain COFF?

Initially I tried to make the output of llvm-objcopy as close as possible to the output from various tools (llvm-mc and MSVC), and to achieve this, I only skipped including the symbol/string table in executables, while keeping it present in object files.

I know that exactly matching the output of another tool shouldn't be a goal in itself, but I don't know if there are tools out there that would flat out reject an object file with an omitted symbol/string table, as opposed to an empty symbol/string table. So keeping this distinction probably is safer.

Fri, Jan 11, 3:13 AM
jhenderson added inline comments to D56480: [llvm-objcopy] [COFF] Implmement --strip-unneeded and -x/--discard-all for symbols.
Fri, Jan 11, 3:02 AM
jhenderson added a comment to D55629: [elfabi] Add support for reading DT_SONAME from binaries.

Basically looks fine to me, with one outstanding issue, namely that I feel like the address to offset code is a reinvention of something either in llvm-objcopy or llvm-objdump somewhere, but I don't remember where unfortunately. I'd suggest checking how llvm-objdump (or possibly llvm-readobj) looks up information relating to dynamic symbols etc.

Fri, Jan 11, 2:54 AM
jhenderson added a comment to D56481: [llvm-objcopy] [COFF] Implement --strip-all[-gnu] for symbols.

Okay, this LGTM, although I don't know enough about the characteristics stuff to be able to comment on that, so please get somebody else to review that bit.

Fri, Jan 11, 2:34 AM
jhenderson added inline comments to D56481: [llvm-objcopy] [COFF] Implement --strip-all[-gnu] for symbols.
Fri, Jan 11, 2:16 AM
jhenderson added a comment to D56584: [llvm-objcopy] [COFF] Fix writing object files without symbols/string table.

I'm not quite sure I follow why this only affects executable files? Why is this an issue in PE but not plain COFF?

Fri, Jan 11, 2:09 AM
jhenderson added inline comments to D56580: [llvm-symbolizer] Add -exe, -e as aliases to -obj.
Fri, Jan 11, 2:01 AM
jhenderson added a comment to D56570: [llvm-objcopy] Use SHT_NOTE for added note sections..

I think this is probably okay, but I'm not 100% convinced. Is it possible to force the type of a section called ".note..." to something other than SHT_NOTE? I'm not sure if there's really a use case for this beyond testing though, so it's probably fine.

Fri, Jan 11, 1:54 AM
jhenderson added a comment to D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.

On the hex versus decimal front, I think hex is the better way to go.

Fri, Jan 11, 1:45 AM
jhenderson accepted D56513: [llvm-objcopy][NFC] Consistenly use two dashes for flags in tests..

LGTM.

Fri, Jan 11, 1:25 AM

Thu, Jan 10

jhenderson accepted D56542: [llvm-symbolizer] Add -p as alias to -pretty-print.

LGTM!

Thu, Jan 10, 7:15 AM
jhenderson added inline comments to D56542: [llvm-symbolizer] Add -p as alias to -pretty-print.
Thu, Jan 10, 7:08 AM
jhenderson added a comment to D56542: [llvm-symbolizer] Add -p as alias to -pretty-print.

Okay, looks good once the issue with the dashes is fixed.

Thu, Jan 10, 7:05 AM
jhenderson added inline comments to D56481: [llvm-objcopy] [COFF] Implement --strip-all[-gnu] for symbols.
Thu, Jan 10, 7:02 AM
jhenderson added a comment to D56542: [llvm-symbolizer] Add -p as alias to -pretty-print.

Thanks for working on this!

Thu, Jan 10, 6:25 AM
jhenderson added inline comments to D56272: [llvm-symbolizer] Add support for specifying input addresses on the command-line.
Thu, Jan 10, 6:16 AM
jhenderson committed rL350821: [llvm-symbolizer] Add support for specifying addresses on command-line.
[llvm-symbolizer] Add support for specifying addresses on command-line
Thu, Jan 10, 6:13 AM
jhenderson closed D56272: [llvm-symbolizer] Add support for specifying input addresses on the command-line.
Thu, Jan 10, 6:13 AM
jhenderson added inline comments to D56480: [llvm-objcopy] [COFF] Implmement --strip-unneeded and -x/--discard-all for symbols.
Thu, Jan 10, 2:25 AM
jhenderson updated the diff for D56272: [llvm-symbolizer] Add support for specifying input addresses on the command-line.

Add quotes and remove spurious redirection.

Thu, Jan 10, 2:01 AM
jhenderson added a comment to D56513: [llvm-objcopy][NFC] Consistenly use two dashes for flags in tests..

What's most important to me is that we are consistent, primarily within individual files, so that it looks somewhat professional ;-). I do agree that if we want to support single-dash options, we should test both that and double-dash explicitly, much like we test both short and long options. This would probably belong in the "basic" test for each option.

Thu, Jan 10, 1:34 AM

Wed, Jan 9

jhenderson updated the diff for D56272: [llvm-symbolizer] Add support for specifying input addresses on the command-line.

Use -e to simplify the echo commands in the test.

Wed, Jan 9, 10:00 AM
jhenderson added a comment to D56272: [llvm-symbolizer] Add support for specifying input addresses on the command-line.

Thanks @ruiu!

Wed, Jan 9, 9:41 AM
jhenderson updated the diff for D56272: [llvm-symbolizer] Add support for specifying input addresses on the command-line.

Move fgets inside loop termination condition.

Wed, Jan 9, 9:41 AM
jhenderson added a comment to D56272: [llvm-symbolizer] Add support for specifying input addresses on the command-line.

Ping!

Wed, Jan 9, 8:54 AM

Tue, Jan 8

jhenderson accepted D56431: [llvm-objcopy] [COFF] Remove pointless Reader/Writer base classes. NFC..

LGTM. I have no issue with this, but I'd like @jakehehrlich to give his opinion as essentially it's a design choice as to how much the COFF structure of llvm-objcopy should match the ELF structure.

Tue, Jan 8, 3:48 AM
jhenderson committed rL350615: [llvm-readobj] Don't print '@' at end of unversioned dynsym names.
[llvm-readobj] Don't print '@' at end of unversioned dynsym names
Tue, Jan 8, 3:02 AM
jhenderson closed D56319: [llvm-readobj] Don't print '@' at end of dynamic symbol names for symbols with no version.
Tue, Jan 8, 3:02 AM
jhenderson committed rL350614: [ELF] Remove checking for spurious '@' at the end of dynamic sym names.
[ELF] Remove checking for spurious '@' at the end of dynamic sym names
Tue, Jan 8, 2:55 AM
jhenderson committed rLLD350614: [ELF] Remove checking for spurious '@' at the end of dynamic sym names.
[ELF] Remove checking for spurious '@' at the end of dynamic sym names
Tue, Jan 8, 2:55 AM
jhenderson closed D56388: [ELF] Remove checking for spurious '@' at the end of dynamic symbol names.
Tue, Jan 8, 2:54 AM

Mon, Jan 7

jhenderson accepted D53667: [llvm-objcopy] Handle -O <format> flag..

LGTM!

Mon, Jan 7, 7:21 AM
jhenderson added a child revision for D56388: [ELF] Remove checking for spurious '@' at the end of dynamic symbol names: D56319: [llvm-readobj] Don't print '@' at end of dynamic symbol names for symbols with no version.
Mon, Jan 7, 7:18 AM
jhenderson added a parent revision for D56319: [llvm-readobj] Don't print '@' at end of dynamic symbol names for symbols with no version: D56388: [ELF] Remove checking for spurious '@' at the end of dynamic symbol names.
Mon, Jan 7, 7:18 AM
jhenderson created D56388: [ELF] Remove checking for spurious '@' at the end of dynamic symbol names.
Mon, Jan 7, 7:18 AM
jhenderson committed rL350522: [llvm-nm] Add --portability as alias for --format=posix.
[llvm-nm] Add --portability as alias for --format=posix
Mon, Jan 7, 6:16 AM
jhenderson closed D56312: [llvm-nm] Add --portability as alias for --format=posix.
Mon, Jan 7, 6:16 AM
jhenderson accepted D55881: [llvm-objcopy] [COFF] Add support for removing symbols.

LGTM, but please wait for the others to confirm they're happy.

Mon, Jan 7, 5:28 AM
jhenderson accepted D56294: [ObjectYAML] [COFF] Support multiple symbols with the same name.
Mon, Jan 7, 5:27 AM
jhenderson accepted D56294: [ObjectYAML] [COFF] Support multiple symbols with the same name.

Okay, looking much better. I'm happy for this to go in, but if any of the other bits I highlighted can be removed, even better.

Mon, Jan 7, 4:38 AM
jhenderson added inline comments to D55629: [elfabi] Add support for reading DT_SONAME from binaries.
Mon, Jan 7, 3:47 AM
jhenderson added inline comments to D55881: [llvm-objcopy] [COFF] Add support for removing symbols.
Mon, Jan 7, 3:03 AM
jhenderson accepted D53667: [llvm-objcopy] Handle -O <format> flag..

LGTM, with a couple of minor comments.

Mon, Jan 7, 2:53 AM
jhenderson accepted D56294: [ObjectYAML] [COFF] Support multiple symbols with the same name.

I'm giving a conditional LGTM, assuming that the mentioned YAML blob is as small as reasonably possible to test the relocations. Remember, we don't need to have a fully usable object file, we just need one that has the relevant symbols and relocations.

Mon, Jan 7, 2:46 AM

Fri, Jan 4

jhenderson created D56319: [llvm-readobj] Don't print '@' at end of dynamic symbol names for symbols with no version.
Fri, Jan 4, 8:08 AM
jhenderson added a comment to D49084: FileCheck: Add support for numeric variables and expressions.

This change is so large that it's going to take quite a while to review. However, I've made a few initial comments on the header. I'll come back to this next week and continue from there.

Fri, Jan 4, 7:48 AM
jhenderson added inline comments to D56294: [ObjectYAML] [COFF] Support multiple symbols with the same name.
Fri, Jan 4, 5:48 AM
jhenderson created D56312: [llvm-nm] Add --portability as alias for --format=posix.
Fri, Jan 4, 3:57 AM
jhenderson added a comment to D56294: [ObjectYAML] [COFF] Support multiple symbols with the same name.

I think a composite test (or tests) would makes sense, but check the intermediate output as well as the final output.

Fri, Jan 4, 2:52 AM
jhenderson added inline comments to D53667: [llvm-objcopy] Handle -O <format> flag..
Fri, Jan 4, 2:39 AM
jhenderson added inline comments to D55881: [llvm-objcopy] [COFF] Add support for removing symbols.
Fri, Jan 4, 2:17 AM

Thu, Jan 3

jhenderson added inline comments to D56211: [llvm-objcopy][ELF] Implement a mutable section visitor that updates size-related fields (Size, EntrySize, Align) before layout..
Thu, Jan 3, 9:51 AM
jhenderson created D56272: [llvm-symbolizer] Add support for specifying input addresses on the command-line.
Thu, Jan 3, 8:11 AM
jhenderson added a comment to D55881: [llvm-objcopy] [COFF] Add support for removing symbols.

llvm-readobj -symbols is way too verbose for a neat test here (it prints 5+ lines per symbol)

Not that it's really relevant here, I think, but llvm-readelf (aka GNU output style for llvm-readobj) produces single line output for each symbol. I've not looked, but I'm guessing that llvm-readobj doesn't have an equivalent for COFF. Maybe that's worth taking a look at at some point? We actually tend to use the verbose output style for the llvm-objcopy ELF tests though.

Thu, Jan 3, 2:49 AM
jhenderson accepted D56211: [llvm-objcopy][ELF] Implement a mutable section visitor that updates size-related fields (Size, EntrySize, Align) before layout..

LGTM, with a couple of minor comments.

Thu, Jan 3, 2:18 AM

Wed, Jan 2

jhenderson accepted D56123: [llvm-objdump] - Print symbol addressed when dumping disassembly output (-d).

LGTM too. Not that I'm saying you should change it, as I don't know how complex it would be, but perhaps an alternative to consider might have been to disassemble the first zeroes after a symbol, even without -z. Something like this:

foo:
10: 00 00
...
bar:
40: 00 00
...

I'm not sure how desirable that is versus the alternative though (really, I'm not sure I see much benefit to the behaviour of not disassembling zeroes, but that's just me).

Wed, Jan 2, 5:36 AM
jhenderson added a comment to D56083: [llvm-objdump] - Implement -z/--disassemble-zeroes.

A few suggested comment improvements and one function name from me. Otherwise looks good.

Wed, Jan 2, 4:54 AM
jhenderson accepted D56076: [llvm-objdump] - Do not include reserved undefined symbol in -t output..

LGTM, with a couple of nits.

Wed, Jan 2, 4:44 AM