Re:/Af:nnnn linker switch doesn't work
Quote
> First the reason you are getting the error: The PE spec doesn't allow the
> file alignment to be larger than the section alignment.
> We didn't enforce this in previous versions. The fact that you are seeing
> the error now is related to that fix. Still the error is wrong and you have
> discovered the workaround.
Ok, I assume you mean the fix is still being fixed?
Quote
> As for the generated exe crashing... I wasn't able to reproduce that. Care
> to share your test case?
I inserted the /Ao:0x1000 and /Af:0x1000 switches into the LFLAGS
line of the .BPR files of several of the example apps and they
all crashed throwing an EAccessViolation.
The "...\Examples\Apps\tab" application stopped at the try block
of the following code:
---vcl\Classes.pas----------------------
procedure TThreadList.Add(Item: Pointer);
begin
LockList;
try <-----------------------Stop point
if (Duplicates = dupAccept) or
(FList.IndexOf(Item) = -1) then
FList.Add(Item)
else if Duplicates = dupError then
FList.Error(@SDuplicateItem, Integer(Item));
finally
UnlockList;
end;
end;
-----------------------------------------
My application, which is a bit more involved than the "tab" app,
throws an EAccessViolation in the following code:
----vcl\GETMEM.INC-----------------------
function GetBlockDesc: PBlockDesc;
// Get a block descriptor.
// Will return nil for failure.
var
bd: PBlockDesc;
bdb: PBlockDescBlock;
i: Integer;
begin
if blockDescFreeList = nil then begin
bdb := LocalAlloc(LMEM_FIXED, sizeof(bdb^));
if bdb = nil then begin
result := nil;
exit;
end;
bdb.next := blockDescBlockList;
blockDescBlockList := bdb;
for i := low(bdb.data) to high(bdb.data) do begin
bd := @bdb.data[i];
bd.next := blockDescFreeList;
blockDescFreeList := bd;
end;
end;
bd := blockDescFreeList;
blockDescFreeList := bd.next; <----------Stop point
result := bd;
end;
----------------------------------------------
Note that without the addition of the switches (without changing the
file alignment), all tested apps compiled and ran fine.
Mike Mallory