llvm-project/llvm/test/tools
Georgii Rymar ec4e68e667 [yaml2obj] - Introduce the "NoHeaders" key for "SectionHeaderTable"
We have an issue currently. The following YAML piece just ignores the `Excluded` key.

```
SectionHeaderTable:
  Sections: []
  Excluded:
    - Name: .foo
```

Currently the meaning is: exclude the whole table.

The code checks that the `Sections` key is empty and doesn't catch/check
invalid/duplicated/missed `Excluded` entries.

Also there is no way to exclude all sections except the first null section,
because `Sections: []` currently just excludes the whole the sections header table.

To fix it, I suggest a change of the behavior.

1) A new `NoHeaders` key is added. It provides an explicit syntax to drop the whole table.
2) The meaning of the following is changed:

```
SectionHeaderTable:
  Sections: []
  Excluded:
    - Name: .foo

```
Assuming there are 2 sections in the object (a null section and `.foo`), with this patch it
means: exclude the `.foo` section, keep the null section. The null section is an implicit
section and I think it is reasonable to make "Sections: []" to mean it is implicitly added.
It will be consistent with the global "Sections" tag that is used to describe sections.

3) `SectionHeaderTable->Sections` is now optional. No `Sections` is the same as
   `Sections: []` (I think it avoids a confusion).
4) Using of `NoHeaders` together with `Sections`/`Excluded` is not allowed.
5) It is possible to use the `Excluded` key without the `Sections` key now (in this case
   `Excluded` must contain all sections).
6) `SectionHeaderTable:` or `SectionHeaderTable: []` is not allowed.
7) When the `SectionHeaderTable` key is present, we still require all sections to be
   present in `Sections` and `Excluded` lists. No changes here, we are still strict.

Differential revision: https://reviews.llvm.org/D81655
2020-06-15 12:43:16 +03:00
..
UpdateTestChecks [utils] change default nameless value to "TMP" 2020-06-01 06:54:45 -04:00
dsymutil [dsymutil] Don't emit N_AST symbol entries in the Mach-O companion file 2020-06-05 08:42:18 -07:00
gold Test update for a7fa35a629 2020-05-28 16:00:59 -07:00
llc Address redirect issue on Windows. 2020-01-16 15:07:50 -05:00
llvm-ar [llvm-ar] Update error messages and tests as per latest preferred style 2020-06-05 10:37:26 -07:00
llvm-as
llvm-cfi-verify
llvm-config
llvm-cov [gcov] Don't error 'unexpected end of memory buffe' 2020-06-03 22:05:15 -07:00
llvm-cvtres
llvm-cxxdump
llvm-cxxfilt [llvm-cxxfilt] Correctly demangle COFF import thunk 2019-12-16 09:50:04 -08:00
llvm-cxxmap
llvm-diff
llvm-dlltool [llvm-dlltool] Add a testcase to show the kind of weak external used for import library aliases. NFC. 2020-03-14 14:00:36 +02:00
llvm-dwarfdump [llvm/DWARFDebugLine] Remove spurious full stop from warning messages 2020-06-11 13:14:21 +02:00
llvm-dwp llvm-dwarfdump: Include unit count in DWP index header dumping 2020-06-12 12:40:02 -07:00
llvm-elfabi [yaml2obj] - Set a default value for `PAddr` property of a program header to a value of `VAddr` 2020-03-14 17:44:57 +03:00
llvm-exegesis [llvm-exegesis] Exploring X86::OperandType::OPERAND_COND_CODE 2020-02-12 21:33:52 +03:00
llvm-extract [llvm-extract] Add -keep-const-init commandline option 2020-02-03 14:30:28 +09:00
llvm-gsymutil Recommit "[DWARFYAML][debug_line] Replace `InitialLength` with `Format` and `Length`." 2020-06-13 23:39:11 +08:00
llvm-ifs [llvm][clang][IFS] Enhancing the llvm-ifs yaml format for symbol lists. 2020-04-01 10:49:06 -04:00
llvm-isel-fuzzer
llvm-lib [ms] Fix repeated executions of the no-inputs llvm-lib test 2020-04-30 18:10:46 -04:00
llvm-lipo [test] Use yaml2obj -o %t instead of > %t 2020-01-21 17:20:18 -08:00
llvm-lit
llvm-locstats Reland D73534: [DebugInfo] Enable the debug entry values feature by default 2020-03-19 13:57:30 +01:00
llvm-lto [ThinLTO] Compute the basic block count across modules. 2020-05-28 10:33:05 -07:00
llvm-lto2 Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""" 2020-02-13 10:16:06 -08:00
llvm-mc
llvm-mca [X86][llvm-mc] Make the suffix matcher more accurate. 2020-05-27 14:45:17 +08:00
llvm-ml Reland "[ms] [llvm-ml] Improve data support, adding names and complex initializers." 2020-02-24 16:40:25 -05:00
llvm-modextract
llvm-mt
llvm-nm [llvm-nm/objdump/size] Add tests for dumping symbol tables with invalid sh_size. 2020-05-06 17:01:20 +08:00
llvm-objcopy Recommit "[DWARFYAML][debug_line] Replace `InitialLength` with `Format` and `Length`." 2020-06-13 23:39:11 +08:00
llvm-objdump [llvm-objdump] Decrease instruction indentation for non-x86 2020-06-11 09:10:50 -07:00
llvm-opt-fuzzer
llvm-opt-report
llvm-pdbutil
llvm-profdata Fix the roundtrip test under llvm-profdata 2020-06-05 08:52:21 -07:00
llvm-ranlib [llvm-ranlib][test] Fix rwx- after a4f3847f3d 2020-02-14 19:41:55 -08:00
llvm-rc [llvm-rc] Allow -1 for menu item IDs 2020-03-28 14:32:08 +02:00
llvm-readobj [ELF][AArch64] Correct relocation codes for R_<CLS>_PLT32 2020-06-10 14:16:41 +01:00
llvm-size [llvm-nm/objdump/size] Add tests for dumping symbol tables with invalid sh_size. 2020-05-06 17:01:20 +08:00
llvm-split
llvm-strings
llvm-symbolizer For --relativenames, ignore directory 0, which is the comp_dir. 2020-06-01 13:13:37 -07:00
llvm-xray [llvm-xray][test] Fix unsupported-elf32.txt after D80185 2020-05-28 19:16:29 -07:00
lto
obj2yaml [NFC] mv llvm/test/tools/obj2yaml/macho-DWARF-debug-ranges.yaml llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml 2020-06-14 16:39:15 +08:00
opt-viewer Fix opt-viewer tests failing after move from cgi.escape to html.escape 2020-04-17 08:37:47 +02:00
sancov [sancov] Accommodate sancov and coverage report server for use under Windows 2020-05-26 14:36:44 -07:00
sanstats [test] Use yaml2obj -o %t instead of > %t 2020-01-21 17:20:18 -08:00
yaml2obj [yaml2obj] - Introduce the "NoHeaders" key for "SectionHeaderTable" 2020-06-15 12:43:16 +03:00