]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Make sure the variable `reloc' is really kept as a variable.
authorUlrich Drepper <drepper@redhat.com>
Fri, 30 Jan 1998 16:54:27 +0000 (16:54 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 30 Jan 1998 16:54:27 +0000 (16:54 +0000)
elf/dl-open.c

index fe9f8ff017cec85e312a395b56b01d72ca909d71..86b9c2267362df229bfb693b904de8f87ce1e5ce 100644 (file)
@@ -1,5 +1,5 @@
 /* Load a shared object at runtime, relocate it, and run its initializer.
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1998 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
@@ -73,6 +73,13 @@ _dl_open (const char *file, int mode)
             between when _dl_object_relocation_scope returns and when we
             enter the dynamic linker's code (_dl_relocate_object).  */
          __typeof (_dl_relocate_object) *reloc = &_dl_relocate_object;
+
+         /* GCC is very clever.  If we wouldn't add some magic it would
+            simply optimize away our nice little variable `reloc' and we
+            would result in a not working binary.  So let's swing the
+            magic ward.  */
+         asm ("" : "=r" (reloc) : "0" (reloc));
+
          (*reloc) (l, _dl_object_relocation_scope (l),
                    (mode & RTLD_BINDING_MASK) == RTLD_LAZY);
          *_dl_global_scope_end = NULL;