This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libffi] Use datarel encoding in libffi .eh_frame on Solaris 2/x86


On 11/26/2010 10:45 AM, Rainer Orth wrote:
> 	* src/x86/sysv.S (.eh_frame) [__PIC__ && __sun__ && __svr4__]: Use
> 	datarel encoding.
> 	(.LASFDE1) [__PIC__ && __sun__ && __svr4__]: Use @GOTOFF for FDE
> 	initial location.
> 	(.LASFDE2, LASFDE3): Likewise.

This is getting complex enough that I think we should not 
replicate this logic 4 times.  Would you please pull this
out into a set of macros near the top of the file?  E.g.

#if defined __PIC__
# if defined __sun__ && defined __svr4__
#  define FDE_ENCODING		0x30	/* datarel */
#  define FDE_ENCODE(X)		X@GOTOFF
# else
#  define FDE_ENCODING		0x1b	/* pcrel sdata4 */
#  if defined HAVE_AS_X86_PCREL
#   define FDE_ENCODE(X)	X-.
#  else
#   define FDE_ENCODE(X)	X@rel
#  endif
# endif
#else
# define FDE_ENCODING		0	/* absolute */
# define FDE_ENCODE(X)		X
#endif

And, frankly, for gcc 4.7 we ought to consider requiring a
recent version of binutils and scrap all of this explicit
unwind info in favor of CFI directives.



r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]