mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 03:56:16 +08:00
Revert [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded
This reverts r361792 (git commit cfca5095df), the
revision causes link errors internally, will share more details with the
author.
llvm-svn: 361806
This commit is contained in:
@@ -681,17 +681,9 @@ static std::string maybeReportDiscarded(Undefined &Sym, InputSectionBase &Sec,
|
||||
return "";
|
||||
ArrayRef<Elf_Shdr_Impl<ELFT>> ObjSections =
|
||||
CHECK(File->getObj().sections(), File);
|
||||
|
||||
std::string Msg;
|
||||
if (Sym.Type == ELF::STT_SECTION) {
|
||||
Msg = "relocation refers to a discarded section: ";
|
||||
Msg += CHECK(
|
||||
File->getObj().getSectionName(&ObjSections[Sym.DiscardedSecIdx]), File);
|
||||
} else {
|
||||
Msg = "relocation refers to a symbol in a discarded section: " +
|
||||
toString(Sym);
|
||||
}
|
||||
Msg += "\n>>> defined in " + toString(File);
|
||||
std::string Msg =
|
||||
"relocation refers to a symbol in a discarded section: " + toString(Sym) +
|
||||
"\n>>> defined in " + toString(File);
|
||||
|
||||
Elf_Shdr_Impl<ELFT> ELFSec = ObjSections[Sym.DiscardedSecIdx - 1];
|
||||
if (ELFSec.sh_type != SHT_GROUP)
|
||||
|
||||
Reference in New Issue
Block a user