summaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2005-04-15 09:33:04 +0000
committerRoland McGrath <roland@gnu.org>2005-04-15 09:33:04 +0000
commit6183d906dd822337dec18dd1f48209dfd17127bd (patch)
tree23fe554ffcdecf0ae3b5879155c28b17766ea441 /elf
parenta19fc30a4be27a24065b9a53b98042b73ff51b69 (diff)
Updated to fedora-glibc-20050415T0909cvs/fedora-glibc-2_3_5-1
Diffstat (limited to 'elf')
-rw-r--r--elf/cache.c4
-rw-r--r--elf/dl-load.c5
-rw-r--r--elf/dl-support.c6
-rw-r--r--elf/ldconfig.c80
-rw-r--r--elf/rtld.c198
-rw-r--r--elf/tls-macros.h68
-rw-r--r--elf/tst-auditmod1.c12
7 files changed, 262 insertions, 111 deletions
diff --git a/elf/cache.c b/elf/cache.c
index 22ad55c612..9324f3dc6c 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003
+/* Copyright (C) 1999,2000,2001,2002,2003,2005
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999.
@@ -99,7 +99,7 @@ print_entry (const char *lib, int flag, unsigned int osversion,
break;
}
if (hwcap != 0)
- printf (", hwcap: 0x%" PRIx64, hwcap);
+ printf (", hwcap: %#.16" PRIx64, hwcap);
if (osversion != 0)
{
static const char *const abi_tag_os[] =
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 2ca108ef69..d8b3a56d0d 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1760,6 +1760,11 @@ open_path (const char *name, size_t namelen, int preloaded,
const char *current_what = NULL;
int any = 0;
+ if (__builtin_expect (dirs == NULL, 0))
+ /* We're called before _dl_init_paths when loading the main executable
+ given on the command line when rtld is run directly. */
+ return -1;
+
buf = alloca (max_dirnamelen + max_capstrlen + namelen);
do
{
diff --git a/elf/dl-support.c b/elf/dl-support.c
index cfe01babbf..d20e9a4048 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -1,5 +1,5 @@
/* Support for dynamic linking code in static libc.
- Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1996-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -121,7 +121,7 @@ int _dl_correct_cache_id = _DL_CACHE_DEFAULT_ID;
ElfW(Phdr) *_dl_phdr;
size_t _dl_phnum;
-unsigned long int _dl_hwcap __attribute__ ((nocommon));
+uint64_t _dl_hwcap __attribute__ ((nocommon));
/* Prevailing state of the stack, PF_X indicating it's executable. */
ElfW(Word) _dl_stack_flags = PF_R|PF_W|PF_X;
@@ -179,7 +179,7 @@ _dl_aux_init (ElfW(auxv_t) *av)
GL(dl_phnum) = av->a_un.a_val;
break;
case AT_HWCAP:
- GLRO(dl_hwcap) = av->a_un.a_val;
+ GLRO(dl_hwcap) = (unsigned long int) av->a_un.a_val;
break;
#ifdef NEED_DL_SYSINFO
case AT_SYSINFO:
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 70f3a8f402..d96295cbc1 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -44,6 +44,12 @@
#include "dl-procinfo.h"
+#ifdef _DL_FIRST_PLATFORM
+# define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT)
+#else
+# define _DL_FIRST_EXTRA _DL_HWCAP_COUNT
+#endif
+
#ifndef LD_SO_CONF
# define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
#endif
@@ -115,6 +121,9 @@ static const char *config_file;
/* Mask to use for important hardware capabilities. */
static unsigned long int hwcap_mask = HWCAP_IMPORTANT;
+/* Configuration-defined capabilities defined in kernel vDSOs. */
+static const char *hwcap_extra[64 - _DL_FIRST_EXTRA];
+
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
void (*argp_program_version_hook) (FILE *, struct argp_state *)
@@ -165,10 +174,10 @@ is_hwcap_platform (const char *name)
if (hwcap_idx != -1)
return 1;
-#ifdef USE_TLS
- if (strcmp (name, "tls") == 0)
- return 1;
-#endif
+ for (hwcap_idx = _DL_FIRST_EXTRA; hwcap_idx < 64; ++hwcap_idx)
+ if (hwcap_extra[hwcap_idx - _DL_FIRST_EXTRA] != NULL
+ && !strcmp (name, hwcap_extra[hwcap_idx - _DL_FIRST_EXTRA]))
+ return 1;
return 0;
}
@@ -203,11 +212,11 @@ path_hwcap (const char *path)
h = _dl_string_platform (ptr + 1);
if (h == (uint64_t) -1)
{
-#ifdef USE_TLS
- if (strcmp (ptr + 1, "tls") == 0)
- h = 63;
- else
-#endif
+ for (h = _DL_FIRST_EXTRA; h < 64; ++h)
+ if (hwcap_extra[h - _DL_FIRST_EXTRA] != NULL
+ && !strcmp (ptr + 1, hwcap_extra[h - _DL_FIRST_EXTRA]))
+ break;
+ if (h == 64)
break;
}
}
@@ -636,7 +645,7 @@ search_dir (const struct dir_entry *entry)
if (opt_verbose)
{
if (hwcap != 0)
- printf ("%s: (hwcap: 0x%" PRIx64 ")\n", entry->path, hwcap);
+ printf ("%s: (hwcap: %#.16" PRIx64 ")\n", entry->path, hwcap);
else
printf ("%s:\n", entry->path);
}
@@ -1026,6 +1035,53 @@ parse_conf (const char *filename, const char *prefix, bool do_chroot)
memcpy (mempcpy (new_cp, prefix, prefix_len), cp, cp_len + 1);
add_dir (new_cp);
}
+ else if (!strncasecmp (cp, "hwcap", 5) && isblank (cp[5]))
+ {
+ cp += 6;
+ char *p, *name = NULL;
+ unsigned long int n = strtoul (cp, &cp, 0);
+ if (cp != NULL && isblank (*cp))
+ while ((p = strsep (&cp, " \t")) != NULL)
+ if (p[0] != '\0')
+ {
+ if (name == NULL)
+ name = p;
+ else
+ {
+ name = NULL;
+ break;
+ }
+ }
+ if (name == NULL)
+ {
+ error (EXIT_FAILURE, 0, _("%s:%u: bad syntax in hwcap line"),
+ filename, lineno);
+ break;
+ }
+ if (n >= (64 - _DL_FIRST_EXTRA))
+ error (EXIT_FAILURE, 0,
+ _("%s:%u: hwcap index %lu above maximum %u"),
+ filename, lineno, n, 64 - _DL_FIRST_EXTRA - 1);
+ if (hwcap_extra[n] == NULL)
+ {
+ for (unsigned long int h = 0; h < (64 - _DL_FIRST_EXTRA); ++h)
+ if (hwcap_extra[h] != NULL && !strcmp (name, hwcap_extra[h]))
+ error (EXIT_FAILURE, 0,
+ _("%s:%u: hwcap index %lu already defined as %s"),
+ filename, lineno, h, name);
+ hwcap_extra[n] = xstrdup (name);
+ }
+ else
+ {
+ if (strcmp (name, hwcap_extra[n]))
+ error (EXIT_FAILURE, 0,
+ _("%s:%u: hwcap index %lu already defined as %s"),
+ filename, lineno, n, hwcap_extra[n]);
+ if (opt_verbose)
+ error (0, 0, _("%s:%u: duplicate hwcap %lu %s"),
+ filename, lineno, n, name);
+ }
+ }
else
add_dir (cp);
}
@@ -1129,6 +1185,10 @@ main (int argc, char **argv)
add_dir (argv[i]);
}
+#ifdef USE_TLS
+ hwcap_extra[63 - _DL_FIRST_EXTRA] = "tls";
+#endif
+
set_hwcap ();
if (opt_chroot)
diff --git a/elf/rtld.c b/elf/rtld.c
index b2122bb9d6..5d64d5a99e 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -958,11 +958,6 @@ of this helper program; chances are you did not intend to run this program.\n\
--_dl_argc;
++INTUSE(_dl_argv);
- /* Initialize the data structures for the search paths for shared
- objects. */
- _dl_init_paths (library_path);
-
-
/* The initialization of _dl_stack_flags done below assumes the
executable's PT_GNU_STACK may have been honored by the kernel, and
so a PT_GNU_STACK with PF_X set means the stack started out with
@@ -1229,10 +1224,98 @@ ld.so does not support TLS, but program uses it!\n");
_exit (has_interp ? 0 : 2);
}
- if (! rtld_is_main)
- /* Initialize the data structures for the search paths for shared
- objects. */
- _dl_init_paths (library_path);
+ struct link_map **first_preload = &GL(dl_rtld_map).l_next;
+#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+ /* Set up the data structures for the system-supplied DSO early,
+ so they can influence _dl_init_paths. */
+ if (GLRO(dl_sysinfo_dso) != NULL)
+ {
+ /* Do an abridged version of the work _dl_map_object_from_fd would do
+ to map in the object. It's already mapped and prelinked (and
+ better be, since it's read-only and so we couldn't relocate it).
+ We just want our data structures to describe it as if we had just
+ mapped and relocated it normally. */
+ struct link_map *l = _dl_new_object ((char *) "", "", lt_library, NULL,
+ 0, LM_ID_BASE);
+ if (__builtin_expect (l != NULL, 1))
+ {
+ static ElfW(Dyn) dyn_temp[DL_RO_DYN_TEMP_CNT] attribute_relro;
+
+ l->l_phdr = ((const void *) GLRO(dl_sysinfo_dso)
+ + GLRO(dl_sysinfo_dso)->e_phoff);
+ l->l_phnum = GLRO(dl_sysinfo_dso)->e_phnum;
+ for (uint_fast16_t i = 0; i < l->l_phnum; ++i)
+ {
+ const ElfW(Phdr) *const ph = &l->l_phdr[i];
+ if (ph->p_type == PT_DYNAMIC)
+ {
+ l->l_ld = (void *) ph->p_vaddr;
+ l->l_ldnum = ph->p_memsz / sizeof (ElfW(Dyn));
+ }
+ else if (ph->p_type == PT_LOAD)
+ {
+ if (! l->l_addr)
+ l->l_addr = ph->p_vaddr;
+ if (ph->p_vaddr + ph->p_memsz >= l->l_map_end)
+ l->l_map_end = ph->p_vaddr + ph->p_memsz;
+ if ((ph->p_flags & PF_X)
+ && ph->p_vaddr + ph->p_memsz >= l->l_text_end)
+ l->l_text_end = ph->p_vaddr + ph->p_memsz;
+ }
+ else
+ /* There must be no TLS segment. */
+ assert (ph->p_type != PT_TLS);
+ }
+ l->l_map_start = (ElfW(Addr)) GLRO(dl_sysinfo_dso);
+ l->l_addr = l->l_map_start - l->l_addr;
+ l->l_map_end += l->l_addr;
+ l->l_text_end += l->l_addr;
+ l->l_ld = (void *) ((ElfW(Addr)) l->l_ld + l->l_addr);
+ elf_get_dynamic_info (l, dyn_temp);
+ _dl_setup_hash (l);
+ l->l_relocated = 1;
+
+ /* Now that we have the info handy, use the DSO image's soname
+ so this object can be looked up by name. Note that we do not
+ set l_name here. That field gives the file name of the DSO,
+ and this DSO is not associated with any file. */
+ if (l->l_info[DT_SONAME] != NULL)
+ {
+ /* Work around a kernel problem. The kernel cannot handle
+ addresses in the vsyscall DSO pages in writev() calls. */
+ const char *dsoname = ((char *) D_PTR (l, l_info[DT_STRTAB])
+ + l->l_info[DT_SONAME]->d_un.d_val);
+ size_t len = strlen (dsoname);
+ char *copy = malloc (len);
+ if (copy == NULL)
+ _dl_fatal_printf ("out of memory\n");
+ l->l_libname->name = memcpy (copy, dsoname, len);
+ }
+
+ /* Rearrange the list so this DSO appears after rtld_map. */
+ assert (l->l_next == NULL);
+ assert (l->l_prev == main_map);
+ GL(dl_rtld_map).l_next = l;
+ l->l_prev = &GL(dl_rtld_map);
+ first_preload = &l->l_next;
+
+ /* We have a prelinked DSO preloaded by the system. */
+ GLRO(dl_sysinfo_map) = l;
+# ifdef NEED_DL_SYSINFO
+ if (GLRO(dl_sysinfo) == DL_SYSINFO_DEFAULT)
+ GLRO(dl_sysinfo) = GLRO(dl_sysinfo_dso)->e_entry + l->l_addr;
+# endif
+ }
+ }
+#endif
+
+#ifdef DL_SYSDEP_OSCHECK
+ DL_SYSDEP_OSCHECK (dl_fatal);
+#endif
+
+ /* Initialize the data structures for the search paths for shared
+ objects. */
+ _dl_init_paths (library_path);
/* Initialize _r_debug. */
struct r_debug *r = _dl_debug_initialize (GL(dl_rtld_map).l_addr,
@@ -1524,7 +1607,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
/* We have two ways to specify objects to preload: via environment
variable and via the file /etc/ld.so.preload. The latter can also
be used when security is enabled. */
- assert (GL(dl_rtld_map).l_next == NULL);
+ assert (*first_preload == NULL);
struct link_map **preloads = NULL;
unsigned int npreloads = 0;
@@ -1657,9 +1740,9 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
struct stat test_st;
int test_fd;
int can_load;
-
+
HP_TIMING_NOW (start);
-
+
/* _dl_sysdep_message("Loading compatibility library... ", NULL); */
can_load = 1;
@@ -1673,7 +1756,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
/* _dl_sysdep_message(" Can't stat " LIB_NOVERSION "\n", NULL); */
}
}
-
+
if (test_fd >= 0) /* open did no fail.. */
__close(test_fd); /* avoid fd leaks */
@@ -1687,12 +1770,11 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
}
#endif
- if (__builtin_expect (GL(dl_rtld_map).l_next != NULL, 0))
+ if (__builtin_expect (*first_preload != NULL, 0))
{
/* Set up PRELOADS with a vector of the preloaded libraries. */
- struct link_map *l;
+ struct link_map *l = *first_preload;
preloads = __alloca (npreloads * sizeof preloads[0]);
- l = GL(dl_rtld_map).l_next; /* End of the chain before preloads. */
i = 0;
do
{
@@ -1702,82 +1784,6 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
assert (i == npreloads);
}
-#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
- struct link_map *sysinfo_map = NULL;
- if (GLRO(dl_sysinfo_dso) != NULL)
- {
- /* Do an abridged version of the work _dl_map_object_from_fd would do
- to map in the object. It's already mapped and prelinked (and
- better be, since it's read-only and so we couldn't relocate it).
- We just want our data structures to describe it as if we had just
- mapped and relocated it normally. */
- struct link_map *l = _dl_new_object ((char *) "", "", lt_library, NULL,
- 0, LM_ID_BASE);
- if (__builtin_expect (l != NULL, 1))
- {
- static ElfW(Dyn) dyn_temp[DL_RO_DYN_TEMP_CNT] attribute_relro;
-
- l->l_phdr = ((const void *) GLRO(dl_sysinfo_dso)
- + GLRO(dl_sysinfo_dso)->e_phoff);
- l->l_phnum = GLRO(dl_sysinfo_dso)->e_phnum;
- for (uint_fast16_t i = 0; i < l->l_phnum; ++i)
- {
- const ElfW(Phdr) *const ph = &l->l_phdr[i];
- if (ph->p_type == PT_DYNAMIC)
- {
- l->l_ld = (void *) ph->p_vaddr;
- l->l_ldnum = ph->p_memsz / sizeof (ElfW(Dyn));
- }
- else if (ph->p_type == PT_LOAD)
- {
- if (! l->l_addr)
- l->l_addr = ph->p_vaddr;
- if (ph->p_vaddr + ph->p_memsz >= l->l_map_end)
- l->l_map_end = ph->p_vaddr + ph->p_memsz;
- if ((ph->p_flags & PF_X)
- && ph->p_vaddr + ph->p_memsz >= l->l_text_end)
- l->l_text_end = ph->p_vaddr + ph->p_memsz;
- }
- else
- /* There must be no TLS segment. */
- assert (ph->p_type != PT_TLS);
- }
- l->l_map_start = (ElfW(Addr)) GLRO(dl_sysinfo_dso);
- l->l_addr = l->l_map_start - l->l_addr;
- l->l_map_end += l->l_addr;
- l->l_text_end += l->l_addr;
- l->l_ld = (void *) ((ElfW(Addr)) l->l_ld + l->l_addr);
- elf_get_dynamic_info (l, dyn_temp);
- _dl_setup_hash (l);
- l->l_relocated = 1;
-
- /* Now that we have the info handy, use the DSO image's soname
- so this object can be looked up by name. Note that we do not
- set l_name here. That field gives the file name of the DSO,
- and this DSO is not associated with any file. */
- if (l->l_info[DT_SONAME] != NULL)
- {
- /* Work around a kernel problem. The kernel cannot handle
- addresses in the vsyscall DSO pages in writev() calls. */
- const char *dsoname = ((char *) D_PTR (l, l_info[DT_STRTAB])
- + l->l_info[DT_SONAME]->d_un.d_val);
- size_t len = strlen (dsoname);
- char *copy = malloc (len);
- if (copy == NULL)
- _dl_fatal_printf ("out of memory\n");
- l->l_libname->name = memcpy (copy, dsoname, len);
- }
-
- /* We have a prelinked DSO preloaded by the system. */
- sysinfo_map = l;
-# ifdef NEED_DL_SYSINFO
- if (GLRO(dl_sysinfo) == DL_SYSINFO_DEFAULT)
- GLRO(dl_sysinfo) = GLRO(dl_sysinfo_dso)->e_entry + l->l_addr;
-# endif
- }
- }
-#endif
-
/* Load all the libraries specified by DT_NEEDED entries. If LD_PRELOAD
specified some libraries to load, these are inserted before the actual
dependencies in the executable's searchlist for symbol resolution. */
@@ -1822,10 +1828,10 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
? main_map->l_searchlist.r_list[i + 1]
: NULL);
#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
- if (sysinfo_map != NULL
- && GL(dl_rtld_map).l_prev->l_next == sysinfo_map
- && GL(dl_rtld_map).l_next != sysinfo_map)
- GL(dl_rtld_map).l_prev = sysinfo_map;
+ if (GLRO(dl_sysinfo_map) != NULL
+ && GL(dl_rtld_map).l_prev->l_next == GLRO(dl_sysinfo_map)
+ && GL(dl_rtld_map).l_next != GLRO(dl_sysinfo_map))
+ GL(dl_rtld_map).l_prev = GLRO(dl_sysinfo_map);
#endif
}
else
diff --git a/elf/tls-macros.h b/elf/tls-macros.h
index f734417149..0ae9e65dc0 100644
--- a/elf/tls-macros.h
+++ b/elf/tls-macros.h
@@ -441,6 +441,74 @@ register void *__gp __asm__("$29");
"o5", "o7", "cc"); \
__o0; })
+#elif defined __sparc__ && defined __arch64__
+
+# define TLS_LE(x) \
+ ({ int *__l; \
+ asm ("sethi %%tle_hix22(" #x "), %0" : "=r" (__l)); \
+ asm ("xor %1, %%tle_lox10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ asm ("add %%g7, %1, %0" : "=r" (__l) : "r" (__l)); \
+ __l; })
+
+# ifdef __PIC__
+# define TLS_LOAD_PIC \
+ ({ long pc, got; \
+ asm ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t" \
+ "rd %%pc, %0\n\t" \
+ "add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t" \
+ "add %1, %0, %1\n\t" \
+ : "=r" (pc), "=r" (got)); \
+ got; })
+# else
+# define TLS_LOAD_PIC \
+ ({ long got; \
+ asm (".hidden _GLOBAL_OFFSET_TABLE_\n\t" \
+ "sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t" \
+ "or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0" \
+ : "=r" (got)); \
+ got; })
+# endif
+
+# define TLS_IE(x) \
+ ({ int *__l; \
+ asm ("sethi %%tie_hi22(" #x "), %0" : "=r" (__l)); \
+ asm ("add %1, %%tie_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ asm ("ldx [%1 + %2], %0, %%tie_ldx(" #x ")" \
+ : "=r" (__l) : "r" (TLS_LOAD_PIC), "r" (__l)); \
+ asm ("add %%g7, %1, %0, %%tie_add(" #x ")" : "=r" (__l) : "r" (__l)); \
+ __l; })
+
+# define TLS_LD(x) \
+ ({ int *__l; register void *__o0 asm ("%o0"); \
+ long __o; \
+ asm ("sethi %%tldm_hi22(" #x "), %0" : "=r" (__l)); \
+ asm ("add %1, %%tldm_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ asm ("add %1, %2, %0, %%tldm_add(" #x ")" \
+ : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
+ asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
+ " nop" \
+ : "=r" (__o0) : "0" (__o0) \
+ : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
+ "o5", "o7", "cc"); \
+ asm ("sethi %%tldo_hix22(" #x "), %0" : "=r" (__o)); \
+ asm ("xor %1, %%tldo_lox10(" #x "), %0" : "=r" (__o) : "r" (__o)); \
+ asm ("add %1, %2, %0, %%tldo_add(" #x ")" : "=r" (__l) \
+ : "r" (__o0), "r" (__o)); \
+ __l; })
+
+# define TLS_GD(x) \
+ ({ int *__l; register void *__o0 asm ("%o0"); \
+ asm ("sethi %%tgd_hi22(" #x "), %0" : "=r" (__l)); \
+ asm ("add %1, %%tgd_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ asm ("add %1, %2, %0, %%tgd_add(" #x ")" \
+ : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
+ asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
+ " nop" \
+ : "=r" (__o0) : "0" (__o0) \
+ : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
+ "o5", "o7", "cc"); \
+ __o0; })
+
#elif defined __s390x__
# define TLS_LE(x) \
diff --git a/elf/tst-auditmod1.c b/elf/tst-auditmod1.c
index 3876822429..73d341d72b 100644
--- a/elf/tst-auditmod1.c
+++ b/elf/tst-auditmod1.c
@@ -180,6 +180,18 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
# define La_regs La_mips_64_regs
# define La_retval La_mips_64_retval
# define int_retval lrv_v0
+#elif defined __sparc__ && __WORDSIZE == 32
+# define pltenter la_sparc32_gnu_pltenter
+# define pltexit la_sparc32_gnu_pltexit
+# define La_regs La_sparc32_regs
+# define La_retval La_sparc32_retval
+# define int_retval lrv_reg[0]
+#elif defined __sparc__ && __WORDSIZE == 64
+# define pltenter la_sparc64_gnu_pltenter
+# define pltexit la_sparc64_gnu_pltexit
+# define La_regs La_sparc64_regs
+# define La_retval La_sparc64_retval
+# define int_retval lrv_reg[0]
#else
# error "architecture specific code needed"
#endif