Commit Graph

3 Commits

Author SHA1 Message Date
Georgii Rymar 818ab3d654 [yaml2obj] - Allocate the file space for SHT_NOBITS sections in some cases.
This teaches yaml2obj to allocate file space for a no-bits section
when there is a non-nobits section in the same segment that follows it.

It was discussed in D78005 thread and matches GNU linkers and LLD behavior.

Differential revision: https://reviews.llvm.org/D80629
2020-06-11 12:54:53 +03:00
Georgii Rymar e2b134b01a [yaml2obj] - Stop using square brackets for unique suffixes.
For describing section/symbol names we can use unique suffixes,
e.g:

```
- Name: '.foo [1]`
- Name: '.foo [2]`
```

It can be a problem (see https://reviews.llvm.org/D79984#inline-734829),
because `[]` are sometimes used to describe a macros:

```
- Name: "[[a0]]"
```

Seems the better approach is to use something else, like "()".
This patch does it and refactors the code related.

Differential revision: https://reviews.llvm.org/D80123
2020-05-19 12:59:13 +03:00
Fangrui Song bd3058e82d [obj2yaml][test] Move tests to binary format specific subdirectories
Similar to D70264.
Create COFF/, ELF/, MachO/, Minidump/, XCOFF/, and move tests there.

Reviewed By: grimar, jhenderson, labath

Differential Revision: https://reviews.llvm.org/D79154
2020-04-30 08:42:11 -07:00