[PATCH] D80629: [yaml2obj] - Allocate the file space for SHT_NOBITS sections in some cases.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 06:29:14 PDT 2020


grimar marked an inline comment as done.
grimar added inline comments.


================
Comment at: llvm/test/tools/yaml2obj/ELF/program-header-nobits.yaml:25
+##         The file space is allocated for it, but not for ".nobits.2".
+# RUN: yaml2obj %s -D SEC1=.nobits.1 -D SEC2=.data.after -o %t2
+# RUN: llvm-readelf --sections -l %t2 | FileCheck %s --check-prefix=ALLOC-FIRST
----------------
jhenderson wrote:
> .nobits.2 isn't in any segment, so I think this test case isn't quite right. .nobits.2 needs to be in the same segment as .nobits.1, with a non-nobits segment in between.
> 
> Also, I think you need a test-case for two trailing .nobits sections to show neither has file space allocated.
> .nobits.2 isn't in any segment, so I think this test case isn't quite right. .nobits.2 needs to be in the same segment as .nobits.1, with a non-nobits segment in between.

Well. I think it is reasonable to have both then. I'll add "Case D" with the scenario you described.

> Also, I think you need a test-case for two trailing .nobits sections to show neither has file space allocated.
We need to land D78005 first (which is on hold, waits for this one) to do something like this.
We have the issue with the calculation of segment size in this case.


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

https://reviews.llvm.org/D80629





More information about the llvm-commits mailing list