mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 22:49:17 +02:00
* use Tai_symbol.Create_global() when emitting a global symbol for an
abstract method wrapper (tai_symbol.create() currently overrides the symbol type from global to local; will fix in next commit) * only generate global abstract method wrappers for the class in which the abstract method is declared to prevent duplicate symbol errors after the above fix git-svn-id: trunk@25265 -
This commit is contained in:
parent
3b9b6a0cd7
commit
d8c84706dd
@ -721,16 +721,24 @@ implementation
|
|||||||
begin
|
begin
|
||||||
{ Generate stubs for abstract methods, so their symbols are present and
|
{ Generate stubs for abstract methods, so their symbols are present and
|
||||||
can be used e.g. to take address (see issue #24536). }
|
can be used e.g. to take address (see issue #24536). }
|
||||||
|
if (po_global in pd.procoptions) and
|
||||||
|
(pd.owner.defowner<>self._class) then
|
||||||
|
exit;
|
||||||
sym:=current_asmdata.GetAsmSymbol(pd.mangledname);
|
sym:=current_asmdata.GetAsmSymbol(pd.mangledname);
|
||||||
if assigned(sym) and (sym.bind<>AB_EXTERNAL) then
|
if assigned(sym) and (sym.bind<>AB_EXTERNAL) then
|
||||||
exit;
|
exit;
|
||||||
maybe_new_object_file(list);
|
maybe_new_object_file(list);
|
||||||
new_section(list,sec_code,lower(pd.mangledname),target_info.alignment.procalign);
|
new_section(list,sec_code,lower(pd.mangledname),target_info.alignment.procalign);
|
||||||
if (po_global in pd.procoptions) then
|
if (po_global in pd.procoptions) then
|
||||||
sym:=current_asmdata.DefineAsmSymbol(pd.mangledname,AB_GLOBAL,AT_FUNCTION)
|
begin
|
||||||
|
sym:=current_asmdata.DefineAsmSymbol(pd.mangledname,AB_GLOBAL,AT_FUNCTION);
|
||||||
|
list.concat(Tai_symbol.Create_global(sym,0));
|
||||||
|
end
|
||||||
else
|
else
|
||||||
sym:=current_asmdata.DefineAsmSymbol(pd.mangledname,AB_LOCAL,AT_FUNCTION);
|
begin
|
||||||
list.concat(Tai_symbol.Create(sym,0));
|
sym:=current_asmdata.DefineAsmSymbol(pd.mangledname,AB_LOCAL,AT_FUNCTION);
|
||||||
|
list.concat(Tai_symbol.Create(sym,0));
|
||||||
|
end;
|
||||||
cg.g_external_wrapper(list,pd,'FPC_ABSTRACTERROR');
|
cg.g_external_wrapper(list,pd,'FPC_ABSTRACTERROR');
|
||||||
list.concat(Tai_symbol_end.Create(sym));
|
list.concat(Tai_symbol_end.Create(sym));
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user