1 // strtab.h -- manage an ELF string table for gold -*- C++ -*-
12 // This class holds an ELF string table. We keep a reference count
13 // for each string, which we use to determine which strings are
14 // actually required at the end. When all operations are done, the
15 // string table is finalized, which sets the offsets to use for each
25 Strtab_ref* add(const char*);
27 Strtab_ref* add(const std::string& s)
28 { return this->add(s.c_str()); }
31 Strtab(const Strtab&);
32 Strtab& operator=(const Strtab&);
37 operator()(const char*p);
43 operator()(const char* p1, const char* p2)
44 { return strcmp(p1, p2) == 0; }
47 Unordered_map<const char*, Strtab_ref*, strtab_hash, strtab_eq,
48 std::allocator<std::pair<const char* const, Strtab_ref*> >,
52 // Users of Strtab work with pointers to Strtab_ref structures. These
53 // are allocated via new and should be deleted if the string is no
65 Strtab_ref(const Strtab_ref&);
66 Strtab_ref& operator=(const Strtab_ref&);
71 } // End namespace gold.
73 #endif // !defined(GOLD_STRTAB_H)