[RFC] Making .eh_frame more linker-friendly


I recently encountered a situation related to this. I think the issue is more severe than Rui Ueyama has found. The test case is in Plumhall_lvs15a-LVS051/src/lvs15a/conform/t279.dir. The main module has std::ios_base::clear(std::_Iosb::_Iostate, bool) and the linked library iostream.o(libstdc++11.a) has function with same name too. These two functions have minor difference due to optimization at different build time. So, the .text, .eh_frame and .gcc_except_table are not the same. Although there is only one copy of function std::ios_base::clear(std::_Iosb::_Iostate, bool), the one in iostream.o has been discarded after linking, but there are two copies of .eh_frame and .gcc_except_table for std::ios_base::clear(std::_Iosb::_Iostate, bool) in the executable. At run time, the wrong .eh_frame and .gcc_except_table are used to handle exception and then core dump happens.


Eric Tsai