Home | History | Annotate | Download | only in LD

Lines Matching full:archive

44   if (pInput.memArea()->size() < Archive::MAGIC_LEN)
48 pInput.memArea()->request(pInput.fileOffset(), Archive::MAGIC_LEN);
62 return (memcmp(pStr, Archive::MAGIC, Archive::MAGIC_LEN) == 0);
67 return (memcmp(pStr, Archive::THIN_MAGIC, Archive::MAGIC_LEN) == 0);
74 pInput.memArea()->request(pInput.fileOffset(), Archive::MAGIC_LEN);
86 Archive& pArchive) {
87 // bypass the empty archive
88 if (Archive::MAGIC_LEN == pArchive.getARFile().memArea()->size())
94 // if this is the first time read this archive, setup symtab and strtab
96 // read the symtab of the archive
99 // read the strtab of the archive
102 // add root archive to ArchiveMemberMap
108 // include the needed members in the archive and build up the input tree
114 if (Archive::Symbol::Unknown != pArchive.getSymbolStatus(idx))
119 pArchive.setSymbolStatus(idx, Archive::Symbol::Include);
124 Archive::Symbol::Status status =
126 if (Archive::Symbol::Unknown != status)
129 if (Archive::Symbol::Include == status) {
140 /// readMemberHeader - read the header of a member in a archive file and then
141 /// return the corresponding archive member (it may be an input object or
142 /// another archive)
143 /// @param pArchiveRoot - the archive root that holds the strtab (extended
145 /// @param pArchiveFile - the archive that contains the needed object
146 /// @param pFileOffset - file offset of the member header in the archive
147 /// @param pNestedOffset - used when we find a nested archive
149 Input* GNUArchiveReader::readMemberHeader(Archive& pArchiveRoot,
157 (pArchiveFile.fileOffset() + pFileOffset), sizeof(Archive::MemberHeader));
158 const Archive::MemberHeader* header =
159 reinterpret_cast<const Archive::MemberHeader*>(header_region.begin());
161 assert(memcmp(header->fmag, Archive::MEMBER_MAGIC, sizeof(header->fmag)) ==
170 // this is an object file in an archive
174 // this is an object/archive file in a thin archive
199 // this is an object file in an archive
205 (pFileOffset + sizeof(Archive::MemberHeader)));
207 // this is a member in a thin archive
208 // try to find if this is a archive already in the map first
209 Archive::ArchiveMember* ar_member =
216 // path to the archive containing it.
231 static void readSymbolTableEntries(Archive& pArchive,
248 // add the archive symbols
259 /// readSymbolTable - read the archive symbol map (armap)
260 bool GNUArchiveReader::readSymbolTable(Archive& pArchive) {
265 (pArchive.getARFile().fileOffset() + Archive::MAGIC_LEN),
266 sizeof(Archive::MemberHeader));
267 const Archive::MemberHeader* header =
268 reinterpret_cast<const Archive::MemberHeader*>(header_region.begin());
269 assert(memcmp(header->fmag, Archive::MEMBER_MAGIC, sizeof(header->fmag)) ==
277 (pArchive.getARFile().fileOffset() + Archive::MAGIC_LEN +
278 sizeof(Archive::MemberHeader)),
282 Archive::SVR4_SYMTAB_NAME,
283 strlen(Archive::SVR4_SYMTAB_NAME)) == 0)
286 Archive::IRIX6_SYMTAB_NAME,
287 strlen(Archive::IRIX6_SYMTAB_NAME)) == 0)
295 /// readStringTable - read the strtab for long file name of the archive
296 bool GNUArchiveReader::readStringTable(Archive& pArchive) {
297 size_t offset = Archive::MAGIC_LEN + sizeof(Archive::MemberHeader) +
308 sizeof(Archive::MemberHeader));
309 const Archive::MemberHeader* header =
310 reinterpret_cast<const Archive::MemberHeader*>(header_region.begin());
312 assert(memcmp(header->fmag, Archive::MEMBER_MAGIC, sizeof(header->fmag)) ==
315 if (memcmp(header->name, Archive::STRTAB_NAME, sizeof(header->name)) == 0) {
320 sizeof(Archive::MemberHeader)),
329 /// the corresponding archive member, and then return the decision
330 enum Archive::Symbol::Status GNUArchiveReader::shouldIncludeSymbol(
336 return Archive::Symbol::Exclude;
338 return Archive::Symbol::Unknown;
339 return Archive::Symbol::Include;
341 return Archive::Symbol::Unknown;
347 /// @param pArchiveRoot - the archive root
348 /// @param pFileOffset - file offset of the member header in the archive
350 Archive& pArchive,
358 // use the file offset in current archive to find out the member we
363 // bypass if we get an archive that is already in the map
364 if (Input::Archive == member->type()) {
370 // insert a node into the subtree of current archive.
371 Archive::ArchiveMember* parent =
385 // Set this object as no export if the archive is in the exclude libs.
395 member->setType(Input::Archive);
396 // when adding a new archive node, set the iterator to archive
411 /// --whole-archive is the attribute for this archive file.
413 Archive& pArchive) {
414 // read the symtab of the archive
417 // read the strtab of the archive
420 // add root archive to ArchiveMemberMap
427 Archive::MAGIC_LEN + sizeof(Archive::MemberHeader) +
433 sizeof(Archive::MemberHeader) + pArchive.getStrTable().size();
437 offset += sizeof(Archive::MemberHeader)) {