[ntdev]: Question about the .reloc section and linker?

Hi,

Because I found when I use lib command convert the xxx.obj generated by cl to xxx.lib, link the xxx.lib instead of xxx.obj with other libraries to .dll. The unused zero pads would be removed. It is very strange. Can you tell me why?

BR

Sean


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Shang, Sean
Sent: 2006??6??1?? 9:58
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] [ntdev]: Question about the .reloc section?

Thanks!

But I had set the ALIGN as 32Bytes in options of linker, it does not reduce size of zero pads in .reloc section. And I also used the /NODEFAULTLIBRARY to link my code.

BR

Sean


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Edouard A.
Sent: 2006??5??31?? 19:15
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] [ntdev]: Question about the .reloc section?

The .reloc sections is made of relocation addresses lists which ends with a double 0 + alignment. Do not remove them. If you wish to reduce the size of your binary, reduce the alignment (at your own risks??) or pack it (with UPX for example).

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Shang, Sean
Sent: Wednesday, May 31, 2006 05:48
To: Windows System Software Devs Interest List
Subject: [ntdev] [ntdev]: Question about the .reloc section?

Hi,

I have a question about the DDK compiler/Linker.

My question:

When I build a .DLL file, I found the .reloc section is padded with some strange zero. Can you tell me the reason?

If the zero padings are not useful, Could you tell me how to stripe it from the .dll file with DDK tool-chain?

The .dll dump information of the .reloc section is included following:

SECTION HEADER #4

00000230 : 2E 72 65 6C 6F 63 00 30

00000230 : E0 06 00 00 80 11 00 00 E0 06 00 00 80 11 00 00

00000230 : 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 42

.reloc name

6E0 virtual size

1180 virtual address (10001180 to 1000185F)

6E0 size of raw data

1180 file pointer to raw data (00001180 to 0000185F)

0 file pointer to relocation table

0 file pointer to line numbers

0 number of relocations

0 number of line numbers

42000040 flags

Initialized Data

Discardable

Read Only

RAW DATA #4

10001180: 00 00 00 00 74 00 00 00 70 32 7A 32 81 32 A0 32 …t…p2z2.22

10001190: B0 32 DF 32 E9 32 F3 32 01 33 2D 33 34 33 76 33 ??22??2??2.3-343v3

100011A0: A5 35 E6 35 43 37 65 37 93 37 9A 37 AF 37 CC 37 ??55C7e7.7.7??7??7

100011B0: E3 37 30 3A 7D 3A 84 3A 64 3D 6C 3D 74 3D 7C 3D 70:}:.:d=l=t=|=

100011C0: 84 3D 8C 3D 94 3D 9C 3D A4 3D AC 3D B4 3D BC 3D .=.=.=.=??==??==

100011D0: C4 3D CC 3D D4 3D DC 3D E4 3D EC 3D F4 3D FC 3D =??==??==??==??=

100011E0: 04 3E 0C 3E 14 3E 1C 3E 24 3E 2C 3E 34 3E 3C 3E .>.>.>.>$>,>4><>

100011F0: 44 3E 00 00 00 10 00 00 10 00 00 00 30 31 38 31 D>…0181

10001200: 3C 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <1…

10001210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

10001220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

??.. // Zero padding

10001830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

10001840: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

10001850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

BASE RELOCATIONS #4

0 RVA, 74 SizeOfBlock

270 HIGHLOW 10000BE8

27A HIGHLOW 10000BD4

281 HIGHLOW 10000B60

2A0 HIGHLOW 10001120

2B0 HIGHLOW 10001134

2DF HIGHLOW 10000BE8

2E9 HIGHLOW 10000BD4

2F3 HIGHLOW 10000C10

301 HIGHLOW 10001140

32D HIGHLOW 10000CC0

334 HIGHLOW 10000C78

376 HIGHLOW 10000C64

5A5 HIGHLOW 10000D40

5E6 HIGHLOW 10000D0C

743 HIGHLOW 10000D00

765 HIGHLOW 10000CE4

793 HIGHLOW 10000D4C

79A HIGHLOW 10000D64

