Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-09

Section smartlinking enabled for i386-linux

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Peter Vreman

For i386-linux smartlinking using sections is now enabled by default and that -CX and -XX will do nothing.

Please report all issues on this mailing list.

If it doesn't work, disabling it locally can be done by reverting the following patch.

~/fpc/compiler>>> svn diff -r 1165:1166 systems
Index: systems/i_linux.pas
===================================================================
--- systems/i_linux.pas (revision 1165)
+++ systems/i_linux.pas (revision 1166)
@@ -46,7 +46,7 @@
             system       : system_i386_LINUX;
             name         : 'Linux for i386';
             shortname    : 'Linux';
-            flags        :
[tf_needs_symbol_size,tf_pic_uses_got{,tf_smartlink_sections}];
+            flags        :
[tf_needs_symbol_size,tf_pic_uses_got,tf_smartlink_sections];
             cpu          : cpu_i386;
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';

Reply by email

Micha Nelissen
to Peter Vreman
Show quoted text 7 lines
name : 'Linux for i386'; shortname : 'Linux'; - flags : [tf_needs_symbol_size,tf_pic_uses_got{,tf_smartlink_sections}]; + flags : [tf_needs_symbol_size,tf_pic_uses_got,tf_smartlink_sections]; cpu : cpu_i386;

Maybe silly question: why doesn't -XX add or remove that smartlink flag ?

Micha

Reply by email

Marco van de Voort
to Micha Nelissen
Show quoted text 11 lines
"Peter Vreman" wrote: > name : 'Linux for i386'; > shortname : 'Linux'; > - flags : > [tf_needs_symbol_size,tf_pic_uses_got{,tf_smartlink_sections}]; > + flags : > [tf_needs_symbol_size,tf_pic_uses_got,tf_smartlink_sections]; > cpu : cpu_i386; Maybe silly question: why doesn't -XX add or remove that smartlink flag ?

Because

1) the dividing into sections is done during compiletime, not link time.
2) the compiler has to know what kind of smartlinking .o's in .a's or sections in .o's is done.

Reply by email

Peter Vreman
to Micha Nelissen: On Fri, 23 Sep 2005 15:51:01 +0200 (CEST) Maybe silly question: why doesn't -XX add or…
Show quoted text 12 lines
On Fri, 23 Sep 2005 15:51:01 +0200 (CEST) "Peter Vreman" wrote: > name : 'Linux for i386'; > shortname : 'Linux'; > - flags : > [tf_needs_symbol_size,tf_pic_uses_got{,tf_smartlink_sections}]; > + flags : > [tf_needs_symbol_size,tf_pic_uses_got,tf_smartlink_sections]; > cpu : cpu_i386; Maybe silly question: why doesn't -XX add or remove that smartlink flag ?

The smartlink flag in the PPU only gives the compiler info which files can be used for linking. without this change that is a .o or a .a file. Since the .a file is not needed anymore there is only the .o left.

Using -XX to remove the ld option (--gc-sections) will have different effects on the platforms.

A possible solution is to revert to the old single section .o file method when the option -XS is passed.

Reply by email