diff options
Diffstat (limited to 'clang/lib/Driver/ToolChains/AVR.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChains/AVR.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Driver/ToolChains/AVR.cpp b/clang/lib/Driver/ToolChains/AVR.cpp index 1e866553d826..89d408823270 100644 --- a/clang/lib/Driver/ToolChains/AVR.cpp +++ b/clang/lib/Driver/ToolChains/AVR.cpp @@ -437,7 +437,6 @@ void AVR::Linker::ConstructJob(Compilation &C, const JobAction &JA, : getToolChain().GetProgramPath(getShortName()); ArgStringList CmdArgs; - AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA); CmdArgs.push_back("-o"); CmdArgs.push_back(Output.getFilename()); @@ -476,8 +475,8 @@ void AVR::Linker::ConstructJob(Compilation &C, const JobAction &JA, } if (SectionAddressData) { - std::string DataSectionArg = std::string("-Tdata=0x") + - llvm::utohexstr(SectionAddressData.getValue()); + std::string DataSectionArg = + std::string("-Tdata=0x") + llvm::utohexstr(SectionAddressData.value()); CmdArgs.push_back(Args.MakeArgString(DataSectionArg)); } else { // We do not have an entry for this CPU in the address mapping table yet. @@ -503,6 +502,7 @@ void AVR::Linker::ConstructJob(Compilation &C, const JobAction &JA, // Add the link library specific to the MCU. CmdArgs.push_back(Args.MakeArgString(std::string("-l") + CPU)); + AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA); CmdArgs.push_back("--end-group"); // Add user specified linker script. @@ -514,6 +514,8 @@ void AVR::Linker::ConstructJob(Compilation &C, const JobAction &JA, // than the bare minimum supports. if (Linker.find("avr-ld") != std::string::npos) CmdArgs.push_back(Args.MakeArgString(std::string("-m") + *FamilyName)); + } else { + AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA); } C.addCommand(std::make_unique<Command>( |