This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Segfault during 2.3.1 build + patch


Hi,

just tried to build myself a 2.3.1 glibc and ran into
a segfault that stopped it .
The segfault occured when the build tried to use the newly
built ld.

There might be something in my previous environment, but
the patch below should be pretty harmless (?) for others and
it made my day :-)

My environment:
 - gcc 3.2 (the same result with gcc 2.95.3)
 - binutils 2.13
 - old glibc 2.2.5

The problem is in elf/dl-minimal.c, where _itoa is using a constant
string _itoa_lower_digits, which is declared external. Some lines
below that the real string is declared.
It seems like my environment get's this wrong and generates wrong
address for the string .
There might be a good reason for forward declaring the string but
I am not clever enough to recognize that.... So I just moved the actual
string declaration up before the _itoa() declaration and removed the
forward one, and voila, everything works.

Here is the patch in case someone is interested:

BRGDS


-- 
Dag Nygren                               email: dag@newtech.fi
Oy Espoon NewTech Ab                     phone: +358 9 8024910
Träsktorpet 3                              fax: +358 9 8024916
02360 ESBO                              Mobile: +358 400 426312
FINLAND

--- dl-minimal.c.orig	Thu Nov  7 10:56:54 2002
+++ dl-minimal.c	Thu Nov  7 10:57:27 2002
@@ -282,6 +282,11 @@
   return result * sign;
 }
 
+/* The '_itoa_lower_digits' variable in libc.so is able to handle bases
+   up to 36.  We don't need this here.  */
+const char INTUSE(_itoa_lower_digits)[16] attribute_hidden
+  = "0123456789abcdef";
+
 
 /* We always use _itoa instead of _itoa_word in ld.so since the former
    also has to be present and it is never about speed when these
@@ -293,7 +298,7 @@
      unsigned int base;
      int upper_case;
 {
-  extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden;
+//  extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden;
 
   assert (! upper_case);
 
@@ -348,11 +353,6 @@
 weak_alias (__strsep, strsep)
 strong_alias (__strsep, __strsep_g)
 
-
-/* The '_itoa_lower_digits' variable in libc.so is able to handle bases
-   up to 36.  We don't need this here.  */
-const char INTUSE(_itoa_lower_digits)[16] attribute_hidden
-  = "0123456789abcdef";
 
 
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]