summaryrefslogtreecommitdiffstats
path: root/lld/ELF/InputSection.h
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-10-08 01:55:29 +0000
committerRui Ueyama <ruiu@google.com>2017-10-08 01:55:29 +0000
commite8936bca7229f9f50db2bc18796ed28271d212bb (patch)
tree21f8c89f75912fe9d328169d5a41f924ab7af9a7 /lld/ELF/InputSection.h
parent9563cab961cbc0eb2d597a1a64056b4426318fe0 (diff)
downloadbcm5719-llvm-e8936bca7229f9f50db2bc18796ed28271d212bb.tar.gz
bcm5719-llvm-e8936bca7229f9f50db2bc18796ed28271d212bb.zip
Add comment.
llvm-svn: 315163
Diffstat (limited to 'lld/ELF/InputSection.h')
-rw-r--r--lld/ELF/InputSection.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 9268226866b..a9972c332c6 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -54,12 +54,23 @@ public:
// The garbage collector sets sections' Live bits.
// If GC is disabled, all sections are considered live by default.
- unsigned Live : 1; // for garbage collection
- unsigned Assigned : 1; // for linker script
-
- uint32_t Alignment;
+ unsigned Live : 1;
+
+ // True if this section has already been placed to a linker script
+ // output section. This is needed because, in a linker script, you
+ // can refer to the same section more than once. For example, in
+ // the following linker script,
+ //
+ // .foo : { *(.text) }
+ // .bar : { *(.text) }
+ //
+ // .foo takes all .text sections, and .bar becomes empty. To achieve
+ // this, we need to memorize whether a section has been placed or
+ // not for each input section.
+ unsigned Assigned : 1;
// These corresponds to the fields in Elf_Shdr.
+ uint32_t Alignment;
uint64_t Flags;
uint64_t Entsize;
uint32_t Type;
OpenPOWER on IntegriCloud