* 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:
sergei 2012-08-02 12:15:55 +00:00
parent 1c51b8d906
commit c1e7e9c85e
2 changed files with 14 additions and 2 deletions

View File

@ -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;

View File

@ -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];