Home | History | Annotate | Download | only in LD

Lines Matching refs:Archive

48   if (pInput.memArea()->size() < Archive::MAGIC_LEN)
52 pInput.memArea()->request(pInput.fileOffset(), Archive::MAGIC_LEN);
67 return (0 == memcmp(pStr, Archive::MAGIC, Archive::MAGIC_LEN));
73 return (0 == memcmp(pStr, Archive::THIN_MAGIC, Archive::MAGIC_LEN));
81 pInput.memArea()->request(pInput.fileOffset(), Archive::MAGIC_LEN);
93 Archive& pArchive)
95 // bypass the empty archive
96 if (Archive::MAGIC_LEN == pArchive.getARFile().memArea()->size())
102 // if this is the first time read this archive, setup symtab and strtab
104 // read the symtab of the archive
107 // read the strtab of the archive
110 // add root archive to ArchiveMemberMap
116 // include the needed members in the archive and build up the input tree
122 if (Archive::Symbol::Unknown != pArchive.getSymbolStatus(idx))
127 pArchive.setSymbolStatus(idx, Archive::Symbol::Include);
132 Archive::Symbol::Status status =
134 if (Archive::Symbol::Unknown != status)
137 if (Archive::Symbol::Include == status) {
148 /// readMemberHeader - read the header of a member in a archive file and then
149 /// return the corresponding archive member (it may be an input object or
150 /// another archive)
151 /// @param pArchiveRoot - the archive root that holds the strtab (extended
153 /// @param pArchiveFile - the archive that contains the needed object
154 /// @param pFileOffset - file offset of the member header in the archive
155 /// @param pNestedOffset - used when we find a nested archive
157 Input* GNUArchiveReader::readMemberHeader(Archive& pArchiveRoot,
167 sizeof(Archive::MemberHeader));
168 const Archive::MemberHeader* header =
169 reinterpret_cast<const Archive::MemberHeader*>(header_region.begin());
171 assert(0 == memcmp(header->fmag, Archive::MEMBER_MAGIC, sizeof(header->fmag)));
179 // this is an object file in an archive
184 // this is an object/archive file in a thin archive
208 // this is an object file in an archive
214 sizeof(Archive::MemberHeader)));
217 // this is a member in a thin archive
218 // try to find if this is a archive already in the map first
219 Archive::ArchiveMember* ar_member =
226 // path to the archive containing it.
243 static void readSymbolTableEntries(Archive& pArchive, llvm::StringRef pMemRegion)
260 // add the archive symbols
271 /// readSymbolTable - read the archive symbol map (armap)
272 bool GNUArchiveReader::readSymbolTable(Archive& pArchive)
278 Archive::MAGIC_LEN),
279 sizeof(Archive::MemberHeader));
280 const Archive::MemberHeader* header =
281 reinterpret_cast<const Archive::MemberHeader*>(header_region.begin());
282 assert(0 == memcmp(header->fmag, Archive::MEMBER_MAGIC, sizeof(header->fmag)));
290 Archive::MAGIC_LEN +
291 sizeof(Archive::MemberHeader)),
294 if (0 == strncmp(header->name, Archive::SVR4_SYMTAB_NAME,
295 strlen(Archive::SVR4_SYMTAB_NAME)))
297 else if (0 == strncmp(header->name, Archive::IRIX6_SYMTAB_NAME,
298 strlen(Archive::IRIX6_SYMTAB_NAME)))
307 /// readStringTable - read the strtab for long file name of the archive
308 bool GNUArchiveReader::readStringTable(Archive& pArchive)
310 size_t offset = Archive::MAGIC_LEN +
311 sizeof(Archive::MemberHeader) +
322 sizeof(Archive::MemberHeader));
323 const Archive::MemberHeader* header =
324 reinterpret_cast<const Archive::MemberHeader*>(header_region.begin());
326 assert(0 == memcmp(header->fmag, Archive::MEMBER_MAGIC, sizeof(header->fmag)));
328 if (0 == memcmp(header->name, Archive::STRTAB_NAME, sizeof(header->name))) {
334 offset + sizeof(Archive::MemberHeader)),
343 /// the corresponding archive member, and then return the decision
344 enum Archive::Symbol::Status
351 return Archive::Symbol::Exclude;
353 return Archive::Symbol::Unknown;
354 return Archive::Symbol::Include;
356 return Archive::Symbol::Unknown;
362 /// @param pArchiveRoot - the archive root
363 /// @param pFileOffset - file offset of the member header in the archive
365 Archive& pArchive,
374 // use the file offset in current archive to find out the member we
382 // bypass if we get an archive that is already in the map
383 if (Input::Archive == member->type()) {
389 // insert a node into the subtree of current archive.
390 Archive::ArchiveMember* parent =
404 // Set this object as no export if the archive is in the exclude libs.
415 member->setType(Input::Archive);
416 // when adding a new archive node, set the iterator to archive
433 /// --whole-archive is the attribute for this archive file.
435 Archive& pArchive)
437 // read the symtab of the archive
440 // read the strtab of the archive
443 // add root archive to ArchiveMemberMap
450 Archive::MAGIC_LEN +
451 sizeof(Archive::MemberHeader) +
456 begin_offset += sizeof(Archive::MemberHeader) +
462 offset += sizeof(Archive::MemberHeader)) {