Skip to content

[LLD][ELF] Import ObjFile::importCmseSymbols at call site #68025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lld/ELF/InputFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ using namespace llvm::support::endian;
using namespace lld;
using namespace lld::elf;

// This function is explicity instantiated in ARM.cpp, don't do it here to avoid
// warnings with MSVC.
extern template void ObjFile<ELF32LE>::importCmseSymbols();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be placed directly before doParseArmCMSEImportLib for clarity.

extern template void ObjFile<ELF32BE>::importCmseSymbols();
extern template void ObjFile<ELF64LE>::importCmseSymbols();
extern template void ObjFile<ELF64BE>::importCmseSymbols();

bool InputFile::isInGroup;
uint32_t InputFile::nextGroupId;

Expand Down Expand Up @@ -315,6 +322,13 @@ template <class ELFT> static void doParseFile(InputFile *file) {
// Add symbols in File to the symbol table.
void elf::parseFile(InputFile *file) { invokeELFT(doParseFile, file); }

// This function is explicity instantiated in ARM.cpp. Mark it extern here,
// to avoid warnings when building with MSVC.
extern template void ObjFile<ELF32LE>::importCmseSymbols();
extern template void ObjFile<ELF32BE>::importCmseSymbols();
extern template void ObjFile<ELF64LE>::importCmseSymbols();
extern template void ObjFile<ELF64BE>::importCmseSymbols();

template <class ELFT> static void doParseArmCMSEImportLib(InputFile *file) {
cast<ObjFile<ELFT>>(file)->importCmseSymbols();
}
Expand Down
1 change: 0 additions & 1 deletion lld/ELF/InputFiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ template <class ELFT> class ObjFile : public ELFFileBase {
void initSectionsAndLocalSyms(bool ignoreComdats);
void postParse();
void importCmseSymbols();
void redirectCmseSymbols();

private:
void initializeSections(bool ignoreComdats,
Expand Down