The enclosed patch fixes a subtle problem with gdb_index generation from pubnames. Currently, if the pubnames or pubtypes section of two consecutive input relocatable objects just happen to have the same section index and offset, Gold will silently drop the second set. This results in an incomplete gdb index. The enclosed patch fixes that by extending the "pub[names|types]_read" functions to check if the object has changed as well as the section index and field.d OK for mainline? Sterling 2012-09-07 Sterling Augustine * gdb-index.cc (Gdb_index::pubnames_read): New parameter. (Gdb_index::pubtypes_read): New parameter. (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters to calls. * gdb-index.h (Gdb_index): New fields pubnames_object_ and pubtypes_object_.