File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -3566,6 +3566,16 @@ std::unique_ptr<GdbIndexSection> GdbIndexSection::create(Ctx &ctx) {
35663566 DWARFContext dwarf (std::make_unique<LLDDwarfObj<ELFT>>(file));
35673567 auto &dobj = static_cast <const LLDDwarfObj<ELFT> &>(dwarf.getDWARFObj ());
35683568
3569+ if (dobj.getGnuPubnamesSection ().sec == nullptr &&
3570+ dobj.getGnuPubtypesSection ().sec == nullptr ) {
3571+ Warn (ctx)
3572+ << files[i]
3573+ << " : file contains debug info but is missing .debug_gnu_pubnames or "
3574+ " .debug_gnu_pubtypes sections required by --gdb-index. Compile "
3575+ " the file using -gsplit-dwarf or -ggnu-pubnames to generate these "
3576+ " sections." ;
3577+ }
3578+
35693579 // If the are multiple compile units .debug_info (very rare ld -r --unique),
35703580 // this only picks the last one. Other address ranges are lost.
35713581 chunks[i].sec = dobj.getInfoSection ();
You can’t perform that action at this time.
0 commit comments