mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-29 08:10:56 +01:00
+ support for ".reference" and ".no_dead_strip" darwin assembler directivs
* use ".reference" to prevent parts of resource string ansistrings from
being dead stripped under Darwin
git-svn-id: trunk@4614 -
This commit is contained in:
parent
17e61456c6
commit
32390af0f6
@ -240,7 +240,8 @@ interface
|
||||
|
||||
TAsmDirective=(
|
||||
asd_non_lazy_symbol_pointer,asd_indirect_symbol,asd_lazy_symbol_pointer,
|
||||
asd_extern,asd_nasm_import, asd_toc_entry, asd_mod_init_func, asd_mod_term_func
|
||||
asd_extern,asd_nasm_import, asd_toc_entry, asd_mod_init_func, asd_mod_term_func,
|
||||
asd_reference,asd_no_dead_strip
|
||||
);
|
||||
|
||||
const
|
||||
@ -249,7 +250,8 @@ interface
|
||||
stabtypestr : array[TStabType] of string[5]=('stabs','stabn','stabd');
|
||||
directivestr : array[TAsmDirective] of string[23]=(
|
||||
'non_lazy_symbol_pointer','indirect_symbol','lazy_symbol_pointer',
|
||||
'extern','nasm_import', 'tc', 'mod_init_func', 'mod_term_func'
|
||||
'extern','nasm_import', 'tc', 'mod_init_func', 'mod_term_func', 'reference',
|
||||
'no_dead_strip'
|
||||
);
|
||||
|
||||
type
|
||||
|
||||
@ -32,7 +32,7 @@ implementation
|
||||
|
||||
uses
|
||||
cclasses,
|
||||
cutils,globtype,globals,
|
||||
cutils,globtype,globals,systems,
|
||||
symconst,symtype,symdef,symsym,
|
||||
verbose,fmodule,ppu,
|
||||
aasmbase,aasmtai,aasmdata,
|
||||
@ -130,12 +130,20 @@ uses
|
||||
function WriteValueString(p:pchar;len:longint):TasmLabel;
|
||||
var
|
||||
s : pchar;
|
||||
reference: TAsmLabel;
|
||||
begin
|
||||
if (target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
|
||||
begin
|
||||
current_asmdata.getdatalabel(reference);
|
||||
current_asmdata.asmlists[al_const].concat(tai_label.create(reference));
|
||||
end;
|
||||
current_asmdata.getdatalabel(result);
|
||||
current_asmdata.asmlists[al_const].concat(tai_align.create(const_align(sizeof(aint))));
|
||||
current_asmdata.asmlists[al_const].concat(tai_const.create_aint(-1));
|
||||
current_asmdata.asmlists[al_const].concat(tai_const.create_aint(len));
|
||||
current_asmdata.asmlists[al_const].concat(tai_label.create(result));
|
||||
if (target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
|
||||
current_asmdata.asmlists[al_const].concat(tai_directive.create(asd_reference,reference.getname));
|
||||
getmem(s,len+1);
|
||||
move(p^,s^,len);
|
||||
s[len]:=#0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user