all groups > dotnet clr > january 2005 >
You're in the

dotnet clr

group:

Method header alignment


Method header alignment mps
1/18/2005 10:05:07 AM
dotnet clr: According to Partition II (and several other documents) method headers are
supposed to be aligned. However, examining a hex dump of
System.Messaging.dll shows the following tiny method headers (Surrounded by
*'s).

0013300 00 00 00 00*36*02 28 2f 00 00 0a 03 6f 30 00 00
0013320 0a 2a*3a*02 28 2f 00 00 0a 03 04 6f 31 00 00 0a
0013340 2a 36 02 28 2f 00 00 0a 03 6f 32 00 00 0a 2a*76*

More simply, calling MetaDataImport->EnumMethods and then GetRVA shows many
unaligned method headers.

Re: Method header alignment mps
1/18/2005 3:51:05 PM
Thanks. The fat headers do appear to be aligned in files generated by
Microsoft tools. However, unaligned fat headers to appear to run correctly
and validate, so maybe there is more to the story. I think I should be very
conservative and not assume any alignment.

BTW, exception headers don't have this issue. They don't run if they aren't
aligned.

Mike

[quoted text, click to view]
Re: Method header alignment Mattias Sjögren
1/19/2005 12:28:15 AM

[quoted text, click to view]

I believe the DWORD alginment requirement only applies to fat headers.
That's what Lidin's book says.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
AddThis Social Bookmark Button