[PATCH] D83387: [llvm-readobj] - Add a generic test for --dyn-relocations and fix an issue.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 04:28:38 PDT 2020


grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/dynamic-reloc.test:59
+
+--- !ELF
+FileHeader:
----------------
MaskRay wrote:
> Can the test be merged with dynamic-reloc-no-section-headers.test?
> 
> We also miss a warning: `'[[FILE]]': section header string table index xxx does not exist`
> Can the test be merged with dynamic-reloc-no-section-headers.test?
Yes, but I think we should merge `dynamic-reloc-no-section-headers.test` (specific case) -> `here` (general test) after.

`dynamic-reloc-no-section-headers.test`  tests the case when there are no section headers.
It is a sub-case for `--dyn-relocations` and it is implemented with:

```
## We simulate no section header table by
## overriding the ELF header properties.
  SHOff:   0x0
  SHNum:   0x0
```

But now we have a different way to do this:

```
SectionHeaderTable:
  NoHeaders: true
```

So in a follow-up we should be able to remove the `dynamic-reloc-no-section-headers.test` and just extend this test to do something like:

```
SectionHeaderTable:
  NoHeaders: [[NOHEADERS]]
```

> We also miss a warning: '[[FILE]]': section header string table index xxx does not exist

Why should we emit it? We have a `.shstrtab` section in this object (implicitly created).
I've added `--implicit-check-not=warning:` just in case, to demonstrate that we expect no warnings here.


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

https://reviews.llvm.org/D83387





More information about the llvm-commits mailing list