Fix address-fixed sections potentially incorrectly assigned

This happened if all space before their fixed location was taken
This commit is contained in:
ISSOtm
2019-10-11 19:00:57 +02:00
parent 9e33cc998f
commit 4600f70fef

View File

@@ -166,11 +166,11 @@ static struct FreeSpace *getPlacement(struct Section const *section,
* one candidate block per bank; if we already
* reached it, give up.
*/
if (location->address == section->org)
if (location->address < section->org)
location->address = section->org;
else
/* Try again in next bank */
space = NULL;
else
location->address = section->org;
} else if (section->isAlignFixed) {
/* Move to next aligned location */
location->address &= ~section->alignMask;