[PATCH] D61117: Fix Bug 41353 - unique symbols printed as D instead of u

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 13 02:16:03 PDT 2019


grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-nm/X86/unique.test:13
+#
+# RUN: yaml2obj < %s | llvm-nm - | FileCheck %s
+
----------------
The header you wrote looks nice for me personally, but the problem that it is inconsistent
with other tests (I do not think we usually write how the llvm-mc was called for the very trivial cases like this).

Also, the problem is that your YAML has more sections than needed. (And removing the sections would need to
update your comment about how the YAML was produced, what is probably does not make value here since it
is a very simple case which just does not need llvm-mc I think).

So I think you can just use:

```
## Check that we print 'u' for unique symbols
# RUN: yaml2obj < %s | llvm-nm - | FileCheck %s

--- !ELF
FileHeader:      
  Class:           ELFCLASS64
  Data:            ELFDATA2LSB
  Type:            ET_REL
  Machine:      EM_X86_64
Sections:        
  - Name:            .data
    Type:            SHT_PROGBITS
    Flags:           [ SHF_WRITE, SHF_ALLOC ]
    AddressAlign:    0x0000000000000001
    Content:         '00'
Symbols:         
  - Name:            foo
    Type:            STT_OBJECT
    Section:         .data
    Binding:         STB_GNU_UNIQUE
...

# CHECK: 0000000000000000 u foo
```

Or even may be:

```
## Check that we print 'u' for unique symbols
# RUN: yaml2obj < %s | llvm-nm - | FileCheck %s

--- !ELF
FileHeader:      
  Class:           ELFCLASS64
  Data:            ELFDATA2LSB
  Type:            ET_REL
  Machine:      EM_X86_64
Symbols:         
  - Name:          foo
    Binding:        STB_GNU_UNIQUE
...

# CHECK: 0000000000000000 u foo
```


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61117





More information about the llvm-commits mailing list