about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog34
-rw-r--r--dlfcn/dlerror.c5
-rw-r--r--dlfcn/errmsg1.c6
-rw-r--r--manual/Makefile4
-rw-r--r--string/strings.h7
-rw-r--r--sysdeps/powerpc/dl-machine.c47
-rw-r--r--sysdeps/powerpc/elf/start.S3
-rw-r--r--time/tzset.c5
8 files changed, 82 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index d4c170939f..5e48a27471 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,39 @@
 2001-01-02  Ulrich Drepper  <drepper@redhat.com>
 
+	* manual/Makefile (TEXI2PDF): Change to texi2dvi --pdf.
+	Suggested by Minko Markov <mmarkov@home.com>.
+
+2001-01-02  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
+
+	* sysdeps/powerpc/elf/start.S (__data_start): Make it global.
+	* sysdeps/powerpc/dl-machine.c (dl_reloc_overflow): Print the name of
+	the failing symbol.
+	(__process_machine_rela): Pass symbol to dl_reloc_overflow().
+
+2001-01-02  Ben Collins  <bcollins@debian.org>
+
+	* time/tzset.c (tzset_internal): Make sure we fall back to UTC
+	if TZ is not set and TZDEFAULT is not present.
+
+2001-01-01  Ben Collins  <bcollins@debian.org>
+
+	* string/strings.h: Make sure we declare our functions even if
+	string.h is already included, based on whether or not __USE_BSD is
+	defined.
+
+2001-01-02  Ulrich Drepper  <drepper@redhat.com>
+
+	* dlfcn/dlerror.c (dlerror): Handle call of dlerror() before any
+	other dlopen() and dlsym().
+	Based on a patch by Ben Collins <bcollins@debian.org>.
+
+2001-01-02  Andreas Jaeger  <aj@suse.de>
+
+	* dlfcn/errmsg1.c (main): Call dlerror initially.
+	Reported by Ben Collins <bcollins@debian.org>.
+
+2001-01-02  Ulrich Drepper  <drepper@redhat.com>
+
 	* intl/dcigettext.c (guess_category_value): Rewrite so that LANGUAGE
 	value is ignored if the selected locale is the C locale.
 	* intl/tst-gettext.c: Set locale for above change.
diff --git a/dlfcn/dlerror.c b/dlfcn/dlerror.c
index 6ce601d05b..59ee0b8c54 100644
--- a/dlfcn/dlerror.c
+++ b/dlfcn/dlerror.c
@@ -46,7 +46,7 @@ static void free_key_mem (void *mem);
 char *
 dlerror (void)
 {
-  char *buf;
+  char *buf = NULL;
   struct dl_action_result *result;
 
   /* Get error string.  */
@@ -64,9 +64,8 @@ dlerror (void)
 	    free ((char *) result->errstring);
 	  result->errstring = NULL;
 	}
-      buf = NULL;
     }