7AF HIGHLOW 10000D64

7CC HIGHLOW 10000CDC

7E3 HIGHLOW 10000CD8

A30 HIGHLOW 10000E50

A7D HIGHLOW 10001068

A84 HIGHLOW 10001020

D64 HIGHLOW 10001018

D6C HIGHLOW 1000100C

D74 HIGHLOW 10000FF8

D7C HIGHLOW 10000FEC

D84 HIGHLOW 10000FDC

D8C HIGHLOW 10000FC8

D94 HIGHLOW 10000FBC

D9C HIGHLOW 10000FAC

DA4 HIGHLOW 10000F9C

DAC HIGHLOW 10000F88

DB4 HIGHLOW 10000F78

DBC HIGHLOW 10000F6C

DC4 HIGHLOW 10000F60

DCC HIGHLOW 10000F50

DD4 HIGHLOW 10000F44

DDC HIGHLOW 10000F34

DE4 HIGHLOW 10000F28

DEC HIGHLOW 10000F1C

DF4 HIGHLOW 10000F10

DFC HIGHLOW 10000F04

E04 HIGHLOW 10000EF4

E0C HIGHLOW 10000EEC

E14 HIGHLOW 10000EE0

E1C HIGHLOW 10000ED4

E24 HIGHLOW 10000EC4

E2C HIGHLOW 10000EAC

E34 HIGHLOW 10000E94

E3C HIGHLOW 10000E7C

E44 HIGHLOW 10000E60

0 ABS

1000 RVA, 10 SizeOfBlock

130 HIGHLOW 100002CA

138 HIGHLOW 10001120

13C HIGHLOW 10001130

0 ABS

BR
Sean


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Wanadoo vous informe que cet e-mail a ete controle par l’anti-virus mail.
Aucun virus connu a ce jour par nos services n’a ete detecte.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

If you link to a DLL, the needed relocations will be in the DLL… Did I understand correctly?

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Shang, Sean
Sent: Thursday, June 01, 2006 09:30
To: Windows System Software Devs Interest List
Subject: [ntdev] [ntdev]: Question about the .reloc section and linker?

Hi,

Because I found when I use lib command convert the xxx.obj generated by cl to xxx.lib, link the xxx.lib instead of xxx.obj with other libraries to .dll. The unused zero pads would be removed. It is very strange. Can you tell me why?

BR

Sean


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Shang, Sean
Sent: 2006年6月1日 9:58
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] [ntdev]: Question about the .reloc section?

Thanks!

But I had set the ALIGN as 32Bytes in options of linker, it does not reduce size of zero pads in .reloc section. And I also used the /NODEFAULTLIBRARY to link my code.

BR

Sean


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Edouard A.
Sent: 2006年5月31日 19:15
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] [ntdev]: Question about the .reloc section?

The .reloc sections is made of relocation addresses lists which ends with a double 0 + alignment. Do not remove them. If you wish to reduce the size of your binary, reduce the alignment (at your own risks…) or pack it (with UPX for example).

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Shang, Sean
Sent: Wednesday, May 31, 2006 05:48
To: Windows System Software Devs Interest List
Subject: [ntdev] [ntdev]: Question about the .reloc section?

Hi,

I have a question about the DDK compiler/Linker.

My question:

When I build a .DLL file, I found the .reloc section is padded with some strange zero. Can you tell me the reason?

If the zero padings are not useful, Could you tell me how to stripe it from the .dll file with DDK tool-chain?

The .dll dump information of the .reloc section is included following:

SECTION HEADER #4

00000230 : 2E 72 65 6C 6F 63 00 30

00000230 : E0 06 00 00 80 11 00 00 E0 06 00 00 80 11 00 00

00000230 : 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 42

.reloc name

6E0 virtual size

1180 virtual address (10001180 to 1000185F)

6E0 size of raw data

1180 file pointer to raw data (00001180 to 0000185F)

0 file pointer to relocation table

0 file pointer to line numbers

0 number of relocations

0 number of line numbers

42000040 flags

Initialized Data

Discardable

Read Only

