forked from OSchip/llvm-project
ELF2: Initialize SyntheticOptional only once.
llvm-svn: 249636
This commit is contained in:
parent
e66e001c90
commit
9ea49c7948
|
@ -147,6 +147,8 @@ getString(opt::InputArgList &Args, unsigned Key, StringRef Default = "") {
|
|||
}
|
||||
|
||||
void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
|
||||
initSymbols();
|
||||
|
||||
// Parse command line options.
|
||||
opt::InputArgList Args = Parser.parse(ArgsArr);
|
||||
|
||||
|
|
|
@ -90,7 +90,6 @@ void SymbolTable::addUndefinedSym(StringRef Name) {
|
|||
}
|
||||
|
||||
template <class ELFT> void SymbolTable::addUndefinedSym(StringRef Name) {
|
||||
Undefined<ELFT>::SyntheticOptional.setVisibility(STV_HIDDEN);
|
||||
resolve<ELFT>(new (Alloc)
|
||||
Undefined<ELFT>(Name, Undefined<ELFT>::SyntheticOptional));
|
||||
}
|
||||
|
|
|
@ -86,6 +86,13 @@ std::unique_ptr<InputFile> Lazy::getMember() {
|
|||
return createELFFile<ObjectFile>(MBRef);
|
||||
}
|
||||
|
||||
void lld::elf2::initSymbols() {
|
||||
Undefined<ELF32LE>::SyntheticOptional.setVisibility(STV_HIDDEN);
|
||||
Undefined<ELF32BE>::SyntheticOptional.setVisibility(STV_HIDDEN);
|
||||
Undefined<ELF64LE>::SyntheticOptional.setVisibility(STV_HIDDEN);
|
||||
Undefined<ELF64BE>::SyntheticOptional.setVisibility(STV_HIDDEN);
|
||||
}
|
||||
|
||||
template int SymbolBody::compare<ELF32LE>(SymbolBody *Other);
|
||||
template int SymbolBody::compare<ELF32BE>(SymbolBody *Other);
|
||||
template int SymbolBody::compare<ELF64LE>(SymbolBody *Other);
|
||||
|
|
|
@ -25,6 +25,10 @@ class SymbolBody;
|
|||
template <class ELFT> class ObjectFile;
|
||||
template <class ELFT> class OutputSection;
|
||||
|
||||
// Initializes global objects defined in this file.
|
||||
// Called at the beginning of main().
|
||||
void initSymbols();
|
||||
|
||||
// A real symbol object, SymbolBody, is usually accessed indirectly
|
||||
// through a Symbol. There's always one Symbol for each symbol name.
|
||||
// The resolver updates SymbolBody pointers as it resolves symbols.
|
||||
|
|
Loading…
Reference in New Issue