[PATCH] D71735: [ELF] Don't suggest an alternative spelling for a symbol in a discarded section

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 21 01:28:30 PST 2019


grimar added inline comments.


================
Comment at: lld/test/ELF/undef-not-suggest.s:1
+# REQUIRES: riscv
+## Check we don't suggest alternative spelling for relocations to symbols
----------------
MaskRay wrote:
> grimar wrote:
> > I wonder if we should use yaml2obj (if possible) and make this test be not 'riscv' specific?
> A yaml2obj test will degrade test coverage.
> 
> ```
> Symbols:
>   - Name:    foo
>     Section: .text.foo
>   - Name:    for
>     Section: .data
>   - Name:    .text.foo
>     Type:    STT_SECTION
>     Section: .text.foo
> ### This symbol's name is ".data", instead of "" as produced by an assembler.
> ### We need a symbol with empty name for the `.quad .text.foo` test, to test that an empty name will not be suggested.
>   - Name:    .data
>     Type:    STT_SECTION
>     Section: .data
> ```
I think there is no problem to use an empty name for a symbol.
Am I missing something? The following seems just works.

```
--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_DYN
  Machine: EM_RISCV
Sections:
  - Name: .data
    Type: SHT_PROGBITS
Symbols:
  - Name:    ""
    Type:    STT_SECTION
    Section: .data
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71735





More information about the llvm-commits mailing list