mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 12:39:36 +02:00
* exporting of symbols from linux programs, i.e. exports clause in
programs allowed git-svn-id: trunk@855 -
This commit is contained in:
parent
9a624dd82f
commit
a3e330526d
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -6121,6 +6121,7 @@ tests/webtbs/tw3931a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3939.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3953a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3953b.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3964.pp -text
|
||||
tests/webtbs/tw3967.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3968.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3970.pp svneol=native#text/plain
|
||||
@ -6197,6 +6198,7 @@ tests/webtbs/uw3356.pp svneol=native#text/plain
|
||||
tests/webtbs/uw3429.pp svneol=native#text/plain
|
||||
tests/webtbs/uw3474a.pp svneol=native#text/plain
|
||||
tests/webtbs/uw3474b.pp svneol=native#text/plain
|
||||
tests/webtbs/uw3964.pp -text
|
||||
tests/webtbs/uw3968.pp svneol=native#text/plain
|
||||
tests/webtbs/uw4140.pp svneol=native#text/plain
|
||||
utils/Makefile svneol=native#text/plain
|
||||
|
@ -1382,7 +1382,14 @@ implementation
|
||||
consume_all_until(_SEMICOLON);
|
||||
end
|
||||
else if islibrary or
|
||||
(target_info.system in [system_i386_WIN32,system_i386_wdosx,system_i386_Netware,system_i386_netwlibc,system_arm_wince]) then
|
||||
(target_info.system in [
|
||||
system_i386_win32,
|
||||
system_i386_wdosx,
|
||||
system_i386_Netware,
|
||||
system_i386_netwlibc,
|
||||
system_arm_wince,
|
||||
system_x86_64_win64,
|
||||
system_ia64_win64]+system_linux) then
|
||||
read_exports
|
||||
else
|
||||
begin
|
||||
|
@ -203,7 +203,7 @@ procedure TLinkerLinux.SetDefaultInfo;
|
||||
}
|
||||
|
||||
const
|
||||
{$ifdef i386} platform_select='-b elf32-i386 -m elf_i386';{$endif}
|
||||
{$ifdef i386} platform_select='-b elf32-i386 -m elf_i386';{$endif}
|
||||
{$ifdef x86_64} platform_select='-b elf64-x86-64 -m elf_x86_64';{$endif}
|
||||
{$ifdef powerpc}platform_select='-b elf32-powerpc -m elf32ppclinux';{$endif}
|
||||
{$ifdef sparc} platform_select='-b elf32-sparc -m elf32_sparc';{$endif}
|
||||
@ -627,6 +627,8 @@ begin
|
||||
{ Strip the library ? }
|
||||
if success and (cs_link_strip in aktglobalswitches) then
|
||||
begin
|
||||
{ only remove non global symbols and debugging info for a library }
|
||||
Info.DllCmd[2]:='strip --discard-all --strip-debug $EXE';
|
||||
SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
|
||||
Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
|
||||
success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
|
||||
|
18
tests/webtbs/tw3964.pp
Normal file
18
tests/webtbs/tw3964.pp
Normal file
@ -0,0 +1,18 @@
|
||||
{ %target=linux }
|
||||
{$mode objfpc}
|
||||
|
||||
{$linklib libuw3964}
|
||||
|
||||
function testfunc : longint;public name 'testfunc';
|
||||
begin
|
||||
result:=1234;
|
||||
end;
|
||||
|
||||
function f : longint;external name 'f';
|
||||
|
||||
exports
|
||||
testfunc name 'testfunc';
|
||||
|
||||
begin
|
||||
writeln(f);
|
||||
end.
|
16
tests/webtbs/uw3964.pp
Normal file
16
tests/webtbs/uw3964.pp
Normal file
@ -0,0 +1,16 @@
|
||||
{ %target=linux }
|
||||
{$mode objfpc}
|
||||
library uw3964;
|
||||
|
||||
function testfunc : longint;external name 'testfunc';
|
||||
|
||||
function f : longint;public;
|
||||
begin
|
||||
result:=testfunc;
|
||||
end;
|
||||
|
||||
exports
|
||||
f;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user