]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - elf/dynamic-link.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / elf / dynamic-link.h
index 8d428e20d39943cfa1195d06423f0284a6ad190f..454b0e388c6da863b08bec7b8bf49da01c3f0a13 100644 (file)
@@ -1,5 +1,5 @@
 /* Inline functions for dynamic linking.
-   Copyright (C) 1995-2015 Free Software Foundation, Inc.
+   Copyright (C) 1995-2019 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
@@ -42,7 +42,7 @@
      && (__builtin_expect ((sym_map)->l_tls_offset != NO_TLS_OFFSET, 1)        \
         || _dl_try_allocate_static_tls (sym_map) == 0))
 
-int internal_function _dl_try_allocate_static_tls (struct link_map *map);
+int _dl_try_allocate_static_tls (struct link_map *map) attribute_hidden;
 
 #include <elf.h>
 
@@ -94,7 +94,7 @@ elf_machine_lazy_rel (struct link_map *map,
 
 #ifdef RESOLVE_MAP
 
-# ifdef RTLD_BOOTSTRAP
+# if defined RTLD_BOOTSTRAP || defined STATIC_PIE_BOOTSTRAP
 #  define ELF_DURING_STARTUP (1)
 # else
 #  define ELF_DURING_STARTUP (0)
@@ -135,16 +135,18 @@ elf_machine_lazy_rel (struct link_map *map,
                                                                              \
        if (ranges[0].start + ranges[0].size == (start + size))               \
          ranges[0].size -= size;                                             \
-       if (! ELF_DURING_STARTUP && ((do_lazy) || ranges[0].size == 0))       \
+       if (ELF_DURING_STARTUP                                                \
+           || (!(do_lazy)                                                    \
+               && (ranges[0].start + ranges[0].size) == start))              \
          {                                                                   \
-           ranges[1].start = start;                                          \
-           ranges[1].size = size;                                            \
-           ranges[1].lazy = (do_lazy);                                       \
+           /* Combine processing the sections.  */                           \
+           ranges[0].size += size;                                           \
          }                                                                   \
        else                                                                  \
          {                                                                   \
-           /* Combine processing the sections.  */                           \
-           ranges[0].size += size;                                           \
+           ranges[1].start = start;                                          \
+           ranges[1].size = size;                                            \
+           ranges[1].lazy = (do_lazy);                                       \
          }                                                                   \
       }                                                                              \
                                                                              \