Lines Matching +full:non +full:- +full:empty

1 //===- SyntheticSections.h -------------------------------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
48 return sec->kind() == SyntheticKind; in classof()
62 align = target->wordSize; in LinkEditSection()
65 // Implementations of this method can assume that the regular (non-__LINKEDIT)
77 // __LINKEDIT ends where the next one starts -- no gaps are permitted. We
81 // zero-valued bytes.
85 // The header of the Mach-O file, which must have a file offset of zero.
106 bool isNeeded() const override { return target->pageZeroSize != 0; } in isNeeded()
107 uint64_t getSize() const override { return target->pageZeroSize; } in getSize()
113 // functionally identical -- they will both be populated by dyld with addresses
114 // to non-lazily-loaded dylib symbols. The main difference is that the
115 // TLVPointerSection stores references to thread-local variables.
120 bool isNeeded() const override { return !entries.empty(); } in isNeeded()
122 return entries.size() * target->wordSize; in getSize()
127 return addr + gotIndex * target->wordSize; in getVA()
150 uint64_t getVA() const { return isec->getVA(offset); } in getVA()
161 bool isNeeded() const override { return !locations.empty(); } in isNeeded()
165 if (config->isPic) in addEntry()
184 // Stores bind opcodes for telling dyld which symbols to load non-lazily.
190 bool isNeeded() const override { return !bindingsMap.empty(); } in isNeeded()
206 // 1) Non-weak definitions: This is a symbol definition that weak symbols in
210 // coalesce to a non-weak definition if one is found. Note that unlike the
219 return !bindingsMap.empty() || !definitions.empty(); in isNeeded()
229 bool hasEntry() const { return !bindingsMap.empty(); } in hasEntry()
235 bool hasNonWeakDefinition() const { return !definitions.empty(); } in hasNonWeakDefinition()
243 // The following sections implement lazy symbol binding -- very similar to the
246 // ELF's .plt section is broken up into two sections in Mach-O: StubsSection
251 // We will first describe how non-weak symbols are handled.
258 // dyld_stub_binder is a non-lazily-bound symbol, so this call looks it up in
268 // "weak lazy" lookup, function calls to weak symbols are always non-lazily
269 // bound. We emit both regular non-lazy bindings as well as weak bindings, in
270 // order that the weak bindings may overwrite the non-lazy bindings if an
272 // still be written (non-lazily) into the LazyPointerSection.
284 bool isNeeded() const override { return !entries.empty(); } in isNeeded()
292 assert(isFinal || target->usesThunks()); in getVA()
295 // finalized, return a contrived out-of-range address. in getVA()
296 return isFinal ? addr + stubsIndex * target->stubSize in getVA()
332 // Objective-C stubs are hoisted objc_msgSend calls per selector called in the
343 bool isNeeded() const override { return !symbols.empty(); } in isNeeded()
344 void finalize() override { isec->isFinal = true; } in finalize()
357 // Note that this section may also be targeted by non-lazy bindings. In
366 return addr + (index << target->p2WordSize); in getVA()
375 bool isNeeded() const override { return !entries.empty(); } in isNeeded()
407 // inside code sections. This is used by llvm-objdump to distinguish jump tables
448 // Consequently, the empty string will be at index 1, not zero.
504 // The indirect symbol table is a list of 32-bit integers that serve as indices
506 // concatenation of several sub-arrays of indices, each sub-array belonging to
507 // a separate section. The starting offset of each sub-array is stored in the
510 // These sub-arrays provide symbol information for sections that store
529 // NOTE: These values are duplicated in llvm-objcopy's MachO/Object.h file
557 bool isNeeded() const override { return !inputs.empty(); } in isNeeded()
588 * This section contains deduplicated literal values. The 16-byte values are
589 * laid out first, followed by the 8- and then the 4-byte ones.
595 // sure it's exact -- that way we can construct it via `mmap`.
609 return !literal16Map.empty() || !literal4Map.empty() || in isNeeded()
610 !literal8Map.empty(); in isNeeded()
634 // support all possible integer values -- there are no suitable tombstone
644 bool isNeeded() const override { return !files.empty(); } in isNeeded()
647 assert(!file->objCImageInfo.empty()); in addFile()
662 // This section stores 32-bit __TEXT segment offsets of initializer functions.
667 // read-only __TEXT segment instead. This section is used by default when
676 bool isNeeded() const override { return !sections.empty(); } in isNeeded()
689 // relative method lists if the -objc_relative_method_lists option is enabled.
700 bool isNeeded() const override { return !inputs.empty(); } in isNeeded()
719 // Relative method lists are supported only for 3-pointer method lists
745 // This setup allows pages to be relocated lazily at page-in time and without
747 // technique, called page-in linking, was introduced in macOS 13.
750 // - smaller __LINKEDIT segment, as most of the fixup information is stored in
752 // - faster startup, since not all relocations need to be done upfront
753 // - slightly lower memory usage, as fewer pages are dirtied
756 // - Rebase entries contain an absolute address, to which the object's load
759 // - Binding entries are mostly used for symbols imported from other dylibs,
767 // The entries are tightly packed 64-bit bitfields. One of the bits specifies