This is the mail archive of the 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: enable n32 and n64, and move o32 into mips/mips32

> Another problem I've run into is the declarations of elf_machine_rel
> et al in dynamic-link.h.  In 2.3.1, they didn't exist, so the patch I
> wrote to change the reloc_addr argument to void* worked fine.  In
> mainline, the declarations prevent elf_machine_reloc in
> sysdeps/mips/dl-machine.h from compiling.  I don't see a clean
> solution to this issue, other than taking the declarations back out,
> or making two versions of the declarations available, one for
> platforms that want reloc_addr as a ElfW(Addr)*, one for those that
> want it as a void*.  Thoughts?

I don't see a problem with that argument type varying among ports.  You
could use a dl-machine.h macro for the type I suppose.  I also don't see a
harm in changing all the ports to make it void * or even just the original
ElfW(Addr) and cast it in each use.

OTOH, the only reason I think those prototypes were added to dynamic-link.h
was to give them all __attribute__((always_inline)) in one place rather
than each dl-machine.h needing to take care of that.  

I tried this patch and it seems to be ok.  (I don't know how to tell if the
compiler is really recording the always_inline attribute since it doesn't
fail to inline those functions anyway.)  With this, dl-machine.h can use a
different argument type and it should not matter.

--- dynamic-link.h.~1.46.~	Tue Feb 25 16:20:10 2003
+++ dynamic-link.h	Fri Mar 28 22:59:10 2003
@@ -20,34 +20,23 @@
 #include <elf.h>
 #include <assert.h>
+#include <dl-machine.h>
 #ifdef RESOLVE
-auto void __attribute__((always_inline))
-elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
-		 const ElfW(Sym) *sym, const struct r_found_version *version,
-		 ElfW(Addr) *const reloc_addr);
-auto void __attribute__((always_inline))
-elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
-		  const ElfW(Sym) *sym, const struct r_found_version *version,
-		  ElfW(Addr) *const reloc_addr);
-auto void __attribute__((always_inline))
-elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
-			  ElfW(Addr) *const reloc_addr);
-auto void __attribute__((always_inline))
-elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
-			   ElfW(Addr) *const reloc_addr);
-auto void __attribute__((always_inline))
-elf_machine_lazy_rel (struct link_map *map,
-		      ElfW(Addr) l_addr, const ElfW(Rel) *reloc);
-# else
-auto void __attribute__((always_inline))
-elf_machine_lazy_rel (struct link_map *map,
-		      ElfW(Addr) l_addr, const ElfW(Rela) *reloc);
+# define ALWAYS_INLINE(fn) \
+    static __typeof (fn) fn __attribute__ ((always_inline))
+ALWAYS_INLINE (elf_machine_lazy_rel);
+ALWAYS_INLINE (elf_machine_rel);
+ALWAYS_INLINE (elf_machine_rel_relative);
+# endif
+ALWAYS_INLINE (elf_machine_rela);
+ALWAYS_INLINE (elf_machine_rela_relative);
 # endif
-#include <dl-machine.h>
 #ifndef VERSYMIDX

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