[trans-mem,darwin] PR/52042 find tm_clone_table with PIE

Patrick Marlier patrick.marlier@gmail.com
Wed Feb 15 20:00:00 GMT 2012


Here the committed patch approved off-list by Mike Stump which fixed 
PR/52042.
Tested on darwin10/11 with x86_64.

PS: this is my first commit so I hope I get it right. Otherwise do not 
hesitate to yell at me.

Thanks.
--
Patrick.

2012-02-15  Iain Sandoe  <iains@gcc.gnu.org>
	    Patrick Marlier  <patrick.marlier@gmail.com>

	PR libitm/52042
	* config/darwin-crt-tm.c (getTMCloneTable): New function.
	(__doTMRegistrations): Call it.
	(__doTMdeRegistrations): Likewise.



On 02/07/2012 10:36 PM, Patrick Marlier wrote:
> Hi,
>
> The problem in this PR is that with PIE, getsectdata does not return the
> position of tm_clone_table after the relocation.
> While _dyld_get_image_vmaddr_slide(0) is enough for PIE, this is not
> enough for dylib.
> I did not find an easy API function to get position of the
> tm_clone_table for a shared library (dylib). So the only way I found is
> to get the mach_header address of the current dylib (via
> _dyld_get_image_header_containing_address), iterate over loaded binaries
> to find the current shared library and use _dyld_get_image_vmaddr_slide
> to find the position.
> Any other proposal (my knowledge of darwin is really limited)?
>
> Can someone do a bootstrap and test libitm on darwin (I have a limited
> access to a darwin machine, at least libitm tests pass)? Thanks!
>
> If tests passed, ok for 4.7?
> --
> Patrick Marlier.
> libgcc:
>
> PR libitm/52042
> * config/darwin-crt-tm.c: Changes for PIE and shared library.
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: darwin-pie-final.patch
Type: text/x-patch
Size: 3276 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120215/ea5409e0/attachment.bin>


More information about the Gcc-patches mailing list