================ @@ -651,8 +651,19 @@ void AVR::Linker::ConstructJob(Compilation &C, const JobAction &JA, // This is almost always required because otherwise avr-ld // will assume 'avr2' and warn about the program being larger // than the bare minimum supports. - if (Linker.find("avr-ld") != std::string::npos && FamilyName) - CmdArgs.push_back(Args.MakeArgString(std::string("-m") + *FamilyName)); + if (Linker.find("avr-ld") != std::string::npos && FamilyName) { + // Option to use mapped memory for modern devices with >32kB flash. + // This is the only option for modern devices with <= 32kB flash, + // but the larger default to a copy from flash to RAM (avr-ld version < 14) + // or map the highest 32kB to RAM (avr-ld version >= 14). + if (Args.hasFlag(options::OPT_mflmap, options::OPT_mrodata_in_ram, false)) { + CmdArgs.push_back( + Args.MakeArgString(std::string("-m") + *FamilyName + "_flmap")); ---------------- benshi001 wrote:
I agree, so I think I need more time to understand the whole picture what gcc did. https://github.com/llvm/llvm-project/pull/146244 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits