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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 02:08:29 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/yaml2obj/ELF/program-header-nobits.yaml:2
+## In this test we check that we allocate file space for SHT_NOBITS sections when
+## there are non-nobits sections in the same segment after then. When an object have
+## multiple segments, we check each and allocate the space if at least one matches the
----------------
then -> them
have -> has


================
Comment at: llvm/test/tools/yaml2obj/ELF/program-header-nobits.yaml:23
+
+## Case B. We have a segment that has the non-nobits section after the SHT_NOBITS section ".nobits.1".
+##         The file space is allocated for it, but not for ".nobits.2".
----------------
has the non-nobits -> has a non-nobits


================
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
----------------
.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.


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

https://reviews.llvm.org/D80629





More information about the llvm-commits mailing list