aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>1998-06-27 15:14:39 +0000
committerRichard Henderson <rth@redhat.com>1998-06-27 15:14:39 +0000
commitb7e6f7bf5794c24be2688c6cde00c4bc32424005 (patch)
tree1ed67ab190bde6ff34cfcdf6c3b9fe74265a6fcc /sysdeps
parent08a76323ac94fa6f42962427527f10ab96b3f5ec (diff)
downloadglibc-b7e6f7bf5794c24be2688c6cde00c4bc32424005.tar
glibc-b7e6f7bf5794c24be2688c6cde00c4bc32424005.tar.gz
glibc-b7e6f7bf5794c24be2688c6cde00c4bc32424005.tar.bz2
glibc-b7e6f7bf5794c24be2688c6cde00c4bc32424005.zip
Cleanup weak_extern usage for _dl_hwcap and _dl_hwcap_mask.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/sparc/sparc32/dl-machine.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h
index f08eb0381a..5371e3ecee 100644
--- a/sysdeps/sparc/sparc32/dl-machine.h
+++ b/sysdeps/sparc/sparc32/dl-machine.h
@@ -32,12 +32,6 @@
#define OPCODE_JMP_G1 0x81c06000 /* jmp %g1+?; add lo 10 bits of value */
#define OPCODE_SAVE_SP 0x9de3bfa8 /* save %sp, -(16+6)*4, %sp */
-
-/* To allow static progies to link properly, define these as weak. */
-weak_extern(_dl_hwcap);
-weak_extern(_dl_hwcap_mask);
-
-
/* Protect some broken versions of gcc from misinterpreting weak addresses. */
#define WEAKADDR(x) ({ __typeof(x) *_px = &x; \
__asm ("" : "=r" (_px) : "0" (_px)); \
@@ -58,7 +52,11 @@ elf_machine_matches_host (Elf32_Half e_machine)
return 1;
else if (e_machine == EM_SPARC32PLUS)
{
- unsigned long *hwcap = WEAKADDR(_dl_hwcap);
+ unsigned long *hwcap;
+ weak_extern (_dl_hwcap);
+ weak_extern (_dl_hwcap_mask);
+
+ hwcap = WEAKADDR(_dl_hwcap);
return hwcap && (*hwcap & _dl_hwcap_mask & HWCAP_SPARC_V9);
}
else
@@ -268,8 +266,11 @@ elf_machine_fixup_plt (struct link_map *map, const Elf32_Rela *reloc,
#ifndef RTLD_BOOTSTRAP
/* Note that we don't mask the hwcap here, as the flush is essential to
functionality on those cpu's that implement it. */
- unsigned long *hwcap = WEAKADDR(_dl_hwcap);
- int do_flush = (!hwcap || (*hwcap & HWCAP_SPARC_FLUSH));
+ unsigned long *hwcap;
+ int do_flush;
+ weak_extern (_dl_hwcap);
+ hwcap = WEAKADDR(_dl_hwcap);
+ do_flush = (!hwcap || (*hwcap & HWCAP_SPARC_FLUSH));
#else
/* Unfortunately, this is necessary, so that we can ensure
ld.so will not execute corrupt PLT entry instructions. */