From e38c954b3bebd37f7519202d918cf0f1edbdd182 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 12 Feb 2005 23:17:03 +0000 Subject: [PATCH] * debug/chk_fail.c (__chk_fail): Add a while (1) loop around __libc_message to kill GCC warning about noreturn function returning. * elf/rtld.c (dlmain): If LD_TRACE_PRELINKING, clear l_relocated flag before relocating ld.so again. * elf/rtld.c (_dl_start): Set bootstrap_map.l_relocated even for already prelinked ld.so. --- ChangeLog | 11 +++++++++++ debug/chk_fail.c | 6 ++++-- elf/rtld.c | 11 +++++++---- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2be28ba..78927b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-02-11 Jakub Jelinek + + * debug/chk_fail.c (__chk_fail): Add a while (1) loop around + __libc_message to kill GCC warning about noreturn function returning. + + * elf/rtld.c (dlmain): If LD_TRACE_PRELINKING, clear l_relocated flag + before relocating ld.so again. + + * elf/rtld.c (_dl_start): Set bootstrap_map.l_relocated even + for already prelinked ld.so. + 2005-02-11 Roland McGrath [BZ #715] diff --git a/debug/chk_fail.c b/debug/chk_fail.c index 29df08b..6921ca4 100644 --- a/debug/chk_fail.c +++ b/debug/chk_fail.c @@ -26,7 +26,9 @@ void __attribute__ ((noreturn)) __chk_fail (void) { - __libc_message (1, "*** buffer overflow detected ***: %s terminated\n", - __libc_argv[0] ?: ""); + /* The loop is added only to keep gcc happy. */ + while (1) + __libc_message (1, "*** buffer overflow detected ***: %s terminated\n", + __libc_argv[0] ?: ""); } libc_hidden_def (__chk_fail) diff --git a/elf/rtld.c b/elf/rtld.c index 6a1216d..fbb4e4c 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -1919,10 +1919,13 @@ ERROR: ld.so: object '%s' from %s cannot be preloaded: ignored.\n", if ((GLRO(dl_debug_mask) & DL_DEBUG_PRELINK) && GL(dl_rtld_map).l_opencount > 1) - _dl_relocate_object (&GL(dl_rtld_map), main_map->l_scope, - 0, 0); - } - + { + /* Mark the link map as not yet relocated again. */ + GL(dl_rtld_map).l_relocated = 0; + _dl_relocate_object (&GL(dl_rtld_map), main_map->l_scope, + 0, 0); + } + } #define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED)) if (version_info) { -- 2.7.4