This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: PATCH: Add x32 support to dynamic linker audit


On Thu, Mar 22, 2012 at 10:05 AM, Roland McGrath <roland@hack.frob.com> wrote:
> I think it is nasty to have the declaration use a type different from the
> real type, though the only obvious practical problem is the debug info
> being wrong. ?If the La_x32_* names are macro aliases for La_x86_64_*, why
> not have those macros defined everywhere those names are used?
>
>

Something like this?


diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 9955430..60aa600 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -187,8 +187,6 @@ struct La_i86_regs;
 struct La_i86_retval;
 struct La_x86_64_regs;
 struct La_x86_64_retval;
-struct La_x32_regs;
-struct La_x32_retval;
 struct La_ppc32_regs;
 struct La_ppc32_retval;
 struct La_ppc64_regs;
@@ -204,6 +202,13 @@ struct La_sparc32_retval;
 struct La_sparc64_regs;
 struct La_sparc64_retval;

+#ifndef La_x32_regs
+# define La_x32_regs La_x86_64_regs
+#endif
+#ifndef La_x32_retval
+# define La_x32_retval La_x86_64_retval
+#endif
+
 struct audit_ifaces
 {
   void (*activity) (uintptr_t *, unsigned int);
diff --git a/sysdeps/x86_64/bits/link.h b/sysdeps/x86_64/bits/link.h
index fa20910..90811c7 100644
--- a/sysdeps/x86_64/bits/link.h
+++ b/sysdeps/x86_64/bits/link.h
@@ -105,8 +105,12 @@ typedef struct La_x86_64_retval
   La_x86_64_vector lrv_vector1;
 } La_x86_64_retval;

-#define La_x32_regs La_x86_64_regs
-#define La_x32_retval La_x86_64_retval
+#ifndef La_x32_regs
+# define La_x32_regs La_x86_64_regs
+#endif
+#ifndef La_x32_retval
+# define La_x32_retval La_x86_64_retval
+#endif

 __BEGIN_DECLS


-- 
H.J.


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