mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-03 12:18:00 +00:00
MC: Sink Section address assignment into LayoutSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99528 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -651,10 +651,11 @@ private:
|
|||||||
bool FragmentNeedsRelaxation(const MCInstFragment *IF,
|
bool FragmentNeedsRelaxation(const MCInstFragment *IF,
|
||||||
const MCAsmLayout &Layout) const;
|
const MCAsmLayout &Layout) const;
|
||||||
|
|
||||||
/// LayoutSection - Assign offsets and sizes to the fragments in the section
|
/// LayoutSection - Assign the section the given \arg StartAddress, and then
|
||||||
/// \arg SD, and update the section size. The section file offset should
|
/// assign offsets and sizes to the fragments in the section \arg SD, and
|
||||||
/// already have been computed.
|
/// update the section size.
|
||||||
void LayoutSection(MCSectionData &SD, MCAsmLayout &Layout);
|
void LayoutSection(MCSectionData &SD, MCAsmLayout &Layout,
|
||||||
|
uint64_t StartAddress);
|
||||||
|
|
||||||
/// LayoutOnce - Perform one layout iteration and return true if any offsets
|
/// LayoutOnce - Perform one layout iteration and return true if any offsets
|
||||||
/// were adjusted.
|
/// were adjusted.
|
||||||
|
@@ -365,9 +365,11 @@ bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MCAssembler::LayoutSection(MCSectionData &SD,
|
void MCAssembler::LayoutSection(MCSectionData &SD,
|
||||||
MCAsmLayout &Layout) {
|
MCAsmLayout &Layout,
|
||||||
uint64_t Address, StartAddress = Address = Layout.getSectionAddress(&SD);
|
uint64_t StartAddress) {
|
||||||
|
Layout.setSectionAddress(&SD, StartAddress);
|
||||||
|
|
||||||
|
uint64_t Address = StartAddress;
|
||||||
for (MCSectionData::iterator it = SD.begin(), ie = SD.end(); it != ie; ++it) {
|
for (MCSectionData::iterator it = SD.begin(), ie = SD.end(); it != ie; ++it) {
|
||||||
MCFragment &F = *it;
|
MCFragment &F = *it;
|
||||||
|
|
||||||
@@ -690,8 +692,7 @@ bool MCAssembler::LayoutOnce(MCAsmLayout &Layout) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Layout the section fragments and its size.
|
// Layout the section fragments and its size.
|
||||||
Layout.setSectionAddress(&SD, Address);
|
LayoutSection(SD, Layout, Address);
|
||||||
LayoutSection(SD, Layout);
|
|
||||||
Address += Layout.getSectionFileSize(&SD);
|
Address += Layout.getSectionFileSize(&SD);
|
||||||
|
|
||||||
Prev = &SD;
|
Prev = &SD;
|
||||||
@@ -709,8 +710,7 @@ bool MCAssembler::LayoutOnce(MCAsmLayout &Layout) {
|
|||||||
if (uint64_t Pad = OffsetToAlignment(Address, it->getAlignment()))
|
if (uint64_t Pad = OffsetToAlignment(Address, it->getAlignment()))
|
||||||
Address += Pad;
|
Address += Pad;
|
||||||
|
|
||||||
Layout.setSectionAddress(&SD, Address);
|
LayoutSection(SD, Layout, Address);
|
||||||
LayoutSection(SD, Layout);
|
|
||||||
Address += Layout.getSectionSize(&SD);
|
Address += Layout.getSectionSize(&SD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user