-  else
+  else if (result->errstring != NULL)
     {
       buf = (char *) result->errstring;
       if (__asprintf (&buf, result->errcode != 0 ? "%s: %s: %s" : "%s: %s",
diff --git a/dlfcn/errmsg1.c b/dlfcn/errmsg1.c
index a7bb9b8272..b455ea97a5 100644
--- a/dlfcn/errmsg1.c
+++ b/dlfcn/errmsg1.c
@@ -27,6 +27,12 @@ main (void)
   void *h;
   const char *s;
 
+  /* Test that dlerror works initially.  */
+  s = dlerror ();
+  printf ("dlerror() without prior dl*() call returned: %s\n", s);
+  if (s != NULL)
+    return 1;
+
   h = dlopen ("errmsg1mod.so", RTLD_NOW);
   if (h != NULL)
     {
diff --git a/manual/Makefile b/manual/Makefile
index 5fb8ec2d3d..287cad5c0e 100644
--- a/manual/Makefile
+++ b/manual/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1992-1999, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1992-1999, 2000, 2001 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
@@ -38,7 +38,7 @@ TEXI2DVI = texi2dvi
 AWK = gawk
 endif
 
-TEXI2PDF = pdftexinfo
+TEXI2PDF = texi2dvi --pdf
 
 ifneq ($(strip $(MAKEINFO)),:)
 all: info
diff --git a/string/strings.h b/string/strings.h
index 0c48e72cd0..9e659bcc1b 100644
--- a/string/strings.h
+++ b/string/strings.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,96,97,99,2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,96,97,99,2000,2001 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
@@ -20,8 +20,9 @@
 #define	_STRINGS_H	1
 
 /* We don't need and should not read this file if <string.h> was already
-   read.  */
-#ifndef _STRING_H
+   read. The one exception being that if __USE_BSD isn't defined, then
+   these aren't defined in string.h, so we need to define them here.  */
+#if !defined _STRING_H || !defined __USE_BSD
 
 # include <features.h>
 # define __need_size_t
diff --git a/sysdeps/powerpc/dl-machine.c b/sysdeps/powerpc/dl-machine.c
index ca0a0dcd16..59626b3221 100644
--- a/sysdeps/powerpc/dl-machine.c
+++ b/sysdeps/powerpc/dl-machine.c
@@ -1,6 +1,5 @@
 /* Machine-dependent ELF dynamic relocation functions.  PowerPC version.
-   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 
-   Free Software Foundation, Inc.
+   Copyright (C) 1995,96,97,98,99,2000,2001 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
@@ -236,11 +235,11 @@ __elf_machine_runtime_setup (struct link_map *map, int lazy, int profile)
 	    /* This is the object we are looking for.  Say that we really
 	       want profiling and the timers are started.  */
 	    _dl_profile_map = map;
-	  
+
 	  /* For the long entries, subtract off data_words.  */
 	  tramp[0] = OPCODE_ADDIS_HI (11, 11, -data_words);
 	  tramp[1] = OPCODE_ADDI (11, 11, -data_words);
-	  
+
 	  /* Multiply index of entry by 3 (in r11).  */
 	  tramp[2] = OPCODE_SLWI (12, 11, 1);
 	  tramp[3] = OPCODE_ADD (11, 12, 11);
@@ -249,7 +248,7 @@ __elf_machine_runtime_setup (struct link_map *map, int lazy, int profile)
 	      /* Load address of link map in r12.  */
 	      tramp[4] = OPCODE_LI (12, (Elf32_Word) map);
 	      tramp[5] = OPCODE_ADDIS_HI (12, 12, (Elf32_Word) map);
-	      
+
 	      /* Call _dl_runtime_resolve.  */
 	      tramp[6] = OPCODE_BA (dlrr);
 	    }
@@ -259,15 +258,15 @@ __elf_machine_runtime_setup (struct link_map *map, int lazy, int profile)
 	      tramp[4] = OPCODE_LI (12, dlrr);
 	      tramp[5] = OPCODE_ADDIS_HI (12, 12, dlrr);
 	      tramp[6] = OPCODE_MTCTR (12);
-	      
+
 	      /* Load address of link map in r12.  */
 	      tramp[7] = OPCODE_LI (12, (Elf32_Word) map);
 	      tramp[8] = OPCODE_ADDIS_HI (12, 12, (Elf32_Word) map);
-	      
+
 	      /* Call _dl_runtime_resolve.  */
 	      tramp[9] = OPCODE_BCTR ();
 	    }
-	  
+
 	  /* Set up the lazy PLT entries.  */
 	  offset = PLT_INITIAL_ENTRY_WORDS;
 	  i = 0;
@@ -329,7 +328,7 @@ __elf_machine_fixup_plt(struct link_map *map, const Elf32_Rela *reloc,
     {
       Elf32_Word *plt, *data_words;
       Elf32_Word index, offset, num_plt_entries;
-      
+
       num_plt_entries = (map->l_info[DT_PLTRELSZ]->d_un.d_val
 			 / sizeof(Elf32_Rela));
       plt = (Elf32_Word *) D_PTR (map, l_info[DT_PLTGOT]);
@@ -343,7 +342,7 @@ __elf_machine_fixup_plt(struct link_map *map, const Elf32_Rela *reloc,
 	{
 	  data_words[index] = finaladdr;
 	  PPC_SYNC;
-	  *reloc_addr = OPCODE_B ((PLT_LONGBRANCH_ENTRY_WORDS - (offset+1)) 
+	  *reloc_addr = OPCODE_B ((PLT_LONGBRANCH_ENTRY_WORDS - (offset+1))
 				  * 4);
 	}
       else
@@ -368,13 +367,25 @@ __elf_machine_fixup_plt(struct link_map *map, const Elf32_Rela *reloc,
 static void
 dl_reloc_overflow (struct link_map *map,
 		   const char *name,
-		   Elf32_Addr *const reloc_addr)
+		   Elf32_Addr *const reloc_addr,
+		   const Elf32_Sym *sym,
+		   const Elf32_Sym *refsym)
 {
   char buffer[128];
   char *t;
+  const Elf32_Sym *errsym = sym ?: refsym;
   t = stpcpy (buffer, name);
   t = stpcpy (t, " relocation at 0x00000000");
   _itoa_word ((unsigned) reloc_addr, t, 16, 0);
+  if (errsym)
+    {
+      const char *strtab;
+
+      strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
+      t = stpcpy (t, " for symbol `");
+      t = stpcpy (t, strtab + errsym->st_name);
+      t = stpcpy (t, "'");
+    }
   t = stpcpy (t, " out of range");
   _dl_signal_error (0, map->l_name, buffer);
 }
@@ -402,14 +413,14 @@ __process_machine_rela (struct link_map *map,
 
     case R_PPC_ADDR24:
       if (finaladdr > 0x01fffffc && finaladdr < 0xfe000000)
-	dl_reloc_overflow (map,  "R_PPC_ADDR24", reloc_addr);
+	dl_reloc_overflow (map,  "R_PPC_ADDR24", reloc_addr, sym, refsym);
       *reloc_addr = (*reloc_addr & 0xfc000003) | (finaladdr & 0x3fffffc);
       break;
 
     case R_PPC_ADDR16:
     case R_PPC_UADDR16:
       if (finaladdr > 0x7fff && finaladdr < 0x8000)
-	dl_reloc_overflow (map,  "R_PPC_ADDR16", reloc_addr);
+	dl_reloc_overflow (map,  "R_PPC_ADDR16", reloc_addr, sym, refsym);
       *(Elf32_Half*) reloc_addr = finaladdr;
       break;
 
@@ -429,7 +440,7 @@ __process_machine_rela (struct link_map *map,
     case R_PPC_ADDR14_BRTAKEN:
     case R_PPC_ADDR14_BRNTAKEN:
       if (finaladdr > 0x7fff && finaladdr < 0x8000)
-	dl_reloc_overflow (map,  "R_PPC_ADDR14", reloc_addr);
+	dl_reloc_overflow (map,  "R_PPC_ADDR14", reloc_addr, sym, refsym);
       *reloc_addr = (*reloc_addr & 0xffff0003) | (finaladdr & 0xfffc);
       if (rinfo != R_PPC_ADDR14)
 	*reloc_addr = ((*reloc_addr & 0xffdfffff)
@@ -441,7 +452,7 @@ __process_machine_rela (struct link_map *map,
       {
 	Elf32_Sword delta = finaladdr - (Elf32_Word) reloc_addr;
 	if (delta << 6 >> 6 != delta)
-	  dl_reloc_overflow (map,  "R_PPC_REL14", reloc_addr);
+	  dl_reloc_overflow (map,  "R_PPC_REL14", reloc_addr, sym, refsym);
 	*reloc_addr = (*reloc_addr & 0xfc000003) | (delta & 0x3fffffc);
       }
       break;
@@ -485,7 +496,7 @@ __process_machine_rela (struct link_map *map,
 	  {
 	    Elf32_Word *plt, *data_words;
 	    Elf32_Word index, offset, num_plt_entries;
-	    
+
 	    plt = (Elf32_Word *) D_PTR (map, l_info[DT_PLTGOT]);
 	    offset = reloc_addr - plt;
 
@@ -497,8 +508,8 @@ __process_machine_rela (struct link_map *map,
 		data_words = plt + PLT_DATA_START_WORDS (num_plt_entries);
 		data_words[index] = finaladdr;
 		reloc_addr[0] = OPCODE_LI (11, index * 4);
-		reloc_addr[1] = OPCODE_B ((PLT_LONGBRANCH_ENTRY_WORDS 
-					   - (offset+1)) 
+		reloc_addr[1] = OPCODE_B ((PLT_LONGBRANCH_ENTRY_WORDS
+					   - (offset+1))
 					  * 4);
 		MODIFIED_CODE_NOQUEUE (reloc_addr + 1);
 	      }
diff --git a/sysdeps/powerpc/elf/start.S b/sysdeps/powerpc/elf/start.S
index 632505f13e..c3d85bbb17 100644
--- a/sysdeps/powerpc/elf/start.S
+++ b/sysdeps/powerpc/elf/start.S
@@ -1,5 +1,5 @@
 /* Startup code for programs linked with GNU libc.
-   Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001 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
@@ -61,5 +61,6 @@ END(_start)
 
 /* Define a symbol for the first piece of initialized data.  */
 	.section ".data"
+	.globl	__data_start
 __data_start:
 weak_alias (__data_start, data_start)
diff --git a/time/tzset.c b/time/tzset.c
index 31dfc9b7bc..1237c9195c 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1999, 2000, 2001 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
@@ -175,7 +175,8 @@ tzset_internal (always)
 
   /* No data file found.  Default to UTC if nothing specified.  */
 
-  if (tz == NULL || *tz == '\0')
+  if (tz == NULL || *tz == '\0'
+      || (TZDEFAULT != NULL && strcmp (tz, TZDEFAULT) == 0))
     {
       tz_rules[0].name = tz_rules[1].name = "UTC";
       tz_rules[0].type = tz_rules[1].type = J0;