[PATCH] Fix _itoa_lower_digits (was Re: bootstrap 2.95 libc not building on alpha)
Jakub Jelinek
jakub@redhat.com
Wed Mar 13 08:36:00 GMT 2002
Hi!
On Wed, Mar 13, 2002 at 10:11:30AM -0500, Matthew Bemis wrote:
> todays build produced the following error
> /mnt/u9/toolchain/buildsys/build/alpha9/bootstrap-gcc_2.95.3/native/libc/elf/dl-
>
> allobjs.os:/mnt/u9/toolchain/buildsys/source/libc/elf/rtld.c:1475: first
> defined
> here
> /home/toolchain/baseline/install/alpha9/bootstrap-gcc_2.95.3/native/binutils-2.1
>
> 1.2/bin/ld: Warning: size of symbol `_itoa_lower_digits' changed from 16
> to 36 in itoa-digits.os
> collect2: ld returned 1 exit status
I think we should use _itoa_lower_digits_internal to avoid confusion.
The above error is because rtld.c used stdio-common/_itoa.h while
dl-reloc.c and dl-minimal.c used/defined _itoa_lower_digits explicitely.
BTW: It is wrong that mp_clz_tab.c is "Not needed anywhere", it is
just not needed anywhere on certain arches. I'd think the best thing to do
would be to put them back, make __clz_tab hidden (but am not sure if
it should be in stdlib/longlong.h header (as e.g. gcc is not interested in
such changes), probably in include/longlong.h instead and include
<stdlib/longlong.h> in there), include <longlong.h> and other needed headers
in mp_clz_tab.c and surround the actual table with something like:
#if defined(COUNT_LEADING_ZEROS_0) \
&& !defined(__a29k__) && !defined(__m88000__) && !defined(_ARCH_PPC)
...
#endif
(or in longlong.h:
extern const UQItype __clz_tab[];
+#define CLZ_TAB_NEEDED
and test that in mp_clz_tab.c).
Also, I guess libc-symbols.h:
# define _INTVARDEF(name, aliasname) \
extern __typeof (name) aliasname __attribute__ ((alias (#name), \
visibility ("hidden")));
will need some #ifdef around if attribute_hidden is not supported.
2002-03-13 Jakub Jelinek <jakub@redhat.com>
* elf/dl-minimal.c (_itoa): Use _itoa_lower_digits_internal if
SHARED.
* elf/dl-reloc.c (_dl_reloc_bad_type): Likewise.
--- libc/elf/dl-minimal.c.jj Wed Mar 13 08:40:49 2002
+++ libc/elf/dl-minimal.c Wed Mar 13 11:07:04 2002
@@ -290,12 +290,12 @@ _itoa (value, buflim, base, upper_case)
unsigned int base;
int upper_case;
{
- extern const char _itoa_lower_digits[] attribute_hidden;
+ extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden;
assert (! upper_case);
do
- *--buflim = _itoa_lower_digits[value % base];
+ *--buflim = INTUSE(_itoa_lower_digits)[value % base];
while ((value /= base) != 0);
return buflim;
@@ -348,4 +348,5 @@ 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 _itoa_lower_digits[16] = "0123456789abcdef";
+const char INTUSE(_itoa_lower_digits)[16] attribute_hidden
+ = "0123456789abcdef";
--- libc/elf/dl-reloc.c.jj Wed Mar 13 08:40:49 2002
+++ libc/elf/dl-reloc.c Wed Mar 13 11:08:41 2002
@@ -210,8 +210,8 @@ void
internal_function
_dl_reloc_bad_type (struct link_map *map, unsigned int type, int plt)
{
- extern const char _itoa_lower_digits[] attribute_hidden;
-#define DIGIT(b) _itoa_lower_digits[(b) & 0xf];
+ extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden;
+#define DIGIT(b) INTUSE(_itoa_lower_digits)[(b) & 0xf];
/* XXX We cannot translate these messages. */
static const char msg[2][32] = { "unexpected reloc type 0x",
Jakub
More information about the Libc-hacker
mailing list