-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[AVR] Handle flash RO data mapped to data space for newer devices #146244
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -263,11 +263,17 @@ bool AVRAsmPrinter::doFinalization(Module &M) { | |
auto *Section = cast<MCSectionELF>(TLOF.SectionForGlobal(&GO, TM)); | ||
if (Section->getName().starts_with(".data")) | ||
NeedsCopyData = true; | ||
else if (Section->getName().starts_with(".rodata") && SubTM->hasLPM()) | ||
else if (Section->getName().starts_with(".rodata") && SubTM->hasLPM()) { | ||
// AVRs that have a separate program memory (that's most AVRs) store | ||
// .rodata sections in RAM. | ||
NeedsCopyData = true; | ||
else if (Section->getName().starts_with(".bss")) | ||
// .rodata sections in RAM, | ||
// but XMEGA3 family maps all flash in the data space. | ||
// Forcing pulling in __do_copy_data with 0 bytes to copy is a (minor) | ||
// waste, so we let the loader handle this for newer devices. | ||
if (!(SubTM->hasFeatureSetFamilyXMEGA2() || | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we check for Feels like that's what it is supposed to do, but we use family as a proxy for the actual flag we're interested in. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See previous comment, the new clang driver switch is just a feature, to select an option for All other changes (mainly adding some metadata for newer xmega devices) just gets the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless trivial (e.g. typo fix), "marked this conversation as resolved." should only be used by reviewers per suggestions on https://discourse.llvm.org/t/rfc-github-pr-resolve-conversation-button/73178 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Sorry, didn't see that tomtor is the author :) ) |
||
SubTM->hasFeatureSetFamilyXMEGA3() || | ||
SubTM->hasFeatureSetFamilyXMEGA4())) | ||
NeedsCopyData = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we check the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, for these newer devices |
||
} else if (Section->getName().starts_with(".bss")) | ||
NeedsClearBSS = true; | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.