From 4600f70fef49f070e7fabb2b8f653edb5e0f72b4 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Fri, 11 Oct 2019 19:00:57 +0200 Subject: [PATCH] Fix address-fixed sections potentially incorrectly assigned This happened if all space before their fixed location was taken --- src/link/assign.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/link/assign.c b/src/link/assign.c index b300e9c6..1e9e262e 100644 --- a/src/link/assign.c +++ b/src/link/assign.c @@ -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;