[PATCH] D57105: [ELF] Return the section name when calling getSymbolName on a section symbol.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 28 02:16:54 PST 2019


jhenderson added a comment.

For the record, this fixes https://bugs.llvm.org/show_bug.cgi?id=39995.

@mattd, could you please update that bug to show that you are working on it, to prevent duplicate work.



================
Comment at: test/Object/nm-trivial-object.test:21-22
 RUN:         | FileCheck %s -check-prefix ABSOLUTE-ELF64
+RUN: llvm-nm -a %p/Inputs/IsNAN.o \
+RUN:         | FileCheck %s -check-prefix ELF64-DEBUG-SYMS
 RUN: llvm-nm %p/Inputs/trivial-object-test.macho-i386 \
----------------
mattd wrote:
> jhenderson wrote:
> > I'm not sure you're using the right input for this sort of test. I'd expect it to be something like `%p/Inputs/trivial-object-test.elf-x86-64`, which allows you to then compare the two sets of symbols to see what's different.
> IsNAN.o has  both .debug sections and a .note section.  Testing IsNAN will exercise both of those cases in llvm-nm.cpp `getSymbolNMTypeChar.`  The test you mention (`trivial-object-test.elf-x86-64`) only has a .note section.  I wanted to test the .debug and .note cases. 
I personally feel like that's a different test case. I think that there are two related-but-different behaviours that need testing here:

1) That section symbols have their name printed (that's not specific to .debug* sections - it includes other section symbols, such as .text and .data).
2) That the (currently untested) behaviour in `getSymbolNMTypeChar` around debug sections is correct (i.e. 'N' for .debug* and 'n' for notes).

I suppose that you can test the first whilst testing the second, but they don't have to be.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57105/new/

https://reviews.llvm.org/D57105





More information about the llvm-commits mailing list