--- ./include/obstack.h_orig	2016-02-10 02:07:42.000000000 -0600
+++ ./include/obstack.h	2016-02-10 02:18:51.000000000 -0600
@@ -186,52 +186,52 @@
 
 /* Declare the external functions we use; they are in obstack.c.  */
 
-extern void _obstack_newchunk (struct obstack *, int);
+extern void _obstack_newchunk (struct obstack *, long);
 extern void _obstack_free (struct obstack *, void *);
-extern int _obstack_begin (struct obstack *, int, int,
+extern long _obstack_begin (struct obstack *, long, long,
 			    void *(*) (long), void (*) (void *));
-extern int _obstack_begin_1 (struct obstack *, int, int,
+extern long _obstack_begin_1 (struct obstack *, long, long,
 			     void *(*) (void *, long),
 			     void (*) (void *, void *), void *);
-extern int _obstack_memory_used (struct obstack *);
+extern long _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, long 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, long size);
+void * obstack_copy0 (struct obstack *obstack, void *address, long size);
 
 void obstack_free (struct obstack *obstack, void *block);
 
-void obstack_blank (struct obstack *obstack, int size);
+void obstack_blank (struct obstack *obstack, long 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, long size);
+void obstack_grow0 (struct obstack *obstack, void *data, long size);
 
-void obstack_1grow (struct obstack *obstack, int data_char);
+void obstack_1grow (struct obstack *obstack, long data_char);
 void obstack_ptr_grow (struct obstack *obstack, void *data);
-void obstack_int_grow (struct obstack *obstack, int data);
+void obstack_int_grow (struct obstack *obstack, long data);
 
 void * obstack_finish (struct obstack *obstack);
 
-int obstack_object_size (struct obstack *obstack);
+long obstack_object_size (struct obstack *obstack);
 
-int obstack_room (struct obstack *obstack);
-void obstack_make_room (struct obstack *obstack, int size);
-void obstack_1grow_fast (struct obstack *obstack, int data_char);
+long obstack_room (struct obstack *obstack);
+void obstack_make_room (struct obstack *obstack, long size);
+void obstack_1grow_fast (struct obstack *obstack, long 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_int_grow_fast (struct obstack *obstack, long data);
+void obstack_blank_fast (struct obstack *obstack, long 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);
+long obstack_alignment_mask (struct obstack *obstack);
+long obstack_chunk_size (struct obstack *obstack);
+long 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
@@ -316,7 +316,7 @@
 # define obstack_make_room(OBSTACK,length)				\
 __extension__								\
 ({ struct obstack *__o = (OBSTACK);					\
-   int __len = (length);						\
+   long __len = (length);						\
    if (__o->chunk_limit - __o->next_free < __len)			\
      _obstack_newchunk (__o, __len);					\
    (void) 0; })
@@ -329,7 +329,7 @@
 # define obstack_grow(OBSTACK,where,length)				\
 __extension__								\
 ({ struct obstack *__o = (OBSTACK);					\
-   int __len = (length);						\
+   long __len = (length);						\
    if (__o->next_free + __len > __o->chunk_limit)			\
      _obstack_newchunk (__o, __len);					\
    _obstack_memcpy (__o->next_free, (where), __len);			\
@@ -339,7 +339,7 @@
 # define obstack_grow0(OBSTACK,where,length)				\
 __extension__								\
 ({ struct obstack *__o = (OBSTACK);					\
-   int __len = (length);						\
+   long __len = (length);						\
    if (__o->next_free + __len + 1 > __o->chunk_limit)			\
      _obstack_newchunk (__o, __len + 1);				\
    _obstack_memcpy (__o->next_free, (where), __len);			\
@@ -390,7 +390,7 @@
 # define obstack_blank(OBSTACK,length)					\
 __extension__								\
 ({ struct obstack *__o = (OBSTACK);					\
-   int __len = (length);						\
+   long __len = (length);						\
    if (__o->chunk_limit - __o->next_free < __len)			\
      _obstack_newchunk (__o, __len);					\
    obstack_blank_fast (__o, __len);					\
--- ./libiberty/obstack.c_orig	2016-02-10 01:08:25.000000000 -0600
+++ ./libiberty/obstack.c	2016-02-10 02:20:39.000000000 -0600
@@ -138,8 +138,8 @@
    To recover from an out of memory error,
    free up some memory, then call this again.  */
 
-int
-_obstack_begin (struct obstack *h, int size, int alignment,
+long
+_obstack_begin (struct obstack *h, long size, long alignment,
                 POINTER (*chunkfun) (long), void (*freefun) (void *))
 {
   register struct _obstack_chunk *chunk; /* points to new chunk */
@@ -182,8 +182,8 @@
   return 1;
 }
 
-int
-_obstack_begin_1 (struct obstack *h, int size, int alignment,
+long
+_obstack_begin_1 (struct obstack *h, long size, long alignment,
                   POINTER (*chunkfun) (POINTER, long),
                   void (*freefun) (POINTER, POINTER), POINTER arg)
 {
@@ -235,7 +235,7 @@
    to the beginning of the new one.  */
 
 void
-_obstack_newchunk (struct obstack *h, int length)
+_obstack_newchunk (struct obstack *h, long length)
 {
   register struct _obstack_chunk *old_chunk = h->chunk;
   register struct _obstack_chunk *new_chunk;
@@ -388,11 +388,11 @@
     abort ();
 }
 
-int
+long
 _obstack_memory_used (struct obstack *h)
 {
   register struct _obstack_chunk* lp;
-  register int nbytes = 0;
+  register long nbytes = 0;
 
   for (lp = h->chunk; lp != 0; lp = lp->prev)
     {
