Web lists-archives.org

Re: [Mingw-users] unresolved return address in dwarf2 FDE




Hi,

This is a testcase.

When we do
/mingw-dw2/bin/g++ -shared -shared-libgcc -Wl,-Map=testdll0.map -Wl,--image-base=
0x61000000 -o testdll0.dll testdll0.cpp -lstdc++_s 
/mingw-dw2/bin/g++ -shared -shared-libgcc -Wl,-Map=testdll.map -Wl,--image-base=
0x61010000 -o testdll1.dll testdll10.cpp testdll11.cpp -lstdc++_s 
/mingw-dw2/bin/g++ -mconsole -shared-libgcc -lstdc++_s -Wl,-Map=testmain.map -o 
testmain.exe testmain.cpp -L. -ltestdll0 -ltestdll1
./testmain.exe 

The outputs are:
exception thorwn in func2
exception thorwn in func11

But when we rebase testdll1 like this:
/cygdrive/c/Program\ Files/Microsoft\ Platform\ SDK/Bin/ReBase.Exe -b 0x61020000 
testdll1.dll
./testmain.exe 

The outputs are:
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
exception thorwn in func2
terminate called after throwing an instance of 'testexception'

--<test.h>---
#include <stdio.h>

class testexception
{
};

inline
void func11()
{
  try
    {
      throw  testexception();
    }
  catch( testexception& )
    {
      printf("exception thorwn in func11\n");
    }
}

void func12();
void func13();
void func2();
-------

--<testdll0.cpp>---
#include "test.h"

void func2()
{
  try
    {
      throw  testexception();
    }
  catch( testexception& )
    {
      printf("exception thorwn in func2\n");
    }
}
-------

--<testdll10.cpp>---
#include "test.h"

void func12()
{
	func11();
}
-------

--<testdll11.cpp>---
#include "test.h"

void func13()
{
	func11();
}
-------

--<testmain.cpp>---
#include "test.h"

int main()
{
	func2();
	func12();
}
-------



In message "RE: unresolved return address in dwarf2 FDE",
Danny Smith wrote...
 >
 >> 
 >> However, the pe-ld still emits a relocation entry for the 
 >> never resolved reference to 
 >> the symbol in the discarded section in eh_frame. So it will 
 >> cause a problem if the 
 >> executable .exe or .dll is relocated or rebased as the 
 >> reference becomes nonzero.
 >> 
 >Could you provide a small testcase, please?
 >Danny
 >

----
 Takashi Ono(HK Freak)
 mailto:t_ono@xxxxxxxxxxx or MHF00056@xxxxxxxxxxx
	(Personal Address, checked every morning/evening and holidays)
 mailto:t_ono@xxxxxxxxxxxxxxxx
	(Address for business, checked every working days)
 http://www.hkfreak.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users