mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
Remove -z combreloc and HAVE_Z_COMBRELOC
-z combreloc has been the default regadless of the architecture since binutils commit f4d733664aabd7bd78c82895e030ec9779a92809 (2002). The configure check added in commitfdde83499a
(2001) has long been unneeded. We can therefore treat HAVE_Z_COMBRELOC as always 1 and delete dead code paths in dl-machine.h files (many were copied from commita711b01d34
andee0cb67ec2
). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
10
Makeconfig
10
Makeconfig
@@ -358,12 +358,6 @@ else
|
|||||||
real-static-start-installed-name = $(static-start-installed-name)
|
real-static-start-installed-name = $(static-start-installed-name)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq (yesyes,$(build-shared)$(have-z-combreloc))
|
|
||||||
combreloc-LDFLAGS = -Wl,-z,combreloc
|
|
||||||
LDFLAGS.so += $(combreloc-LDFLAGS)
|
|
||||||
LDFLAGS-rtld += $(combreloc-LDFLAGS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
relro-LDFLAGS = -Wl,-z,relro
|
relro-LDFLAGS = -Wl,-z,relro
|
||||||
LDFLAGS.so += $(relro-LDFLAGS)
|
LDFLAGS.so += $(relro-LDFLAGS)
|
||||||
LDFLAGS-rtld += $(relro-LDFLAGS)
|
LDFLAGS-rtld += $(relro-LDFLAGS)
|
||||||
@@ -421,7 +415,7 @@ ifndef +link-pie
|
|||||||
+link-pie-before-inputs = $(if $($(@F)-no-pie),$(no-pie-ldflag),-pie) \
|
+link-pie-before-inputs = $(if $($(@F)-no-pie),$(no-pie-ldflag),-pie) \
|
||||||
-Wl,-O1 -nostdlib -nostartfiles \
|
-Wl,-O1 -nostdlib -nostartfiles \
|
||||||
$(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
|
$(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
|
||||||
$(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
|
$(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
|
||||||
$(firstword $(CRT-$(@F)) $(csu-objpfx)S$(start-installed-name)) \
|
$(firstword $(CRT-$(@F)) $(csu-objpfx)S$(start-installed-name)) \
|
||||||
$(+preinit) $(+prectorS)
|
$(+preinit) $(+prectorS)
|
||||||
+link-pie-before-libc = -o $@ $(+link-pie-before-inputs) \
|
+link-pie-before-libc = -o $@ $(+link-pie-before-inputs) \
|
||||||
@@ -487,7 +481,7 @@ ifeq (yes,$(build-pie-default))
|
|||||||
else # not build-pie-default
|
else # not build-pie-default
|
||||||
+link-before-inputs = -nostdlib -nostartfiles $(no-pie-ldflag) \
|
+link-before-inputs = -nostdlib -nostartfiles $(no-pie-ldflag) \
|
||||||
$(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
|
$(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
|
||||||
$(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
|
$(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
|
||||||
$(firstword $(CRT-$(@F)) $(csu-objpfx)$(start-installed-name)) \
|
$(firstword $(CRT-$(@F)) $(csu-objpfx)$(start-installed-name)) \
|
||||||
$(+preinit) $(+prector)
|
$(+preinit) $(+prector)
|
||||||
+link-before-libc = -o $@ $(+link-before-inputs) \
|
+link-before-libc = -o $@ $(+link-before-inputs) \
|
||||||
|
@@ -56,9 +56,6 @@
|
|||||||
#undef STACK_PROTECTOR_LEVEL
|
#undef STACK_PROTECTOR_LEVEL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define if the linker supports the -z combreloc option. */
|
|
||||||
#undef HAVE_Z_COMBRELOC
|
|
||||||
|
|
||||||
/* Define if _rtld_local structure should be forced into .sdata section. */
|
/* Define if _rtld_local structure should be forced into .sdata section. */
|
||||||
#undef HAVE_SDATA_SECTION
|
#undef HAVE_SDATA_SECTION
|
||||||
|
|
||||||
|
@@ -53,7 +53,6 @@ c++-bits-std_abs-h = @CXX_BITS_STD_ABS_H@
|
|||||||
all-warnings = @all_warnings@
|
all-warnings = @all_warnings@
|
||||||
enable-werror = @enable_werror@
|
enable-werror = @enable_werror@
|
||||||
|
|
||||||
have-z-combreloc = @libc_cv_z_combreloc@
|
|
||||||
have-z-execstack = @libc_cv_z_execstack@
|
have-z-execstack = @libc_cv_z_execstack@
|
||||||
have-protected-data = @libc_cv_protected_data@
|
have-protected-data = @libc_cv_protected_data@
|
||||||
have-insert = @libc_cv_insert@
|
have-insert = @libc_cv_insert@
|
||||||
|
39
configure
vendored
39
configure
vendored
@@ -625,7 +625,6 @@ libc_cv_has_glob_dat
|
|||||||
libc_cv_hashstyle
|
libc_cv_hashstyle
|
||||||
libc_cv_fpie
|
libc_cv_fpie
|
||||||
libc_cv_z_execstack
|
libc_cv_z_execstack
|
||||||
libc_cv_z_combreloc
|
|
||||||
ASFLAGS_config
|
ASFLAGS_config
|
||||||
libc_cv_cc_with_libunwind
|
libc_cv_cc_with_libunwind
|
||||||
libc_cv_insert
|
libc_cv_insert
|
||||||
@@ -5967,44 +5966,6 @@ if test $libc_cv_as_noexecstack = yes; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -z combreloc" >&5
|
|
||||||
$as_echo_n "checking for -z combreloc... " >&6; }
|
|
||||||
if ${libc_cv_z_combreloc+:} false; then :
|
|
||||||
$as_echo_n "(cached) " >&6
|
|
||||||
else
|
|
||||||
cat > conftest.c <<EOF
|
|
||||||
extern int bar (int);
|
|
||||||
extern int mumble;
|
|
||||||
int foo (void) { return bar (mumble); }
|
|
||||||
EOF
|
|
||||||
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
|
||||||
-fPIC -shared $no_ssp -o conftest.so conftest.c
|
|
||||||
-nostdlib -nostartfiles
|
|
||||||
-Wl,-z,combreloc 1>&5'
|
|
||||||
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
|
|
||||||
(eval $ac_try) 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; }; }
|
|
||||||
then
|
|
||||||
if $READELF -S conftest.so | grep -E '.rela?.dyn' > /dev/null; then
|
|
||||||
libc_cv_z_combreloc=yes
|
|
||||||
else
|
|
||||||
libc_cv_z_combreloc=no
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
libc_cv_z_combreloc=no
|
|
||||||
fi
|
|
||||||
rm -f conftest*
|
|
||||||
fi
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_z_combreloc" >&5
|
|
||||||
$as_echo "$libc_cv_z_combreloc" >&6; }
|
|
||||||
if test "$libc_cv_z_combreloc" = yes; then
|
|
||||||
$as_echo "#define HAVE_Z_COMBRELOC 1" >>confdefs.h
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z execstack" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z execstack" >&5
|
||||||
$as_echo_n "checking for linker that supports -z execstack... " >&6; }
|
$as_echo_n "checking for linker that supports -z execstack... " >&6; }
|
||||||
libc_linker_feature=no
|
libc_linker_feature=no
|
||||||
|
31
configure.ac
31
configure.ac
@@ -1324,37 +1324,6 @@ if test $libc_cv_as_noexecstack = yes; then
|
|||||||
fi
|
fi
|
||||||
AC_SUBST(ASFLAGS_config)
|
AC_SUBST(ASFLAGS_config)
|
||||||
|
|
||||||
AC_CACHE_CHECK(for -z combreloc,
|
|
||||||
libc_cv_z_combreloc, [dnl
|
|
||||||
cat > conftest.c <<EOF
|
|
||||||
extern int bar (int);
|
|
||||||
extern int mumble;
|
|
||||||
int foo (void) { return bar (mumble); }
|
|
||||||
EOF
|
|
||||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
|
||||||
-fPIC -shared $no_ssp -o conftest.so conftest.c
|
|
||||||
-nostdlib -nostartfiles
|
|
||||||
-Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
|
|
||||||
then
|
|
||||||
dnl The following test is a bit weak. We must use a tool which can test
|
|
||||||
dnl cross-platform since the gcc used can be a cross compiler. Without
|
|
||||||
dnl introducing new options this is not easily doable. Instead use a tool
|
|
||||||
dnl which always is cross-platform: readelf. To detect whether -z combreloc
|
|
||||||
dnl look for a section named .rel.dyn or .rela.dyn.
|
|
||||||
if $READELF -S conftest.so | grep -E '.rela?.dyn' > /dev/null; then
|
|
||||||
libc_cv_z_combreloc=yes
|
|
||||||
else
|
|
||||||
libc_cv_z_combreloc=no
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
libc_cv_z_combreloc=no
|
|
||||||
fi
|
|
||||||
rm -f conftest*])
|
|
||||||
if test "$libc_cv_z_combreloc" = yes; then
|
|
||||||
AC_DEFINE(HAVE_Z_COMBRELOC)
|
|
||||||
fi
|
|
||||||
AC_SUBST(libc_cv_z_combreloc)
|
|
||||||
|
|
||||||
LIBC_LINKER_FEATURE([-z execstack], [-Wl,-z,execstack],
|
LIBC_LINKER_FEATURE([-z execstack], [-Wl,-z,execstack],
|
||||||
[libc_cv_z_execstack=yes], [libc_cv_z_execstack=no])
|
[libc_cv_z_execstack=yes], [libc_cv_z_execstack=no])
|
||||||
AC_SUBST(libc_cv_z_execstack)
|
AC_SUBST(libc_cv_z_execstack)
|
||||||
|
@@ -371,26 +371,12 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
Elf64_Addr *const reloc_addr = reloc_addr_arg;
|
Elf64_Addr *const reloc_addr = reloc_addr_arg;
|
||||||
unsigned long int const r_type = ELF64_R_TYPE (reloc->r_info);
|
unsigned long int const r_type = ELF64_R_TYPE (reloc->r_info);
|
||||||
|
|
||||||
#if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC && !defined SHARED
|
|
||||||
/* This is defined in rtld.c, but nowhere in the static libc.a; make the
|
|
||||||
reference weak so static programs can still link. This declaration
|
|
||||||
cannot be done when compiling rtld.c (i.e. #ifdef RTLD_BOOTSTRAP)
|
|
||||||
because rtld.c contains the common defn for _dl_rtld_map, which is
|
|
||||||
incompatible with a weak decl in the same file. */
|
|
||||||
weak_extern (_dl_rtld_map);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* We cannot use a switch here because we cannot locate the switch
|
/* We cannot use a switch here because we cannot locate the switch
|
||||||
jump table until we've self-relocated. */
|
jump table until we've self-relocated. */
|
||||||
|
|
||||||
#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
|
#if !defined RTLD_BOOTSTRAP
|
||||||
if (__builtin_expect (r_type == R_ALPHA_RELATIVE, 0))
|
if (__builtin_expect (r_type == R_ALPHA_RELATIVE, 0))
|
||||||
{
|
{
|
||||||
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
||||||
/* Already done in dynamic linker. */
|
|
||||||
if (map != &GL(dl_rtld_map))
|
|
||||||
# endif
|
|
||||||
{
|
|
||||||
/* XXX Make some timings. Maybe it's preferable to test for
|
/* XXX Make some timings. Maybe it's preferable to test for
|
||||||
unaligned access and only do it the complex way if necessary. */
|
unaligned access and only do it the complex way if necessary. */
|
||||||
Elf64_Addr reloc_addr_val;
|
Elf64_Addr reloc_addr_val;
|
||||||
@@ -402,7 +388,6 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
/* Store value without causing unaligned trap. */
|
/* Store value without causing unaligned trap. */
|
||||||
memcpy (reloc_addr_arg, &reloc_addr_val, 8);
|
memcpy (reloc_addr_arg, &reloc_addr_val, 8);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (__builtin_expect (r_type == R_ALPHA_NONE, 0))
|
if (__builtin_expect (r_type == R_ALPHA_NONE, 0))
|
||||||
|
@@ -335,23 +335,9 @@ elf_machine_rel (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
Elf32_Addr *const reloc_addr = reloc_addr_arg;
|
Elf32_Addr *const reloc_addr = reloc_addr_arg;
|
||||||
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
||||||
|
|
||||||
#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
|
#if !defined RTLD_BOOTSTRAP
|
||||||
if (__builtin_expect (r_type == R_ARM_RELATIVE, 0))
|
if (__builtin_expect (r_type == R_ARM_RELATIVE, 0))
|
||||||
{
|
|
||||||
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
||||||
/* This is defined in rtld.c, but nowhere in the static libc.a;
|
|
||||||
make the reference weak so static programs can still link.
|
|
||||||
This declaration cannot be done when compiling rtld.c
|
|
||||||
(i.e. #ifdef RTLD_BOOTSTRAP) because rtld.c contains the
|
|
||||||
common defn for _dl_rtld_map, which is incompatible with a
|
|
||||||
weak decl in the same file. */
|
|
||||||
# ifndef SHARED
|
|
||||||
weak_extern (_dl_rtld_map);
|
|
||||||
# endif
|
|
||||||
if (map != &GL(dl_rtld_map)) /* Already done in rtld itself. */
|
|
||||||
# endif
|
|
||||||
*reloc_addr += map->l_addr;
|
*reloc_addr += map->l_addr;
|
||||||
}
|
|
||||||
# ifndef RTLD_BOOTSTRAP
|
# ifndef RTLD_BOOTSTRAP
|
||||||
else if (__builtin_expect (r_type == R_ARM_NONE, 0))
|
else if (__builtin_expect (r_type == R_ARM_NONE, 0))
|
||||||
return;
|
return;
|
||||||
|
@@ -557,15 +557,6 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
struct link_map *sym_map;
|
struct link_map *sym_map;
|
||||||
Elf32_Addr value;
|
Elf32_Addr value;
|
||||||
|
|
||||||
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC && !defined SHARED
|
|
||||||
/* This is defined in rtld.c, but nowhere in the static libc.a; make the
|
|
||||||
reference weak so static programs can still link. This declaration
|
|
||||||
cannot be done when compiling rtld.c (i.e. #ifdef RTLD_BOOTSTRAP)
|
|
||||||
because rtld.c contains the common defn for _dl_rtld_map, which is
|
|
||||||
incompatible with a weak decl in the same file. */
|
|
||||||
weak_extern (GL(dl_rtld_map));
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* RESOLVE_MAP will return a null value for undefined syms, and
|
/* RESOLVE_MAP will return a null value for undefined syms, and
|
||||||
non-null for all other syms. In particular, relocs with no
|
non-null for all other syms. In particular, relocs with no
|
||||||
symbol (symbol index of zero), also called *ABS* relocs, will be
|
symbol (symbol index of zero), also called *ABS* relocs, will be
|
||||||
|
@@ -266,29 +266,15 @@ elf_machine_rel (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
Elf32_Addr *const reloc_addr = reloc_addr_arg;
|
Elf32_Addr *const reloc_addr = reloc_addr_arg;
|
||||||
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
||||||
|
|
||||||
# if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
|
# if !defined RTLD_BOOTSTRAP
|
||||||
if (__glibc_unlikely (r_type == R_386_RELATIVE))
|
if (__glibc_unlikely (r_type == R_386_RELATIVE))
|
||||||
{
|
|
||||||
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
||||||
/* This is defined in rtld.c, but nowhere in the static libc.a;
|
|
||||||
make the reference weak so static programs can still link.
|
|
||||||
This declaration cannot be done when compiling rtld.c
|
|
||||||
(i.e. #ifdef RTLD_BOOTSTRAP) because rtld.c contains the
|
|
||||||
common defn for _dl_rtld_map, which is incompatible with a
|
|
||||||
weak decl in the same file. */
|
|
||||||
# ifndef SHARED
|
|
||||||
weak_extern (_dl_rtld_map);
|
|
||||||
# endif
|
|
||||||
if (map != &GL(dl_rtld_map)) /* Already done in rtld itself. */
|
|
||||||
# endif
|
|
||||||
*reloc_addr += map->l_addr;
|
*reloc_addr += map->l_addr;
|
||||||
}
|
|
||||||
# ifndef RTLD_BOOTSTRAP
|
# ifndef RTLD_BOOTSTRAP
|
||||||
else if (__glibc_unlikely (r_type == R_386_NONE))
|
else if (__glibc_unlikely (r_type == R_386_NONE))
|
||||||
return;
|
return;
|
||||||
# endif
|
# endif
|
||||||
else
|
else
|
||||||
# endif /* !RTLD_BOOTSTRAP and have no -z combreloc */
|
# endif /* !RTLD_BOOTSTRAP */
|
||||||
{
|
{
|
||||||
# ifndef RTLD_BOOTSTRAP
|
# ifndef RTLD_BOOTSTRAP
|
||||||
const Elf32_Sym *const refsym = sym;
|
const Elf32_Sym *const refsym = sym;
|
||||||
|
@@ -383,29 +383,15 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info);
|
const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info);
|
||||||
Elf64_Addr value;
|
Elf64_Addr value;
|
||||||
|
|
||||||
#if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC && !defined SHARED
|
|
||||||
/* This is defined in rtld.c, but nowhere in the static libc.a; make the
|
|
||||||
reference weak so static programs can still link. This declaration
|
|
||||||
cannot be done when compiling rtld.c (i.e. #ifdef RTLD_BOOTSTRAP)
|
|
||||||
because rtld.c contains the common defn for _dl_rtld_map, which is
|
|
||||||
incompatible with a weak decl in the same file. */
|
|
||||||
weak_extern (_dl_rtld_map);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* We cannot use a switch here because we cannot locate the switch
|
/* We cannot use a switch here because we cannot locate the switch
|
||||||
jump table until we've self-relocated. */
|
jump table until we've self-relocated. */
|
||||||
|
|
||||||
#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
|
#if !defined RTLD_BOOTSTRAP
|
||||||
if (__builtin_expect (R_IA64_TYPE (r_type) == R_IA64_TYPE (R_IA64_REL64LSB),
|
if (__builtin_expect (R_IA64_TYPE (r_type) == R_IA64_TYPE (R_IA64_REL64LSB),
|
||||||
0))
|
0))
|
||||||
{
|
{
|
||||||
assert (ELF64_R_TYPE (reloc->r_info) == R_IA64_REL64LSB);
|
assert (ELF64_R_TYPE (reloc->r_info) == R_IA64_REL64LSB);
|
||||||
value = *reloc_addr;
|
value = *reloc_addr + map->l_addr;
|
||||||
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
||||||
/* Already done in dynamic linker. */
|
|
||||||
if (map != &GL(dl_rtld_map))
|
|
||||||
# endif
|
|
||||||
value += map->l_addr;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@@ -244,24 +244,10 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
|
#if !defined RTLD_BOOTSTRAP
|
||||||
case R_RISCV_RELATIVE:
|
case R_RISCV_RELATIVE:
|
||||||
{
|
|
||||||
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
||||||
/* This is defined in rtld.c, but nowhere in the static libc.a;
|
|
||||||
make the reference weak so static programs can still link.
|
|
||||||
This declaration cannot be done when compiling rtld.c
|
|
||||||
(i.e. #ifdef RTLD_BOOTSTRAP) because rtld.c contains the
|
|
||||||
common defn for _dl_rtld_map, which is incompatible with a
|
|
||||||
weak decl in the same file. */
|
|
||||||
# ifndef SHARED
|
|
||||||
weak_extern (GL(dl_rtld_map));
|
|
||||||
# endif
|
|
||||||
if (map != &GL(dl_rtld_map)) /* Already done in rtld itself. */
|
|
||||||
# endif
|
|
||||||
*addr_field = map->l_addr + reloc->r_addend;
|
*addr_field = map->l_addr + reloc->r_addend;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case R_RISCV_IRELATIVE:
|
case R_RISCV_IRELATIVE:
|
||||||
|
@@ -329,23 +329,9 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
Elf32_Addr *const reloc_addr = reloc_addr_arg;
|
Elf32_Addr *const reloc_addr = reloc_addr_arg;
|
||||||
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
||||||
|
|
||||||
#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
|
#if !defined RTLD_BOOTSTRAP
|
||||||
if (__glibc_unlikely (r_type == R_390_RELATIVE))
|
if (__glibc_unlikely (r_type == R_390_RELATIVE))
|
||||||
{
|
|
||||||
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
||||||
/* This is defined in rtld.c, but nowhere in the static libc.a;
|
|
||||||
make the reference weak so static programs can still link.
|
|
||||||
This declaration cannot be done when compiling rtld.c
|
|
||||||
(i.e. #ifdef RTLD_BOOTSTRAP) because rtld.c contains the
|
|
||||||
common defn for _dl_rtld_map, which is incompatible with a
|
|
||||||
weak decl in the same file. */
|
|
||||||
# ifndef SHARED
|
|
||||||
weak_extern (GL(dl_rtld_map));
|
|
||||||
# endif
|
|
||||||
if (map != &GL(dl_rtld_map)) /* Already done in rtld itself. */
|
|
||||||
# endif
|
|
||||||
*reloc_addr = map->l_addr + reloc->r_addend;
|
*reloc_addr = map->l_addr + reloc->r_addend;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (__glibc_unlikely (r_type == R_390_NONE))
|
if (__glibc_unlikely (r_type == R_390_NONE))
|
||||||
|
@@ -276,23 +276,9 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
Elf64_Addr *const reloc_addr = reloc_addr_arg;
|
Elf64_Addr *const reloc_addr = reloc_addr_arg;
|
||||||
const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
|
const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
|
||||||
|
|
||||||
#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
|
#if !defined RTLD_BOOTSTRAP
|
||||||
if (__glibc_unlikely (r_type == R_390_RELATIVE))
|
if (__glibc_unlikely (r_type == R_390_RELATIVE))
|
||||||
{
|
|
||||||
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
||||||
/* This is defined in rtld.c, but nowhere in the static libc.a;
|
|
||||||
make the reference weak so static programs can still link.
|
|
||||||
This declaration cannot be done when compiling rtld.c
|
|
||||||
(i.e. #ifdef RTLD_BOOTSTRAP) because rtld.c contains the
|
|
||||||
common defn for _dl_rtld_map, which is incompatible with a
|
|
||||||
weak decl in the same file. */
|
|
||||||
# ifndef SHARED
|
|
||||||
weak_extern (GL(dl_rtld_map));
|
|
||||||
# endif
|
|
||||||
if (map != &GL(dl_rtld_map)) /* Already done in rtld itself. */
|
|
||||||
# endif
|
|
||||||
*reloc_addr = map->l_addr + reloc->r_addend;
|
*reloc_addr = map->l_addr + reloc->r_addend;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (__glibc_unlikely (r_type == R_390_NONE))
|
if (__glibc_unlikely (r_type == R_390_NONE))
|
||||||
|
@@ -303,15 +303,6 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
||||||
struct link_map *sym_map = NULL;
|
struct link_map *sym_map = NULL;
|
||||||
|
|
||||||
#if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
||||||
/* This is defined in rtld.c, but nowhere in the static libc.a; make the
|
|
||||||
reference weak so static programs can still link. This declaration
|
|
||||||
cannot be done when compiling rtld.c (i.e. #ifdef RTLD_BOOTSTRAP)
|
|
||||||
because rtld.c contains the common defn for _dl_rtld_map, which is
|
|
||||||
incompatible with a weak decl in the same file. */
|
|
||||||
weak_extern (_dl_rtld_map);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (__glibc_unlikely (r_type == R_SPARC_NONE))
|
if (__glibc_unlikely (r_type == R_SPARC_NONE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -321,12 +312,9 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
|
#if !defined RTLD_BOOTSTRAP
|
||||||
if (__glibc_unlikely (r_type == R_SPARC_RELATIVE))
|
if (__glibc_unlikely (r_type == R_SPARC_RELATIVE))
|
||||||
{
|
{
|
||||||
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
||||||
if (map != &_dl_rtld_map) /* Already done in rtld itself. */
|
|
||||||
# endif
|
|
||||||
*reloc_addr += map->l_addr + reloc->r_addend;
|
*reloc_addr += map->l_addr + reloc->r_addend;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -324,15 +324,6 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
const unsigned long int r_type = ELF64_R_TYPE_ID (reloc->r_info);
|
const unsigned long int r_type = ELF64_R_TYPE_ID (reloc->r_info);
|
||||||
struct link_map *sym_map = NULL;
|
struct link_map *sym_map = NULL;
|
||||||
|
|
||||||
#if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
||||||
/* This is defined in rtld.c, but nowhere in the static libc.a; make the
|
|
||||||
reference weak so static programs can still link. This declaration
|
|
||||||
cannot be done when compiling rtld.c (i.e. #ifdef RTLD_BOOTSTRAP)
|
|
||||||
because rtld.c contains the common defn for _dl_rtld_map, which is
|
|
||||||
incompatible with a weak decl in the same file. */
|
|
||||||
weak_extern (_dl_rtld_map);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (__glibc_unlikely (r_type == R_SPARC_NONE))
|
if (__glibc_unlikely (r_type == R_SPARC_NONE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -342,12 +333,9 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
|
#if !defined RTLD_BOOTSTRAP
|
||||||
if (__glibc_unlikely (r_type == R_SPARC_RELATIVE))
|
if (__glibc_unlikely (r_type == R_SPARC_RELATIVE))
|
||||||
{
|
{
|
||||||
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
||||||
if (map != &_dl_rtld_map) /* Already done in rtld itself. */
|
|
||||||
# endif
|
|
||||||
*reloc_addr += map->l_addr + reloc->r_addend;
|
*reloc_addr += map->l_addr + reloc->r_addend;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -258,23 +258,9 @@ elf_machine_rela(struct link_map *map, struct r_scope_elem *scope[],
|
|||||||
ElfW(Addr) *const reloc_addr = reloc_addr_arg;
|
ElfW(Addr) *const reloc_addr = reloc_addr_arg;
|
||||||
const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info);
|
const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info);
|
||||||
|
|
||||||
# if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
|
# if !defined RTLD_BOOTSTRAP
|
||||||
if (__glibc_unlikely (r_type == R_X86_64_RELATIVE))
|
if (__glibc_unlikely (r_type == R_X86_64_RELATIVE))
|
||||||
{
|
|
||||||
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
||||||
/* This is defined in rtld.c, but nowhere in the static libc.a;
|
|
||||||
make the reference weak so static programs can still link.
|
|
||||||
This declaration cannot be done when compiling rtld.c
|
|
||||||
(i.e. #ifdef RTLD_BOOTSTRAP) because rtld.c contains the
|
|
||||||
common defn for _dl_rtld_map, which is incompatible with a
|
|
||||||
weak decl in the same file. */
|
|
||||||
# ifndef SHARED
|
|
||||||
weak_extern (GL(dl_rtld_map));
|
|
||||||
# endif
|
|
||||||
if (map != &GL(dl_rtld_map)) /* Already done in rtld itself. */
|
|
||||||
# endif
|
|
||||||
*reloc_addr = map->l_addr + reloc->r_addend;
|
*reloc_addr = map->l_addr + reloc->r_addend;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
# endif
|
# endif
|
||||||
# if !defined RTLD_BOOTSTRAP
|
# if !defined RTLD_BOOTSTRAP
|
||||||
|
Reference in New Issue
Block a user