- Temporary support for shared libraries >2GB on 64bit hosts. (BZ 231832)

- Resolves: rhbz#231832
This commit is contained in:
Jan Kratochvil 2007-03-12 16:02:43 +00:00
parent 9548cfeea8
commit e157c1b26f
2 changed files with 205 additions and 1 deletions

View File

@ -0,0 +1,197 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=231832
diff -u -rup gdb-6.6-orig/gdb/symmisc.c gdb-6.6/gdb/symmisc.c
--- gdb-6.6-orig/gdb/symmisc.c 2005-12-17 17:34:03.000000000 -0500
+++ gdb-6.6/gdb/symmisc.c 2007-03-12 09:38:26.000000000 -0400
@@ -233,7 +233,7 @@ print_objfile_statistics (void)
printf_filtered (_(" Space used by a.out string tables: %d\n"),
OBJSTAT (objfile, sz_strtab));
- printf_filtered (_(" Total memory used for objfile obstack: %d\n"),
- obstack_memory_used (&objfile->objfile_obstack));
+ printf_filtered (_(" Total memory used for objfile obstack: %ld\n"),
+ (long) obstack_memory_used (&objfile->objfile_obstack));
printf_filtered (_(" Total memory used for psymbol cache: %d\n"),
bcache_memory_used (objfile->psymbol_cache));
printf_filtered (_(" Total memory used for macro cache: %d\n"),
diff -u -rup gdb-6.6-orig/include/obstack.h gdb-6.6/include/obstack.h
--- gdb-6.6-orig/include/obstack.h 2005-05-10 06:21:08.000000000 -0400
+++ gdb-6.6/include/obstack.h 2007-03-12 09:37:50.000000000 -0400
@@ -188,31 +188,31 @@ struct obstack /* control current objec
/* Declare the external functions we use; they are in obstack.c. */
-extern void _obstack_newchunk (struct obstack *, int);
+extern void _obstack_newchunk (struct obstack *, PTR_INT_TYPE);
extern void _obstack_free (struct obstack *, void *);
-extern int _obstack_begin (struct obstack *, int, int,
+extern int _obstack_begin (struct obstack *, PTR_INT_TYPE, int,
void *(*) (long), void (*) (void *));
-extern int _obstack_begin_1 (struct obstack *, int, int,
+extern int _obstack_begin_1 (struct obstack *, PTR_INT_TYPE, int,
void *(*) (void *, long),
void (*) (void *, void *), void *);
-extern int _obstack_memory_used (struct obstack *);
+extern PTR_INT_TYPE _obstack_memory_used (struct obstack *);
/* Do the function-declarations after the structs
but before defining the macros. */
void obstack_init (struct obstack *obstack);
-void * obstack_alloc (struct obstack *obstack, int size);
+void * obstack_alloc (struct obstack *obstack, PTR_INT_TYPE size);
-void * obstack_copy (struct obstack *obstack, void *address, int size);
-void * obstack_copy0 (struct obstack *obstack, void *address, int size);
+void * obstack_copy (struct obstack *obstack, void *address, PTR_INT_TYPE size);
+void * obstack_copy0 (struct obstack *obstack, void *address, PTR_INT_TYPE size);
void obstack_free (struct obstack *obstack, void *block);
-void obstack_blank (struct obstack *obstack, int size);
+void obstack_blank (struct obstack *obstack, PTR_INT_TYPE size);
-void obstack_grow (struct obstack *obstack, void *data, int size);
-void obstack_grow0 (struct obstack *obstack, void *data, int size);
+void obstack_grow (struct obstack *obstack, void *data, PTR_INT_TYPE size);
+void obstack_grow0 (struct obstack *obstack, void *data, PTR_INT_TYPE size);
void obstack_1grow (struct obstack *obstack, int data_char);
void obstack_ptr_grow (struct obstack *obstack, void *data);
@@ -220,20 +220,20 @@ void obstack_int_grow (struct obstack *o
void * obstack_finish (struct obstack *obstack);
-int obstack_object_size (struct obstack *obstack);
+PTR_INT_TYPE obstack_object_size (struct obstack *obstack);
-int obstack_room (struct obstack *obstack);
-void obstack_make_room (struct obstack *obstack, int size);
+PTR_INT_TYPE obstack_room (struct obstack *obstack);
+void obstack_make_room (struct obstack *obstack, PTR_INT_TYPE size);
void obstack_1grow_fast (struct obstack *obstack, int data_char);
void obstack_ptr_grow_fast (struct obstack *obstack, void *data);
void obstack_int_grow_fast (struct obstack *obstack, int data);
-void obstack_blank_fast (struct obstack *obstack, int size);
+void obstack_blank_fast (struct obstack *obstack, PTR_INT_TYPE size);
void * obstack_base (struct obstack *obstack);
void * obstack_next_free (struct obstack *obstack);
int obstack_alignment_mask (struct obstack *obstack);
-int obstack_chunk_size (struct obstack *obstack);
-int obstack_memory_used (struct obstack *obstack);
+size_t obstack_chunk_size (struct obstack *obstack);
+size_t obstack_memory_used (struct obstack *obstack);
/* Error handler called when `obstack_chunk_alloc' failed to allocate
more memory. This can be set to a user defined function. The
@@ -318,7 +318,7 @@ extern int obstack_exit_failure;
# define obstack_make_room(OBSTACK,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
+ PTR_INT_TYPE __len = (length); \
if (__o->chunk_limit - __o->next_free < __len) \
_obstack_newchunk (__o, __len); \
(void) 0; })
@@ -331,7 +331,7 @@ __extension__ \
# define obstack_grow(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
+ PTR_INT_TYPE __len = (length); \
if (__o->next_free + __len > __o->chunk_limit) \
_obstack_newchunk (__o, __len); \
_obstack_memcpy (__o->next_free, (where), __len); \
@@ -341,7 +341,7 @@ __extension__ \
# define obstack_grow0(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
+ PTR_INT_TYPE __len = (length); \
if (__o->next_free + __len + 1 > __o->chunk_limit) \
_obstack_newchunk (__o, __len + 1); \
_obstack_memcpy (__o->next_free, (where), __len); \
@@ -392,7 +392,7 @@ __extension__ \
# define obstack_blank(OBSTACK,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
+ PTR_INT_TYPE __len = (length); \
if (__o->chunk_limit - __o->next_free < __len) \
_obstack_newchunk (__o, __len); \
obstack_blank_fast (__o, __len); \
@@ -532,7 +532,7 @@ __extension__ \
# define obstack_free(h,obj) \
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
(((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
- ? (int) ((h)->next_free = (h)->object_base \
+ ? (PTR_INT_TYPE) ((h)->next_free = (h)->object_base \
= (h)->temp + (char *) (h)->chunk) \
: (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
diff -u -rup gdb-6.6-orig/libiberty/obstack.c gdb-6.6/libiberty/obstack.c
--- gdb-6.6-orig/libiberty/obstack.c 2005-05-10 11:33:33.000000000 -0400
+++ gdb-6.6/libiberty/obstack.c 2007-03-12 09:40:16.000000000 -0400
@@ -44,9 +44,11 @@
#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
#include <gnu-versions.h>
#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
+#if 0 /* 64-bit obstack is not compatible with any glibc implementation. */
#define ELIDE_CODE
#endif
#endif
+#endif
#ifndef ELIDE_CODE
@@ -139,7 +141,7 @@ struct obstack *_obstack;
free up some memory, then call this again. */
int
-_obstack_begin (struct obstack *h, int size, int alignment,
+_obstack_begin (struct obstack *h, PTR_INT_TYPE size, int alignment,
POINTER (*chunkfun) (long), void (*freefun) (void *))
{
register struct _obstack_chunk *chunk; /* points to new chunk */
@@ -183,7 +185,7 @@ _obstack_begin (struct obstack *h, int s
}
int
-_obstack_begin_1 (struct obstack *h, int size, int alignment,
+_obstack_begin_1 (struct obstack *h, PTR_INT_TYPE size, int alignment,
POINTER (*chunkfun) (POINTER, long),
void (*freefun) (POINTER, POINTER), POINTER arg)
{
@@ -235,7 +237,7 @@ _obstack_begin_1 (struct obstack *h, int
to the beginning of the new one. */
void
-_obstack_newchunk (struct obstack *h, int length)
+_obstack_newchunk (struct obstack *h, PTR_INT_TYPE length)
{
register struct _obstack_chunk *old_chunk = h->chunk;
register struct _obstack_chunk *new_chunk;
@@ -388,11 +390,11 @@ obstack_free (struct obstack *h, POINTER
abort ();
}
-int
+PTR_INT_TYPE
_obstack_memory_used (struct obstack *h)
{
register struct _obstack_chunk* lp;
- register int nbytes = 0;
+ register PTR_INT_TYPE nbytes = 0;
for (lp = h->chunk; lp != 0; lp = lp->prev)
{
@@ -421,6 +423,7 @@ print_and_abort (void)
}
#if 0
+/* These functions are now broken for 64-bit obstack! */
/* These are now turned off because the applications do not use it
and it uses bcopy via obstack_grow, which causes trouble on sysV. */

View File

@ -11,7 +11,7 @@ Name: gdb
Version: 6.6
# The release always contains a leading reserved number, start it at 1.
Release: 4%{?dist}
Release: 5%{?dist}
License: GPL
Group: Development/Debuggers
@ -308,6 +308,9 @@ Patch232: gdb-6.6-upstream.patch
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch
# Temporary support for shared libraries >2GB on 64bit hosts. (BZ 231832)
Patch235: gdb-6.3-bz231832-obstack-2gb.patch
BuildRequires: ncurses-devel glibc-devel gcc make gzip texinfo dejagnu gettext
BuildRequires: flex bison sharutils
@ -433,6 +436,7 @@ and printing their data.
%patch231 -p1
%patch232 -p1
%patch234 -p1
%patch235 -p1
# Change the version that gets printed at GDB startup, so it is RedHat
# specific.
@ -595,6 +599,9 @@ fi
# don't include the files in include, they are part of binutils
%changelog
* Mon Mar 12 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.6-5
- Temporary support for shared libraries >2GB on 64bit hosts. (BZ 231832)
* Sun Feb 25 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.6-4
- Backport + testcase for PPC Power6/DFP instructions disassembly (BZ 230000).