mirror of
https://github.com/ksherlock/x65.git
synced 2025-02-02 12:32:09 +00:00
Linker fix
- Fix for appended section to last instead of target section
This commit is contained in:
parent
4938652d96
commit
81e71acea5
@ -825,6 +825,7 @@ Fish food! Assembler has all important features and switching to make a 6502 pro
|
|||||||
* irp (indefinite repeat)
|
* irp (indefinite repeat)
|
||||||
|
|
||||||
**FIXED**
|
**FIXED**
|
||||||
|
* Link append sections target confusion cleared up (caused crash/link errors/freeze)
|
||||||
* XREF prevented linking with same name symbol included from .x65 object causing a linker failure
|
* XREF prevented linking with same name symbol included from .x65 object causing a linker failure
|
||||||
* << was mistakenly interpreted as shift right
|
* << was mistakenly interpreted as shift right
|
||||||
* REPT is also a value that can be used in expressions as a repeat counter
|
* REPT is also a value that can be used in expressions as a repeat counter
|
||||||
|
13
x65.cpp
13
x65.cpp
@ -1164,7 +1164,7 @@ typedef struct Section {
|
|||||||
name.clear(); export_append.clear();
|
name.clear(); export_append.clear();
|
||||||
start_address = address = load_address = 0x0;
|
start_address = address = load_address = 0x0;
|
||||||
address_assigned = false; output = nullptr; curr = nullptr;
|
address_assigned = false; output = nullptr; curr = nullptr;
|
||||||
dummySection = false; output_capacity = 0; merged_offset = -1;
|
dummySection = false; output_capacity = 0; merged_offset = -1; merged_section = -1;
|
||||||
align_address = 1; if (pRelocs) delete pRelocs;
|
align_address = 1; if (pRelocs) delete pRelocs;
|
||||||
pRelocs = nullptr;
|
pRelocs = nullptr;
|
||||||
if (pListing) delete pListing;
|
if (pListing) delete pListing;
|
||||||
@ -2014,7 +2014,7 @@ StatusCode Asm::AppendSection(Section &s, Section &curr)
|
|||||||
s.start_address = section_address;
|
s.start_address = section_address;
|
||||||
s.address += section_address;
|
s.address += section_address;
|
||||||
s.address_assigned = true;
|
s.address_assigned = true;
|
||||||
s.merged_section = SectionId();
|
s.merged_section = (int)(&curr - &allSections[0]);
|
||||||
s.merged_offset = (int)(section_out - CurrSection().output);
|
s.merged_offset = (int)(section_out - CurrSection().output);
|
||||||
|
|
||||||
// Merge in the listing at this point
|
// Merge in the listing at this point
|
||||||
@ -5581,7 +5581,6 @@ StatusCode Asm::ReadObjectFile(strref filename)
|
|||||||
// for now just append to existing assembler data
|
// for now just append to existing assembler data
|
||||||
|
|
||||||
// sections
|
// sections
|
||||||
int reloc_idx = 0;
|
|
||||||
for (int si = 0; si < hdr.sections; si++) {
|
for (int si = 0; si < hdr.sections; si++) {
|
||||||
short f = aSect[si].flags;
|
short f = aSect[si].flags;
|
||||||
aSctRmp[si] = (short)allSections.size();
|
aSctRmp[si] = (short)allSections.size();
|
||||||
@ -5655,12 +5654,12 @@ StatusCode Asm::ReadObjectFile(strref filename)
|
|||||||
lbl->label_name = name;
|
lbl->label_name = name;
|
||||||
lbl->pool_name.clear();
|
lbl->pool_name.clear();
|
||||||
lbl->value = l.value;
|
lbl->value = l.value;
|
||||||
lbl->evaluated = !!(f & ObjFileLabel::OFL_EVAL);
|
|
||||||
lbl->constant = !!(f & ObjFileLabel::OFL_CNST);
|
|
||||||
lbl->pc_relative = !!(f & ObjFileLabel::OFL_ADDR);
|
|
||||||
lbl->external = external == ObjFileLabel::OFL_XDEF;
|
|
||||||
lbl->section = l.section >= 0 ? aSctRmp[l.section] : l.section;
|
lbl->section = l.section >= 0 ? aSctRmp[l.section] : l.section;
|
||||||
lbl->mapIndex = l.mapIndex >= 0 ? (l.mapIndex + (int)map.size()) : -1;
|
lbl->mapIndex = l.mapIndex >= 0 ? (l.mapIndex + (int)map.size()) : -1;
|
||||||
|
lbl->evaluated = !!(f & ObjFileLabel::OFL_EVAL);
|
||||||
|
lbl->pc_relative = !!(f & ObjFileLabel::OFL_ADDR);
|
||||||
|
lbl->constant = !!(f & ObjFileLabel::OFL_CNST);
|
||||||
|
lbl->external = external == ObjFileLabel::OFL_XDEF;
|
||||||
lbl->reference = false;
|
lbl->reference = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user