Bläddra i källkod

* always use crtbeginS.o/crtendS.o when generating PIC code, not just when
generating libraries for x86_64 (at least all Linux systems I checked
have the S-variants of those files) (mantis #19501)

git-svn-id: trunk@17713 -

Jonas Maebe 14 år sedan
förälder
incheckning
78c3e6b359
1 ändrade filer med 2 tillägg och 14 borttagningar
  1. 2 14
      compiler/systems/t_linux.pas

+ 2 - 14
compiler/systems/t_linux.pas

@@ -389,18 +389,12 @@ begin
          if librarysearchpath.FindFile('crti.o',false,s) then
          if librarysearchpath.FindFile('crti.o',false,s) then
            AddFileName(s);
            AddFileName(s);
          { then the crtbegin* }
          { then the crtbegin* }
-         { x86_64 requires this to use entry/exit code with pic,
-           see also issue #8210 regarding a discussion
-           no idea about the other non i386 CPUs (FK)
-         }
-{$ifdef x86_64}
-         if current_module.islibrary then
+         if cs_create_pic in current_settings.moduleswitches then
            begin
            begin
              if librarysearchpath.FindFile('crtbeginS.o',false,s) then
              if librarysearchpath.FindFile('crtbeginS.o',false,s) then
                AddFileName(s);
                AddFileName(s);
            end
            end
          else
          else
-{$endif x86_64}
            if (cs_link_staticflag in current_settings.globalswitches) and
            if (cs_link_staticflag in current_settings.globalswitches) and
               librarysearchpath.FindFile('crtbeginT.o',false,s) then
               librarysearchpath.FindFile('crtbeginT.o',false,s) then
              AddFileName(s)
              AddFileName(s)
@@ -484,15 +478,9 @@ begin
       { objects which must be at the end }
       { objects which must be at the end }
       if linklibc and (libctype<>uclibc) then
       if linklibc and (libctype<>uclibc) then
        begin
        begin
-         { x86_64 requires this to use entry/exit code with pic,
-           see also issue #8210 regarding a discussion
-           no idea about the other non i386 CPUs (FK)
-         }
-{$ifdef x86_64}
-         if current_module.islibrary then
+         if cs_create_pic in current_settings.moduleswitches then
            found1:=librarysearchpath.FindFile('crtendS.o',false,s1)
            found1:=librarysearchpath.FindFile('crtendS.o',false,s1)
          else
          else
-{$endif x86_64}
            found1:=librarysearchpath.FindFile('crtend.o',false,s1);
            found1:=librarysearchpath.FindFile('crtend.o',false,s1);
          found2:=librarysearchpath.FindFile('crtn.o',false,s2);
          found2:=librarysearchpath.FindFile('crtn.o',false,s2);
          if found1 or found2 then
          if found1 or found2 then