link.exe equivalent to GNU ld -Ttext flag?

  • Thread starter Thread starter arild.fines
  • Start date Start date
A

arild.fines

ld, the GNU linker, has a flag -Ttext which lets you specify the
virtual address of the .text section in the resulting executable. Is it
somehow possible to achieve the same thing using VC++'s linker?
 
ld, the GNU linker, has a flag -Ttext which lets you specify the
virtual address of the .text section in the resulting executable. Is
it somehow possible to achieve the same thing using VC++'s linker?

/base:XXXXXXXX

-cd
 
/base doesn't appear to be doing the same thing. Specifying
/base:0x10000 with link.exe puts the .text section at 0x1000, making
the real address 0x11000(0x10000 + 0x1000). Using -Ttext 0x10000 leaves
the image base at the same location and gives you the value 0xFFC65536
for .text, which makes the real address 0x1000(0x400000 + 0xFFC65536 is
0x1000 since it's an unsigned 32 bit value).
 
Back
Top