dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/ilalink ilalink.1,1.2,1.3 link_create.c


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/ilalink ilalink.1,1.2,1.3 link_create.c,1.18,1.19 link_main.c,1.15,1.16 link_method.c,1.21,1.22 linker.h,1.24,1.25
Date: Thu, 13 Feb 2003 18:19:15 -0500

Update of /cvsroot/dotgnu-pnet/pnet/ilalink
In directory subversions:/tmp/cvs-serv30208/ilalink

Modified Files:
        ilalink.1 link_create.c link_main.c link_method.c linker.h 
Log Message:


Add the "-fminimize-parameters" option to the linker which can be used
to strip the ParamDef table down to just those parameter blocks that
are strictly necessary.


Index: ilalink.1
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilalink/ilalink.1,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** ilalink.1   3 Nov 2001 04:44:49 -0000       1.2
--- ilalink.1   13 Feb 2003 23:19:12 -0000      1.3
***************
*** 1,3 ****
! .\" Copyright (c) 2001 Southern Storm Software, Pty Ltd.
  .\"
  .\" This program is free software; you can redistribute it and/or modify
--- 1,3 ----
! .\" Copyright (c) 2001, 2002, 2003 Southern Storm Software, Pty Ltd.
  .\"
  .\" This program is free software; you can redistribute it and/or modify
***************
*** 14,18 ****
  .\" along with this program; if not, write to the Free Software
  .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
! .TH ilalink 1 "3 November 2001" "Southern Storm Software" "Portable.NET 
Development Tools"
  .SH NAME
  ilalink \- the Intermediate Language (IL) assembly linker
--- 14,18 ----
  .\" along with this program; if not, write to the Free Software
  .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
! .TH ilalink 1 "14 February 2003" "Southern Storm Software" "Portable.NET 
Development Tools"
  .SH NAME
  ilalink \- the Intermediate Language (IL) assembly linker
***************
*** 111,114 ****
--- 111,118 ----
  Set the assembly hash algorithm to "ALG", which must be either
  "SHA1" or "MD5".  The default is "SHA1".
+ .TP
+ .B \-z, \-fminimize\-parameters
+ Minimize the size of the parameter definition table by discarding
+ parameters that don't strictly need to be present for correct execution.
  .TP
  .B \-3, \-m32bit\-only

Index: link_create.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilalink/link_create.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** link_create.c       14 Sep 2002 10:59:56 -0000      1.18
--- link_create.c       13 Feb 2003 23:19:12 -0000      1.19
***************
*** 68,71 ****
--- 68,72 ----
        linker->error = 0;
        linker->is32Bit = ((flags & IL_WRITEFLAG_32BIT_ONLY) != 0);
+       linker->linkerFlags = 0;
        linker->images = 0;
        linker->lastImage = 0;
***************
*** 354,357 ****
--- 355,365 ----
        /* Ready to go */
        return 1;
+ }
+ 
+ int ILLinkerSetFlags(ILLinker *linker, int flags)
+ {
+       int oldFlags = linker->linkerFlags;
+       linker->linkerFlags = flags;
+       return oldFlags;
  }
  

Index: link_main.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilalink/link_main.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** link_main.c 8 Feb 2003 04:24:29 -0000       1.15
--- link_main.c 13 Feb 2003 23:19:12 -0000      1.16
***************
*** 103,106 ****
--- 103,109 ----
                "-fprivate-resources         or -p",
                "Mark the resources as private to the output assembly."},
+       {"-z", 'z', 0,
+               "-fminimize-parameters       or -z",
+               "Minimize the size of the parameter table in the output."},
        {"-H", 'H', 1,
                "-fhash-algorithm=name       or -H name",
***************
*** 210,213 ****
--- 213,217 ----
        int privateResources = 0;
        int defaultIsLib = 0;
+       int linkerFlags = 0;
        int firstFile;
        int temp, temp2;
***************
*** 416,419 ****
--- 420,429 ----
                        break;
  
+                       case 'z':
+                       {
+                               linkerFlags |= IL_LINKFLAG_MINIMIZE_PARAMS;
+                       }
+                       break;
+ 
                        case 'S':
                        {
***************
*** 507,510 ****
--- 517,524 ----
                                        privateResources = 1;
                                }
+                               else if(!strcmp(param, "minimize-parameters"))
+                               {
+                                       linkerFlags |= 
IL_LINKFLAG_MINIMIZE_PARAMS;
+                               }
                                else
                                {
***************
*** 699,702 ****
--- 713,717 ----
                outOfMemory();
        }
+       ILLinkerSetFlags(linker, linkerFlags);
  
        /* Create the global module and assembly */

Index: link_method.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilalink/link_method.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** link_method.c       4 Jan 2003 00:44:33 -0000       1.21
--- link_method.c       13 Feb 2003 23:19:12 -0000      1.22
***************
*** 675,678 ****
--- 675,686 ----
        while((param = ILMethodNextParam(method, param)) != 0)
        {
+               if((linker->linkerFlags & IL_LINKFLAG_MINIMIZE_PARAMS) != 0 &&
+                  !ILParameter_Attrs(param) &&
+                  !ILProgramItem_HasAttrs(param) &&
+                  !ILFieldMarshalGetFromOwner(ILToProgramItem(param)))
+               {
+                       /* This parameter block doesn't add anything useful */
+                       continue;
+               }
                newParam = ILParameterCreate(newMethod, 0, 
ILParameter_Name(param),
                                                                         
ILParameter_Attrs(param),

Index: linker.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilalink/linker.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** linker.h    24 Dec 2002 01:25:18 -0000      1.24
--- linker.h    13 Feb 2003 23:19:12 -0000      1.25
***************
*** 124,127 ****
--- 124,128 ----
        int                             error;                  /* Some other 
error occurred */
        int                             is32Bit;                /* Non-zero if 
"-m32bit-only" supplied */
+       int                             linkerFlags;    /* Extra flags for the 
linker */
        ILLinkImage    *images;                 /* List of images to be linked 
*/
        ILLinkImage    *lastImage;              /* Last image on the "images" 
list */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]