mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 15:13:41 +02:00
* TObjData.symbolref: don't lose the weak binding of asm symbol. This fixes tests/tweaklib*.pp at least for Linux x86 targets with internal assembler.
* Enabled weak linking for Linux targets. git-svn-id: trunk@21998 -
This commit is contained in:
parent
1c51b8d906
commit
c1e7e9c85e
@ -1085,17 +1085,29 @@ implementation
|
||||
|
||||
|
||||
function TObjData.symbolref(asmsym:TAsmSymbol):TObjSymbol;
|
||||
var
|
||||
s:string;
|
||||
begin
|
||||
if assigned(asmsym) then
|
||||
begin
|
||||
if not assigned(asmsym.cachedObjSymbol) then
|
||||
begin
|
||||
result:=symbolref(asmsym.name);
|
||||
s:=asmsym.name;
|
||||
result:=TObjSymbol(FObjSymbolList.Find(s));
|
||||
if result=nil then
|
||||
begin
|
||||
result:=TObjSymbol.Create(FObjSymbolList,s);
|
||||
if asmsym.bind=AB_WEAK_EXTERNAL then
|
||||
result.bind:=AB_WEAK_EXTERNAL;
|
||||
end;
|
||||
asmsym.cachedObjSymbol:=result;
|
||||
FCachedAsmSymbolList.add(asmsym);
|
||||
end
|
||||
else
|
||||
result:=TObjSymbol(asmsym.cachedObjSymbol);
|
||||
{ The weak bit could have been removed from asmsym. }
|
||||
if (asmsym.bind=AB_EXTERNAL) and (result.bind=AB_WEAK_EXTERNAL) then
|
||||
result.bind:=AB_EXTERNAL;
|
||||
end
|
||||
else
|
||||
result:=nil;
|
||||
|
@ -297,7 +297,7 @@ interface
|
||||
system_ia64_win64]+systems_linux;
|
||||
|
||||
{ all systems for which weak linking has been tested/is supported }
|
||||
systems_weak_linking = systems_darwin + systems_solaris;
|
||||
systems_weak_linking = systems_darwin + systems_solaris + systems_linux;
|
||||
|
||||
systems_internal_sysinit = [system_i386_linux,system_i386_win32];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user