Lines Matching full:archive
1 //===- Archive.cpp --------------------------------------------------------===//
9 #include "mcld/LD/Archive.h"
19 // Archive
20 const char Archive::MAGIC[] = "!<arch>\n";
21 const char Archive::THIN_MAGIC[] = "!<thin>\n";
22 const size_t Archive::MAGIC_LEN = sizeof(Archive::MAGIC) - 1;
23 const char Archive::SVR4_SYMTAB_NAME[] = "/ ";
24 const char Archive::IRIX6_SYMTAB_NAME[] = "/SYM64/ ";
25 const char Archive::STRTAB_NAME[] = "// ";
26 const char Archive::PAD[] = "\n";
27 const char Archive::MEMBER_MAGIC[] = "`\n";
29 Archive::Archive(Input& pInputFile, InputBuilder& pBuilder)
34 // FIXME: move creation of input tree out of Archive.
38 Archive::~Archive() {
42 /// getARFile - get the Input& of the archive file
43 Input& Archive::getARFile() {
47 /// getARFile - get the Input& of the archive file
48 const Input& Archive::getARFile() const {
52 /// inputs - get the input tree built from this archive
53 InputTree& Archive::inputs() {
57 /// inputs - get the input tree built from this archive
58 const InputTree& Archive::inputs() const {
63 Archive::ObjectMemberMapType& Archive::getObjectMemberMap() {
68 const Archive::ObjectMemberMapType& Archive::getObjectMemberMap() const {
73 size_t Archive::numOfObjectMember() const {
79 /// @param pIter - the iterator in the input tree built from this archive
80 bool Archive::addObjectMember(uint32_t pFileOffset, InputTree::iterator pIter) {
90 bool Archive::hasObjectMember(uint32_t pFileOffset) const {
94 /// getArchiveMemberMap - get the map that contains the included archive files
95 Archive::ArchiveMemberMapType& Archive::getArchiveMemberMap() {
99 /// getArchiveMemberMap - get the map that contains the included archive files
100 const Archive::ArchiveMemberMapType& Archive::getArchiveMemberMap() const {
104 /// addArchiveMember - add an archive in the archive member map
105 /// @param pName - the name of the new archive member
107 /// subtree of this archive member
109 /// subtree of this archive member
110 bool Archive::addArchiveMember(const llvm::StringRef& pName,
127 /// hasArchiveMember - check if an archive file is included or not
128 bool Archive::hasArchiveMember(const llvm::StringRef& pName) const {
132 /// getArchiveMember - get a archive member
133 Archive::ArchiveMember* Archive::getArchiveMember(
142 Archive::SymTabType& Archive::getSymbolTable() {
147 const Archive::SymTabType& Archive::getSymbolTable() const {
152 void Archive::setSymTabSize(size_t pSize) {
157 size_t Archive::getSymTabSize() const {
162 size_t Archive::numOfSymbols() const {
169 void Archive::addSymbol(const char* pName,
171 enum Archive::Symbol::Status pStatus) {
178 const std::string& Archive::getSymbolName(size_t pSymIdx) const {
184 uint32_t Archive::getObjFileOffset(size_t pSymIdx) const {
190 enum Archive::Symbol::Status Archive::getSymbolStatus(size_t pSymIdx) const {
196 void Archive::setSymbolStatus(size_t pSymIdx,
197 enum Archive::Symbol::Status pStatus) {
203 std::string& Archive::getStrTable() {
208 const std::string& Archive::getStrTable() const {
213 bool Archive::hasStrTable() const {
217 /// getMemberFile - get the member file in an archive member
218 /// @param pArchiveFile - Input reference of the archive member
219 /// @param pIsThinAR - denote the archive menber is a Thin Archive or not
224 Input* Archive::getMemberFile(Input& pArchiveFile,