X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gold%2Flayout.h;h=8584a0cabf5e19a0ddea476c3d490beeb83cabd0;hb=ca38c58efa3ca0ac1f632640c131db93164ac5f2;hp=efa8b61d5aa3c03d32a9bb6c42db156648cb7429;hpb=d491d34e930046f820def9d3d67a2491df8a2198;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/layout.h b/gold/layout.h index efa8b61d5a..8584a0cabf 100644 --- a/gold/layout.h +++ b/gold/layout.h @@ -23,6 +23,7 @@ #ifndef GOLD_LAYOUT_H #define GOLD_LAYOUT_H +#include #include #include #include @@ -212,12 +213,29 @@ class Layout is_linkonce(const char* name) { return strncmp(name, ".gnu.linkonce", sizeof(".gnu.linkonce") - 1) == 0; } + // Return true if a section is a debugging section. + static inline bool + is_debug_info_section(const char* name) + { + // Debugging sections can only be recognized by name. + return (strncmp(name, ".debug", sizeof(".debug") - 1) == 0 + || strncmp(name, ".gnu.linkonce.wi.", + sizeof(".gnu.linkonce.wi.") - 1) == 0 + || strncmp(name, ".line", sizeof(".line") - 1) == 0 + || strncmp(name, ".stab", sizeof(".stab") - 1) == 0); + } + // Record the signature of a comdat section, and return whether to // include it in the link. The GROUP parameter is true for a // section group signature, false for a signature derived from a // .gnu.linkonce section. bool - add_comdat(const char*, bool group); + add_comdat(Relobj*, unsigned int, const std::string&, bool group); + + // Find the given comdat signature, and return the object and section + // index of the kept group. + Relobj* + find_kept_object(const std::string&, unsigned int*) const; // Finalize the layout after all the input sections have been added. off_t @@ -550,7 +568,19 @@ class Layout segment_precedes(const Output_segment* seg1, const Output_segment* seg2); // A mapping used for group signatures. - typedef Unordered_map Signatures; + struct Kept_section + { + Kept_section() + : object_(NULL), shndx_(0), group_(false) + { } + Kept_section(Relobj* object, unsigned int shndx, bool group) + : object_(object), shndx_(shndx), group_(group) + { } + Relobj* object_; + unsigned int shndx_; + bool group_; + }; + typedef Unordered_map Signatures; // Mapping from input section name/type/flags to output section. We // use canonicalized strings here.