RAW DATA #4

10001180: 00 00 00 00 74 00 00 00 70 32 7A 32 81 32 A0 32 …t…p2z2.22

10001190: B0 32 DF 32 E9 32 F3 32 01 33 2D 33 34 33 76 33 °22é2ó2.3-343v3

100011A0: A5 35 E6 35 43 37 65 37 93 37 9A 37 AF 37 CC 37 ¥55C7e7.7.7ˉ7ì7

100011B0: E3 37 30 3A 7D 3A 84 3A 64 3D 6C 3D 74 3D 7C 3D 70:}:.:d=l=t=|=

100011C0: 84 3D 8C 3D 94 3D 9C 3D A4 3D AC 3D B4 3D BC 3D .=.=.=.=¤==′==

100011D0: C4 3D CC 3D D4 3D DC 3D E4 3D EC 3D F4 3D FC 3D =ì==ü==ì==ü=

100011E0: 04 3E 0C 3E 14 3E 1C 3E 24 3E 2C 3E 34 3E 3C 3E .>.>.>.>$>,>4><>

100011F0: 44 3E 00 00 00 10 00 00 10 00 00 00 30 31 38 31 D>…0181

10001200: 3C 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <1…

10001210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

10001220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

…… // Zero padding

10001830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

10001840: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

10001850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

BASE RELOCATIONS #4

0 RVA, 74 SizeOfBlock

270 HIGHLOW 10000BE8

27A HIGHLOW 10000BD4

281 HIGHLOW 10000B60

2A0 HIGHLOW 10001120

2B0 HIGHLOW 10001134

2DF HIGHLOW 10000BE8

2E9 HIGHLOW 10000BD4

2F3 HIGHLOW 10000C10

301 HIGHLOW 10001140

32D HIGHLOW 10000CC0

334 HIGHLOW 10000C78

376 HIGHLOW 10000C64

5A5 HIGHLOW 10000D40

5E6 HIGHLOW 10000D0C

743 HIGHLOW 10000D00

765 HIGHLOW 10000CE4

793 HIGHLOW 10000D4C

79A HIGHLOW 10000D64

7AF HIGHLOW 10000D64

7CC HIGHLOW 10000CDC

7E3 HIGHLOW 10000CD8

A30 HIGHLOW 10000E50

A7D HIGHLOW 10001068

A84 HIGHLOW 10001020

D64 HIGHLOW 10001018

D6C HIGHLOW 1000100C

D74 HIGHLOW 10000FF8

D7C HIGHLOW 10000FEC

D84 HIGHLOW 10000FDC

D8C HIGHLOW 10000FC8

D94 HIGHLOW 10000FBC

D9C HIGHLOW 10000FAC

DA4 HIGHLOW 10000F9C

DAC HIGHLOW 10000F88

DB4 HIGHLOW 10000F78

DBC HIGHLOW 10000F6C

DC4 HIGHLOW 10000F60

DCC HIGHLOW 10000F50

DD4 HIGHLOW 10000F44

DDC HIGHLOW 10000F34

DE4 HIGHLOW 10000F28

DEC HIGHLOW 10000F1C

DF4 HIGHLOW 10000F10

DFC HIGHLOW 10000F04

E04 HIGHLOW 10000EF4

E0C HIGHLOW 10000EEC

E14 HIGHLOW 10000EE0

E1C HIGHLOW 10000ED4

E24 HIGHLOW 10000EC4

E2C HIGHLOW 10000EAC

E34 HIGHLOW 10000E94

E3C HIGHLOW 10000E7C

E44 HIGHLOW 10000E60

0 ABS

1000 RVA, 10 SizeOfBlock

130 HIGHLOW 100002CA

138 HIGHLOW 10001120

13C HIGHLOW 10001130

0 ABS

BR
Sean


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Wanadoo vous informe que cet e-mail a ete controle par l’anti-virus mail.
Aucun virus connu a ce jour par nos services n’a ete detecte.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Orange vous informe que cet e-mail a été contrôlé par l’anti-virus mail.
Aucun virus connu à ce jour par nos services n’a été détecté.