+template <typename A>
+bool HeaderAndLoadCommandsAtom<A>::bitcodeBundleCommand(uint64_t &cmdOffset, uint64_t &cmdEnd,
+ uint64_t §Offset, uint64_t §End) const
+{
+ if ( _options.outputKind() == Options::kObjectFile ) {
+ return false;
+ }
+ cmdOffset = sizeof(macho_header<P>);
+ const char* lastSegName = "";
+ for (std::vector<ld::Internal::FinalSection*>::iterator it = _state.sections.begin(); it != _state.sections.end(); ++it) {
+ if ( strcmp(lastSegName, (*it)->segmentName()) != 0 ) {
+ lastSegName = (*it)->segmentName();
+ cmdOffset += sizeof(macho_segment_command<P>);
+ }
+ if ( strcmp((*it)->segmentName(), "__LLVM") == 0 && strcmp((*it)->sectionName(), "__bundle") == 0 ) {
+ sectOffset = (*it)->fileOffset;
+ sectEnd = (*(it + 1))->fileOffset;
+ cmdEnd = cmdOffset + sizeof(macho_section<P>);
+ return true;
+ }
+ if ( ! (*it)->isSectionHidden() )
+ cmdOffset += sizeof(macho_section<P>);
+ }
+ return false;
+}
+
+template <typename A>
+void HeaderAndLoadCommandsAtom<A>::linkeditCmdInfo(uint64_t &offset, uint64_t &size) const
+{
+ offset = _linkeditCmdOffset;
+ size = sizeof(macho_segment_command<P>);
+}
+
+template <typename A>
+void HeaderAndLoadCommandsAtom<A>::symbolTableCmdInfo(uint64_t &offset, uint64_t &size) const
+{
+ offset = _symboltableCmdOffset;
+ size = sizeof(macho_symtab_command<P>);
+}
+