return 0;
 }
 
-static void relaswap(void *_x, void *_y, int size)
-{
-       uint32_t *x, *y, tmp;
-       int i;
-
-       y = (uint32_t *)_x;
-       x = (uint32_t *)_y;
-
-       for (i = 0; i < sizeof(Elf32_Rela) / sizeof(uint32_t); i++) {
-               tmp = x[i];
-               x[i] = y[i];
-               y[i] = tmp;
-       }
-}
-
 /* Get the potential trampolines size required of the init and
    non-init sections */
 static unsigned long get_plt_size(const Elf32_Ehdr *hdr,
                         */
                        sort((void *)hdr + sechdrs[i].sh_offset,
                             sechdrs[i].sh_size / sizeof(Elf32_Rela),
-                            sizeof(Elf32_Rela), relacmp, relaswap);
+                            sizeof(Elf32_Rela), relacmp, NULL);
 
                        ret += count_relocs((void *)hdr
                                             + sechdrs[i].sh_offset,
 
                return 0;
 }
 
-static void relaswap(void *_x, void *_y, int size)
-{
-       uint64_t *x, *y, tmp;
-       int i;
-
-       y = (uint64_t *)_x;
-       x = (uint64_t *)_y;
-
-       for (i = 0; i < sizeof(Elf64_Rela) / sizeof(uint64_t); i++) {
-               tmp = x[i];
-               x[i] = y[i];
-               y[i] = tmp;
-       }
-}
-
 /* Get size of potential trampolines required. */
 static unsigned long get_stubs_size(const Elf64_Ehdr *hdr,
                                    const Elf64_Shdr *sechdrs)
                         */
                        sort((void *)sechdrs[i].sh_addr,
                             sechdrs[i].sh_size / sizeof(Elf64_Rela),
-                            sizeof(Elf64_Rela), relacmp, relaswap);
+                            sizeof(Elf64_Rela), relacmp, NULL);
 
                        relocs += count_relocs((void *)sechdrs[i].sh_addr,
                                               sechdrs[i].sh_size