mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 13:19:12 +02:00
* always use a minimal linker script when we are not using -T, so that the
chance of conflicts with the built-in linkerscript is minimised o removed special case for AArch64 which that already o check the diff without whitespace changes, most is indentation git-svn-id: trunk@31459 -
This commit is contained in:
parent
c27807ee63
commit
6d29ad44f7
@ -598,6 +598,24 @@ begin
|
||||
else
|
||||
add('ENTRY(_start)');
|
||||
|
||||
{ If we are using the default sysroot, use the default linker script and
|
||||
just augment it with the FPC-specific parts. Ideally, we should add
|
||||
"INSERT AFTER" at the end to explicitly tell ld to just augment the
|
||||
built-in linker script, but that's only supported by ld 2.19 and later.
|
||||
}
|
||||
if sysrootpath='' then
|
||||
begin
|
||||
add('SECTIONS');
|
||||
add('{');
|
||||
add(' .data :');
|
||||
add(' {');
|
||||
add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
|
||||
add(' }');
|
||||
add(' .threadvar _edata: { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }');
|
||||
add('}');
|
||||
end
|
||||
else
|
||||
begin
|
||||
{$ifdef x86_64}
|
||||
{$define LINKERSCRIPT_INCLUDED}
|
||||
add('SECTIONS');
|
||||
@ -733,26 +751,6 @@ begin
|
||||
|
||||
{$ifdef AArch64}
|
||||
{$define LINKERSCRIPT_INCLUDED}
|
||||
if sysrootpath='' then
|
||||
begin
|
||||
{ On other architectures, supplying a complete linker script
|
||||
without the -T option just results in:
|
||||
warning: link.res contains output sections; did you forget -T?
|
||||
However, with a recent aarch64 linker the result is:
|
||||
/usr/bin/ld: internal error ../../ld/ldlang.c 5221
|
||||
So in these cases, where -T will not be used, we supply a
|
||||
minimal linker script with just the FPC-specific part: }
|
||||
add('SECTIONS');
|
||||
add('{');
|
||||
add(' .data :');
|
||||
add(' {');
|
||||
{ extra by FPC }
|
||||
add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
|
||||
add(' }');
|
||||
add('}');
|
||||
end
|
||||
else
|
||||
begin
|
||||
{ Complete linker script for aarch64-linux: }
|
||||
add('SECTIONS');
|
||||
add('{');
|
||||
@ -961,7 +959,6 @@ begin
|
||||
add(' .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }');
|
||||
add(' /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }');
|
||||
add('}');
|
||||
end;
|
||||
{$endif AArch64}
|
||||
|
||||
{$ifdef ARM}
|
||||
@ -1293,6 +1290,7 @@ begin
|
||||
add('}');
|
||||
end;
|
||||
{$endif LINKERSCRIPT_INCLUDED}
|
||||
end;
|
||||
{ Write and Close response }
|
||||
writetodisk;
|
||||
Free;
|
||||
|
Loading…
Reference in New Issue
Block a user