Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Code Generation/Optimization    [ Add a report in this area ]  
Report #:  105284   Status: Open
[x64] 64 bit EXE file has relocations stripped
Project:  Delphi Build #:  16.0.4429.46931
Version:    16.4 Submitted By:   Peter Tattam
Report Type:  Crash / Data loss / Total failure Date Reported:  4/30/2012 7:53:05 AM
Severity:    Critical / Show Stopper Last Updated: 5/16/2012 11:58:41 PM
Platform:    All versions Internal Tracking #:   28237
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
[x64]
When building a kernel mode application or device driver with stub system.dcu, EXE is linked such the base address as fixed, and relocations are stripped.
This makes it impossible to load the executable as a relocatable device driver, or to rebase the executable in the case of it being a kernel image.

tdump output shows exe with PE flags as "fixed" and data directory fixups are RVA=00000000, Size=00000000
Steps to Reproduce:
compile the following...  then run tdump on it.

=== test application ========================
program x64_stub;

{$APPTYPE CONSOLE}

begin
end.

=== tdump output =====================

Display of File x64_stub.exe

Old Executable Header

DOS File Size                                      2FF09h  (196361. )
Load Image Size                                      210h  (   528. )
Relocation Table entry count                          0000h  (     0. )
Relocation Table address                              0040h  (    64. )
Size of header record      (in paragraphs)            0004h  (     4. )
Minimum Memory Requirement (in paragraphs)            000Fh  (    15. )
Maximum Memory Requirement (in paragraphs)            FFFFh  ( 65535. )
File load checksum                                    0000h  (     0. )
Overlay Number                                        001Ah  (    26. )

Initial Stack Segment  (SS:SP)                    0000:00B8
Program Entry Point    (CS:IP)                    0000:0000


Portable Executable (PE) File

Header base: 00000100

CPU type                 AMD64
Flags                    23 [ fixed executable linenumbers symbols largeaddr ba
kwards ]
DLL flags                0000 [ ]
Linker Version           8.0
Time stamp               4F9E976D : Tue May  1 00:45:17 2012
O/S Version              5.2
User Version             5.2
Subsystem Version        5.2
Subsystem                0003 [ Windows character ]
Object count             00000009
Symbols offset           00000000
Symbols count            00000000
Optional header size     00F0
Magic #                  20B
Code size                00009200
Init Data size           00026909
Uninit Data size         00000000
Entry RVA                0000A0F0
Image base               0000000000400000
Code base                00001000
Object/File align        00001000/00000200
Reserved                 00000000
Image size               0003B000
Header size              00000400
Checksum                 00000000
Stack reserve/commit     0000000000100000/0000000000004000
Heap reserve/commit      0000000000100000/0000000000002000
Number interesting RVAs  00000010
Name                   RVA       Size
------------------  --------  --------
Exports             00000000  00000000
Imports             00012000  00000632
Resources           00016000  00000200
Exceptions          00015000  00000A68
Security            00000000  00000000
Fixups              00000000  00000000
Debug               00017000  00000001
Description         00000000  00000000
Global Ptr          00000000  00000000
TLS                 00014000  00000028
Callbacks           00000000  00000000
Bound Imports       00000000  00000000
Import Addr Table   000121D8  00000170
Delayed Imports     00000000  00000000
COM Runtime         00000000  00000000
reserved            00000000  00000000

.......
Workarounds
none.
Attachment
None
Comments

Tomohiro Takahashi at 5/17/2012 7:28:23 PM -
This report was opened with valid Internal Tracking Number.
Thanks.

Server Response from: ETNACODE01