4b8b0c21f9ceb9ba4cbc18e1744fb260dceb6438
[mono.git] / mcs / class / PEAPI / ChangeLog
1 2005-11-21  Ankit Jain  <jankit@novell.com>
2
3         * Metadata.cs (MetaData.WriteCodedIndex): Fix indentation.
4
5 2005-11-21  Ankit Jain  <jankit@novell.com>
6
7         * Metadata.cs (GenericParameter.SortKey2): New. Use index as the secondary key.
8         (GenericParameter.Size): Set size correctly.
9         (GenericParameter.Write): Use StringsIndex to write the index.
10         (MetaData.WriteTildeStream): Emit 2,0 as version for NET_2_0 profile.
11         (MetaData.version): Use 'v2.0.50727' for NET_2_0 profile.
12         (MetaData.BuildMetaData): Build and sort GenericParam, MethodSpec and 
13         GenericParamConstraint tables only for NET_2_0 profile.
14
15 2005-09-16  Ankit Jain  <jankit@novell.com>
16
17         * PEAPI.cs: Clean up indentation. Split into ...
18           Metadata.cs, Code.cs, PEAPI.cs: ... these.
19
20 2005-09-08  Ankit Jain  <jankit@novell.com>
21
22         * PEAPI.cs (FileImage.stackReserve): New. Set to default value of 0x100000 (1Mb).
23           (FileImage.WritePEHeader): Write stackReserve instead of the default value.
24           (PEFile.SetStackReserve): Set stack reserve for fileImage.
25
26 2005-09-06  Ankit Jain  <jankit@novell.com>
27
28         * PEAPI.cs (MetaData.WriteTildeStream): Change minor version back to 0.
29
30 2005-08-30  Ankit Jain  <jankit@novell.com>
31
32         * PEAPI.cs (MetaData.WriteTildeStream): Change minor version to 1.
33
34 2005-08-29  Ankit Jain  <jankit@novell.com>
35
36         * PEAPI.cs (CustomMarshaller.ctor): New.
37           (CustomMarshaller.ToBlob): Emit marshallerName and cookie strings with
38           their lengths.
39
40 2005-08-26  Ankit Jain  <jankit@novell.com>
41
42         * PEAPI.cs (PEFile.ctor): Restore old constructor overload to avoid
43           changing public API.
44
45 2005-08-26  Ankit Jain  <jankit@novell.com>
46
47         * PEAPI.cs (IResolutionScope): New. Empty interface.
48           (ClassRef): Implement IResolutionScope.
49           (ClassRef.parent): Change type from ResolutionScope to IResolutionScope.
50           (ClassRef.AddClass): New. Add nested class.
51           (ClassRef.AddValueClass): New. Add nested value class.
52
53 2005-08-23  Ankit Jain  <jankit@novell.com>
54
55         * PEAPI.cs (MetaData.version): Change from 1.0.3705 to 1.1.4322.
56
57 2005-08-23  Ankit Jain  <jankit@novell.com>
58
59         * PEAPI.cs (MSCorLib.systemClasses): Change type from ClassRef[] to
60           Class[].
61           (MSCorLib.ctor): Add assembly ref to mscorlib for non-mscorlib assemblies
62           only.
63           (MSCorLib.AddClass): Use Class instead of ClassRef.
64           (MSCorLib.GetSpecialClass): Change return type to Class from ClassRef.
65           Don't instantiate object of SystemClass if this assembly is mscorlib.
66           (MSCorLib.SetSpecialSystemClass): New. Set a System.* class for primitive
67           types, used for compiling mscorlib.
68           (MSCorLib.GetValueClass): Change to handle new type of systemClasses.
69           (MSCorLib.ValueType),
70           (MSCorLib.EnumType): Don't instantiate ClassRef if this assembly is mscorlib.
71           (ClassDef.ctor): Don't superType to System.Object for System.Object and <Module>. 
72           (ClassDef.MakeValueClass): Set typeIndex to ValueType's typeIndex.
73           (ClassDef.IsValueType),
74           (ClassDef.IsEnum): Use "==" instead of .CompareTo for string comparison.
75           (ClassDef.AddNestedClass): Set typeIndexChecked = true for the nested class.
76           (PEFile.isMSCorlib): New. bool field.
77           (PEFile.ctor): Move all ctor logic into one overload and call that from others.
78           (PEFile.ctor): Add outputDir parameter.
79           (PEFile.SetName): Set name of the assembly and set isMSCorlib accordingly.
80           (PEFile.IsMSCorlib): New. bool Property.
81           (PEFile.AddClass): Call overload.
82           (PEFile.AddClass): Set superType and SetSpecialSystemClass if compiling mscorlib.
83           (PEFile.AddValueClass): Call MakeValueClass only if the class is not System.ValueType
84           or System.Enum itself, else set the supertype correctly.
85
86 2005-08-16  Ankit Jain  <jankit@novell.com>
87
88         * PEAPI.cs (FieldAttr): Move HasFieldMarshal from FieldDef to this.
89           (ParamAttr): Move HasDefault and HasFieldMarshal from Param to this.
90           (ManifestResource.ctor): Use 'mres' param to clone.
91           (MethodDef.ret_param): New.
92           (MethodDef.AddRetTypeMarshallInfo): New.
93           (MethodDef.TypeSig): Set seqNo for ret_param to zero.
94           (MethodDef.BuildTables): Add ret_param to Param table, and BuildTables
95           for it.
96           (FixedSysString): New. Class to represent Fixed SysString native type.
97           (NativeArray): Rename len to numElem. Init numElem, parNum and elemMult
98           to -1.
99           (NativeArray.ctor): Uncomment ctor with one param (elemType).
100           (NativeArray.ctor): Move ctor logic to the one with all params.
101           (NativeArray.ToBlob): Emit values in correct order.
102           (SafeArray.hasElemType): New. bool var to indicate presence of ElemType.
103           (SafeArray.ctor): New. Parameterless constructor.
104           (SafeArray.ToBlob): Emit correctly.
105           (FixedArray.ctor): Remove elemType param.
106           (FixedArray.ToBlob): Don't emit elemType.
107
108 2005-08-08  Ankit Jain  <jankit@novell.com>
109
110         * PEAPI.cs (CodeBlock): Set maxCodeSize to 255 instead of 256 for checking
111           Fat format.
112           (CILInstructions.CheckCode): Use 255 instead of 256 for checking Fat format.
113
114 2005-08-08  Ankit Jain  <jankit@novell.com>
115
116         * PEAPI.cs (FileImage.WriteCLIHeader): Move the check for no entrypoint
117           in case of an EXE to ilasm/codegen/CodeGen.cs to avoid creating unnecessary
118           .exe.
119
120 2005-08-05  Ankit Jain  <jankit@novell.com>
121
122         * PEAPI.cs (FileImage.WriteCLIHeader): Throw Exception if an EXE has been
123           requested but the source file has no entrypoint defined.
124
125 2005-08-05  Ankit Jain  <jankit@novell.com>
126
127         * PEAPI.cs (TypeAttr): Add HasSecurity.
128           (MethAttr): Likewise.
129           (SecurityAction): New enum.
130           (DeclSecurity.ctor): Add 'byte []' as the third parameter.
131           (DeclSecurity.BuildTables): Write the byte array to the blob.
132           (MetaData.AddDeclSecurity): Add DeclSecurity to declsec_list.
133           (MetaData.BuildMetaData): Call BuildTables for declsec_list members.
134           (PEFile.AddDeclSecurity): New. Add DeclSecurity to metaData.
135
136 2005-04-30  Ankit Jain  <ankit@corewars.org>
137
138         * PEAPI.cs (InterfaceImpl.SortKey): New.
139         (MetaData.BuildMetaData): Sort InterfaceImpl table.
140         (MethodSemantics.SortKey): Compute key correctly.
141
142 2005-04-18  Ankit Jain  <ankit@corewars.org>
143
144         * PEAPI.cs (ManifestResource.InitResource): New. Used by constructors
145         to initialize the resource. 
146         (ManifestResource.ctor): New. Constructor to accept resource as a 
147         byte array.
148         (ManifestResource.ctor): New. Constructor to accept an object of self. 
149         (ManifestResource.BuildTables): Update.
150         (MetaData.AddResource): New. Add the resource to the list, adjust 
151         resourcesSize.
152         (MetaData.WriteResource): New. Write resources to the FileImage.
153         (PEFile.AddExternalManagedResource): New. Add a new resource.
154         (PEFile.GetResource): New. Get resource by name.
155         (PEFile.GetResources): New. Get array of resources.
156
157 2005-04-12  Ankit Jain  <ankit@corewars.org>
158
159         * PEAPI.cs (CustomAttribute.ctor): Dont throw 
160         NotYetImplementedException.
161         (MethodSemantics.SortKey): Should be sorted by 
162         'Association' column.
163         
164 2005-04-08  Ankit Jain  <radical@corewars.org>
165
166         * PEAPI.cs (MSCorLib.GetSpecialClass): Don't encode
167         System.ValueType and System.Enum as value types.
168         (ValueClass): New enum.
169         (Class.MakeValueClass): Add a 'ValueClass' parameter.
170         (ClassDef.MakeValueClass): Set supertype to ValueType or Enum
171         according to ValueClass parameter.
172         (IsValueType,IsEnum): New.  Test if type is System.ValueType or
173         System.Enum.
174         (ClassDef.AddNestedClass): Don't encode System.ValueType and
175         System.Enum as value types.
176
177 2005-03-17  Ankit Jain  <radical@corewars.org>
178
179         * PEAPI.cs: Metadata tables that must be sorted are sorted now.
180         Fixes the code for ParamAttr.Opt. Fix bug #73517.
181                 
182 2004-12-08  Sebastien Pouliot  <sebastien@ximian.com>
183
184         * PEAPI.cs: Added support for allocating and storing strongname 
185         signatures when a .publickey directive is present in source. Fix bug
186         #69721.
187
188 2004-12-01  Jackson Harper  <jackson@ximian.com>
189
190         * PEAPI.cs: Allow underlying types of ByteArrConsts to be set when
191         they are used as field init data.
192
193 2004-07-29  Martin Baulig  <martin@ximian.com>
194
195         * PEAPI.cs (Module.Guid): New public property.
196
197 2004-07-27  Martin Baulig  <martin@ximian.com>
198
199         * PEAPI.cs (CILInstructions.Offset): New public property.
200
201 2004-07-23  Jackson Harper  <jackson@ximian.com>
202
203         * PEAPI.cs: Make the type index modifiable so ClassRefInsts will
204         be emitted properly. This is in desperate need of some API love.
205         
206 2004-07-21  Jackson Harper  <jackson@ximian.com>
207
208         * PEAPI.cs: Do all the index size checks. I always wondered why
209         the code was like that and finally realized today that it was like
210         that because it was wrong. Wait until the opportune momement to
211         calculate the index sizes (after everything has been added to the
212         streams, and before writing anything).
213         
214 2004-07-21  Jackson Harper  <jackson@ximian.com>
215
216         * PEAPI.cs: Create ClassRefInsts with types not just
217         ClassRefs. This way modified types can be used. I am having alot
218         of trouble remembering why I actually even need this class though.
219         
220 2004-07-16  Jackson Harper  <jackson@ximian.com>
221
222         * PEAPI.cs: make sure small index sizes get set properly. Use a
223         continue to reduce nesting a little and make code almost mildly
224         readable. Add MDTable.Field to the list of tables that can
225         increase the CustomAttributeType shift. TODO: What else should be
226         here?
227         
228 2004-07-13  Jackson Harper  <jackson@ximian.com>
229
230         * PEAPI.cs: Use a byte array hash code provider and comprarer, so
231         checking the byte hashtable for duplicate entries actually
232         works. Old method was valid but created larger then needed binaries.
233         
234 2004-07-09  Jackson Harper  <jackson@ximian.com>
235
236         * PEAPI.cs: Don't build custom attributes twice.
237         
238 2004-07-08  Jackson Harper  <jackson@ximian.com>
239
240         * PEAPI.cs: Add custom attributes through the pefile so that we
241         can ensure they are emitted no matter what table they are
242         in. Previously not all custom attributes were getting emitted.
243         
244 2004-06-26  Jackson Harper  <jackson@ximian.com>
245
246         * PEAPI.cs: Add a method to set the fields list. This is needed so
247         that sequentially laid out fields are laid out in the right
248         order. When building custom attribute tables actually emit the
249         custom attribute data. When writing the .sdata section make sure
250         to pad to its size. The constants itself will not make up the
251         entire section because it is aligned on 512 byte blocks.
252         
253 2004-06-19  Jackson Harper  <jackson@ximian.com>
254
255         * PEAPI.cs: Make sure the sentinel is placed properly for vararg
256         method pointers.
257         
258 2004-06-19  Jackson Harper  <jackson@ximian.com>
259
260         * PEAPI.cs: Allow MethPtrTypes to be created from a signature
261         instead of from a method reference because it really doesn't make
262         sense to do it that way ;-).
263         
264 2004-06-14  Jackson Harper  <jackson@ximian.com>
265
266         * PEAPI.cs: Add IExternRef interface and modify sigs so it can be
267         used. So we can easily add stuff to modules and assemblies. Fix
268         the nometadata flag, it should be set when there is NO metadata
269         not when there is metadata.
270         
271 2004-06-14  Jackson Harper  <jackson@ximian.com>
272
273         * PEAPI.cs: Add new constructor so we can explicitly set the
274         module name.
275         
276 2004-06-03  Jackson Harper  <jackson@ximian.com>
277
278         * PEAPI.cs: Do not null terminate byte arrays when writing to the
279         blob stream.
280         
281 2004-05-25  Jackson Harper  <jackson@ximian.com>
282
283         * PEAPI.cs: When writing to the blob heap we always set a size.
284         
285 2004-05-25  Jackson Harper  <jackson@ximian.com>
286
287         * PEAPI.cs: Set the has default flag on fields when a default data
288         constant is assigned to them.
289         
290 2004-05-25  Jackson Harper  <jackson@ximian.com>
291
292         * PEAPI.cs: Encode string constants as unicode before putting them
293         in the blob.
294         
295 2004-05-25  Jackson Harper  <jackson@ximian.com>
296
297         * PEAPI.cs: zero RVAs for abstract, runtime, and internal call
298         methods.
299         
300 2004-04-30  Duncan Mak  <duncan@ximian.com>
301
302         * PEAPI.dll.sources: Added Assembly/AssemblyInfo.cs and 
303         Locale.cs to build.
304
305 2004-04-02  Jackson Harper  <jackson@ximian.com>
306
307         * PEAPI.cs: Allow hash algorithms to be any integer.
308         
309 2004-02-18  Jackson Harper <jackson@ximian.com>
310
311         * PEAPI.cs: Add a class for creating instances of class refs, this
312         is used for setting the class or valuetype of a types instance so the class
313         reference isn't modified. Allows things like 'valuetype [mscorlib]System.Object'.
314         
315 2003-11-18 Jackson Harper <jackson@ximian.com>
316
317         * PEAPI.cs: If the data length for a methods seh section is
318         greater then 255 use fat format headers.
319         
320 2003-11-17 Jackson Harper <jackson@ximian.com>
321
322         * PEAPI.cs: Allow strings to be loaded as bytearrays.
323         
324 2003-10-19 Jackson Harper <jackson@ximian.com>
325
326         * PEAPI.cs: Use bytes not bits for constant sizes.
327         
328 2003-10-18 Jackson Harper <jackson@ximian.com>
329
330         * PEAPI.cs: Add proper support for short instructions, removing
331         PEAPI's auto selection of short/long branch operations feature.
332         
333 2003-10-10 Jackson Harper <jackson@ximian.com>
334
335         * PEAPI.cs: New GenericMethodSig class for creating generic method
336         signatures. Use this class instead of GenericTypeInst for creating
337         generic methods. Fix Generic call conv. according to two of my
338         docs it is 0x10 and only one says 0x50 so I will go with 0x10.
339         
340 2003-10-09 Jackson Harper <jackson@ximian.com>
341
342         * PEAPI.cs: Add generic method Mvar type. Add MethodSpec table,
343         and an Api method for adding methods to the methodspec table.
344         
345 2003-10-08 Jackson Harper <jackson@ximian.com>
346
347         * PEAPI.cs: Remove some old hacks for adding methods to arrays,
348         typespecs are used for this now. Add Generic call conv.
349         
350 2003-10-08 Jackson Harper <jackson@ximian.com>
351
352         * PEAPI.cs: Remove methods for creating generic parameters without
353         a name, names are mandatory. Add method to add type parameters to
354         methods. Allow GenericParameters to have either a type or a
355         method as its owner. Also fix visibility of GenericParameters, a
356         GenericParameter should not be created outside of PEAPI.
357         
358 2003-10-07 Jackson Harper <jackson@ximian.com>
359
360         * PEAPI.cs: Add unbox.any instruction.
361         
362 2003-09-27 Jackson Harper <jackson@latitudegeo.com>
363
364         * PEAPI.cs: Fix pinvoke attributes, zero a methods RVA if it has
365         pinvoke info. This isn't entirely correct because native unmanaged
366         methods can have pinvoke info and not have 0 RVAs PEAPI can't
367         handle native unmanged code though. Expose the ModuleClass so
368         'global' items can be referenced like this '<Module>'::foo.
369         
370 2003-09-21 Jackson Harper <jackson@latitudegeo.com>
371
372         * PEAPI.cs: sigh, sometimes it is best to calculate variables
373         before using them. This fixes PEAPI creating broken images when
374         the sdata section is used.
375         
376 2003-09-20 Jackson Harper <jackson@latitudegeo.com>
377
378         * PEAPI.cs: Rework to allow multiple constraints to be added to a
379         single generic parameter.
380         
381 2003-08-19 Jackson Harper <jackson@latitudegeo.com>
382
383         * PEAPI.cs: Make no super method public so we can have types
384         with no super type.
385         
386 2003-08-03 Jackson Harper <jackson@latitudegeo.com>
387
388         * PEAPI.cs: New Sentinel type.
389         
390 2003-08-03 Jackson Harper <jackson@latitudegeo.com>
391
392         * PEAPI.cs: Only give method definitions 0 RVAs if they are
393         marked abstract.
394         
395 2003-08-03 Jackson Harper <jackson@latitudegeo.com>
396
397         * PEAPI.cs: Offsets are not explicit offsets, they are just
398         byte offsets from the current position.
399
400 2003-07-29 Jackson Harper <jackson@latitudegeo.com>
401
402         * PEAPI.cs: Allow labels to be created with an explicit offset
403         
404 Fri Jul 25 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
405
406         * PEAPI.cs: added coded index for the owner field in the GenericParam
407         table.
408
409 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
410
411         * PEAPI.cs: Add methods to PEFile to allow fields and methods to
412         be added to type specs. This fixing bah-zillions of little
413         problems in ilasm. We can now add fields and methods to arrays,
414         reference types, and most importantly generics.
415
416         Add the GenericTypeInst class. This is an instance of a generic
417         type. ie Hash<int32, string>. GenericTypeSpecs now write their id
418         number as a compressed number, this matches the way the runtime
419         loads them and will allow generic types to have more then 255 type
420         parameters.
421         
422 2003-07-17 Jackson Harper <jackson@latitudegeo.com>
423
424         * PEAPI.cs: Add GenericTypeSpec so generic members can be
425         referenced. Add the ldelem and stelem opcodes (these are part of
426         the new spec).
427         
428 2003-07-15 Jackson Harper <jackson@latitudegeo.com>
429
430         * PEAPI.cs: Allow generic constraints to be added, emit generic
431         constraints.
432                 
433 2003-07-14 Jackson Harper <jackson@latitudegeo.com>
434
435         * PEAPI.cs: Cleanup methods for generics, now that constraints and
436         params are seperated.
437                 
438 2003-05-31 Jackson Harper <jackson@latitudegeo.com>
439
440         * PEAPI.cs: Initial work on implementing custom
441         attributes. Attributes can now be added to ClassDefs and
442         MethodDefs. Still need to implement for other metadata elements.
443         Added the stele.r4 and stelem.r8 instructions, this should also
444         shift the stelem.ref instruction to the proper value (0xA2)
445                 
446 2003-05-25 Jackson Harper <jackson@latitudegeo.com>
447
448         * PEAPI.cs: Create a list of vararg signatures and add them all to
449         tables. this allows more then one vararg signature to be created
450         per method.
451                 
452 2003-05-18 Jackson Harper <jackson@latitudegeo.com>
453
454         * PEAPI.cs: Add methods to allow methods to be added to arrays.
455                 
456 2003-05-11 Jackson Harper <jackson@latitudegeo.com>
457
458         * PEAPI.cs: The class size in class layout metadata table is a
459         uint not a short.
460                 
461 2003-04-05 Jackson Harper <jackson@latitudegeo.com>
462
463         * PEAPI.cs: Add indexes to GenericParameters, make string index
464         always a full 4 bytes.
465                 
466 2003-04-05 Jackson Harper <jackson@latitudegeo.com>
467
468         * PEAPI.cs: Add GenericParameter table, and method to add generic
469         parameters.
470                 
471 2003-03-15 Daniel Morgan <danmorg@sc.rr.com>
472
473         * PEAPI.build: added file for windows build
474
475 2003-03-06 Jackson Harper <jackson@latitudegeo.com>
476
477         * PEAPI.cs: (ImplAttr) Add Optil implementation flag (not supported 
478         in first release of CLR)
479         (Class) And Name property
480
481 2003-03-06 Jackson Harper <jackson@latitudegeo.com>
482
483         * makefile.gnu: Add file
484         * list.unix: Add file
485
486 2003-03-02 Jackson Harper <jackson@latitudegeo.com>
487
488         * PEAPI.cs: Do not add file extensions to output names
489         
490 2003-03-02 Jackson Harper <jackson@latitudegeo.com>
491
492         * PEAPI.cs: Add file
493         * README.txt: Add file