This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

Re: problem with fill on IA64 linker


On Wed, Feb 13, 2002 at 01:57:19PM -0800, Lowney, Geoff wrote:
[about the fact that ld doesn't handle the ia64 NOP, 128 bits wide,
 in padding or fills.]

OK, here we go.  Any length fill pattern when the pattern is specified
as a hex number.  Leading zeros are OK and become part of the pattern.
No expressions allowed;  Any sort of expression, including enclosing
parentheses or unary '+', will result in the old behaviour of a four
byte repeated value.

When modifying ldlex.l, I noticed that numbers with a leading '$' are
hex in one case, decimal in another.  Anyone know for sure if this is
a bug?  It certainly looks like it from the lex string, so I "fixed"
this too.  Presumably "$<hex digits>" is for MRI compatibility..

include/ChangeLog
	Support arbitrary length fill patterns.
	* bfdlink.h (enum bfd_link_order_type): Remove bfd_fill_link_order.
	(struct bfd_link_order): Remove fill.  Add data.size.

bfd/ChangeLog
	Support arbitrary length fill patterns.
	* linker.c (bfd_new_link_order): Zero all fields with bfd_zalloc.
	(_bfd_default_link_order): Remove bfd_fill_link_order code.
	Call default_data_link_order.
	(default_fill_link_order): Delete.
	(default_data_link_order): New function.
	* elf32-mips.c (_bfd_mips_elf_final_link): Replace occurrences
	of bfd_fill_link_order with bfd_data_link_order.
	* elf64-alpha.c (elf64_alpha_final_link): Likewise.
	* elf64-mips.c (mips_elf64_final_link): Likewise.

ld/ChangeLog
	Support arbitrary length fill patterns.
	* ldexp.h (etree_value_type): Add "str" field.
	(union etree_union): Add "str" to "value" struct.
	(exp_bigintop): Declare.
	(exp_get_fill): Declare.
	* ldexp.c: Include "safe-ctype.h".
	(exp_intop): Set value.str to NULL.
	(exp_bigintop): New function.
	(new_rel): Pass in "str", and set new.str from it.
	(new_rel_from_section): Set new.str to NULL.
	(fold_name): Adjust calls to new_rel.
	(exp_fold_tree): Likewise.
	(exp_get_fill): New function.
	* ldgram.y (struct big_int bigint, fill_type *fill): New.
	(INT): Returns a "bigint".  Adjust all code handling INTs.
	(fill_opt): Returns a "fill".
	(fill_exp): Split out of fill_opt, use for FILL.
	* lflang.h (struct _fill_type): New.
	(fill_type): Move typedef to ldexp.h.
	(lang_output_section_statement_type): "fill" is now a pointer.
	(lang_fill_statement_type): Likewise.
	(lang_padding_statement_type): Likewise.
	(lang_add_fill): Now takes a "fill_type *" param.
	(lang_leave_output_section_statement): Likewise.
	(lang_do_assignments): Likewise.
	(lang_size_sections): Likewise.
	(lang_leave_overlay_section): Likewise.
	(lang_leave_overlay): Likewise.
	* ldlang.c: Include ldgram.h after ldexp.h.
	(lang_output_section_statement_lookup): Adjust for fill_type change.
	(print_fill_statement): Likewise.
	(print_padding_statement): Likewise.
	(insert_pad): Now takes a "fill_type *" arg.
	(size_input_section): Likewise.
	(lang_size_sections_1): Likewise.
	(lang_size_sections): Likewise.
	(lang_do_assignments): Likewise.
	(lang_add_fill): Likewise.
	(lang_leave_output_section_statement): Likewise.
	(lang_leave_overlay_section): Likewise.
	(lang_leave_overlay): Likewise.
	Adjust all callers of the above function.
	* ldlex.l: Include ldgram.h after ldexp.h.  Allow hex numbers
	starting with "0X" as well as "0x".  Return bigint.str for hex
	numbers starting with "0x" or "0X", zero bigint.str otherwise.
	Always use base 16 for numbers starting with "$".
	* ldmain.c: Include ldgram.h after ldexp.h.
	* ldwrite.c (build_link_order): Use bfd_data_link_order in place
	of bfd_fill_link_order.
	* pe-dll.c: Adjust lang_do_assignments calls.
	* emultempl/elf32.em: Likewise.
	* emultempl/hppaelf.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/beos.em: Include ldgram.h after ldexp.h, adjust
	lang_add_assignment call.
	* emultempl/pe.em: Likewise.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

Index: include/bfdlink.h
===================================================================
RCS file: /cvs/src/src/include/bfdlink.h,v
retrieving revision 1.16
diff -u -p -r1.16 bfdlink.h
--- bfdlink.h	2001/12/13 11:09:33	1.16
+++ bfdlink.h	2002/02/15 00:21:34
@@ -1,5 +1,5 @@
 /* bfdlink.h -- header file for BFD link routines
-   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002
    Free Software Foundation, Inc.
    Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support.
 
@@ -446,7 +446,6 @@ enum bfd_link_order_type
 {
   bfd_undefined_link_order,	/* Undefined.  */
   bfd_indirect_link_order,	/* Built from a section.  */
-  bfd_fill_link_order,		/* Fill with a 16 bit constant.  */
   bfd_data_link_order,		/* Set to explicit data.  */
   bfd_section_reloc_link_order,	/* Relocate against a section.  */
   bfd_symbol_reloc_link_order	/* Relocate against a symbol.  */
@@ -480,13 +479,12 @@ struct bfd_link_order 
 	} indirect;
       struct
 	{
-	  /* Value to fill with.  */
-	  unsigned int value;
-	} fill;
-      struct
-	{
-	  /* Data to put into file.  The size field gives the number
-	     of bytes which this field points to.  */
+	  /* Size of contents, or zero when contents size == size
+	     within output section.
+	     A non-zero value allows filling of the output section
+	     with an arbitrary repeated pattern.  */
+	  unsigned int size;
+	  /* Data to put into file.  */
 	  bfd_byte *contents;
 	} data;
       struct
Index: bfd/linker.c
===================================================================
RCS file: /cvs/src/src/bfd/linker.c,v
retrieving revision 1.18
diff -u -p -r1.18 linker.c
--- linker.c	2001/09/29 06:21:59	1.18
+++ linker.c	2002/02/14 23:22:03
@@ -1,5 +1,5 @@
 /* linker.c -- BFD linker routines
-   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
    Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support
 
@@ -426,7 +426,7 @@ static void set_symbol_from_hash
   PARAMS ((asymbol *, struct bfd_link_hash_entry *));
 static boolean generic_add_output_symbol
   PARAMS ((bfd *, size_t *psymalloc, asymbol *));
-static boolean default_fill_link_order
+static boolean default_data_link_order
   PARAMS ((bfd *, struct bfd_link_info *, asection *,
 	   struct bfd_link_order *));
 static boolean default_indirect_link_order
@@ -2608,14 +2608,13 @@ bfd_new_link_order (abfd, section)
      asection *section;
 {
   bfd_size_type amt = sizeof (struct bfd_link_order);
-  struct bfd_link_order *new = (struct bfd_link_order *) bfd_alloc (abfd, amt);
+  struct bfd_link_order *new;
+
+  new = (struct bfd_link_order *) bfd_zalloc (abfd, amt);
   if (!new)
     return NULL;
 
   new->type = bfd_undefined_link_order;
-  new->offset = 0;
-  new->size = 0;
-  new->next = (struct bfd_link_order *) NULL;
 
   if (section->link_order_tail != (struct bfd_link_order *) NULL)
     section->link_order_tail->next = new;
@@ -2637,8 +2636,6 @@ _bfd_default_link_order (abfd, info, sec
      asection *sec;
      struct bfd_link_order *link_order;
 {
-  file_ptr loc;
-
   switch (link_order->type)
     {
     case bfd_undefined_link_order:
@@ -2649,29 +2646,23 @@ _bfd_default_link_order (abfd, info, sec
     case bfd_indirect_link_order:
       return default_indirect_link_order (abfd, info, sec, link_order,
 					  false);
-    case bfd_fill_link_order:
-      return default_fill_link_order (abfd, info, sec, link_order);
     case bfd_data_link_order:
-      loc = link_order->offset * bfd_octets_per_byte (abfd);
-      return bfd_set_section_contents (abfd, sec,
-				       (PTR) link_order->u.data.contents,
-				       loc, link_order->size);
+      return default_data_link_order (abfd, info, sec, link_order);
     }
 }
 
-/* Default routine to handle a bfd_fill_link_order.  */
+/* Default routine to handle a bfd_data_link_order.  */
 
 static boolean
-default_fill_link_order (abfd, info, sec, link_order)
+default_data_link_order (abfd, info, sec, link_order)
      bfd *abfd;
      struct bfd_link_info *info ATTRIBUTE_UNUSED;
      asection *sec;
      struct bfd_link_order *link_order;
 {
   bfd_size_type size;
-  unsigned char *space;
-  size_t i;
-  unsigned int fill;
+  size_t fill_size;
+  bfd_byte *fill;
   file_ptr loc;
   boolean result;
 
@@ -2680,25 +2671,38 @@ default_fill_link_order (abfd, info, sec
   size = link_order->size;
   if (size == 0)
     return true;
-
-  space = (unsigned char *) bfd_malloc (size);
-  if (space == NULL)
-    return false;
 
-  fill = link_order->u.fill.value;
-  for (i = 0; i < size; i += 4)
-    space[i] = fill >> 24;
-  for (i = 1; i < size; i += 4)
-    space[i] = fill >> 16;
-  for (i = 2; i < size; i += 4)
-    space[i] = fill >> 8;
-  for (i = 3; i < size; i += 4)
-    space[i] = fill;
+  fill = link_order->u.data.contents;
+  fill_size = link_order->u.data.size;
+  if (fill_size != 0 && fill_size < size)
+    {
+      bfd_byte *p;
+      fill = (bfd_byte *) bfd_malloc (size);
+      if (fill == NULL)
+	return false;
+      p = fill;
+      if (fill_size == 1)
+	memset (p, (int) link_order->u.data.contents[0], (size_t) size);
+      else
+	{
+	  do
+	    {
+	      memcpy (p, link_order->u.data.contents, fill_size);
+	      p += fill_size;
+	      size -= fill_size;
+	    }
+	  while (size >= fill_size);
+	  if (size != 0)
+	    memcpy (p, link_order->u.data.contents, (size_t) size);
+	  size = link_order->size;
+	}
+    }
 
   loc = link_order->offset * bfd_octets_per_byte (abfd);
-  result = bfd_set_section_contents (abfd, sec, space, loc, size);
+  result = bfd_set_section_contents (abfd, sec, fill, loc, size);
 
-  free (space);
+  if (fill != link_order->u.data.contents)
+    free (fill);
   return result;
 }
 
Index: bfd/elf32-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mips.c,v
retrieving revision 1.145
diff -u -p -r1.145 elf32-mips.c
--- elf32-mips.c	2002/02/09 04:40:18	1.145
+++ elf32-mips.c	2002/02/14 23:21:52
@@ -5271,7 +5271,7 @@ _bfd_mips_elf_final_link (abfd, info)
 
 	      if (p->type != bfd_indirect_link_order)
 		{
-		  if (p->type == bfd_fill_link_order)
+		  if (p->type == bfd_data_link_order)
 		    continue;
 		  abort ();
 		}
@@ -5398,7 +5398,7 @@ _bfd_mips_elf_final_link (abfd, info)
 
 	      if (p->type != bfd_indirect_link_order)
 		{
-		  if (p->type == bfd_fill_link_order)
+		  if (p->type == bfd_data_link_order)
 		    continue;
 		  abort ();
 		}
@@ -5554,7 +5554,7 @@ _bfd_mips_elf_final_link (abfd, info)
 
 		  if (p->type != bfd_indirect_link_order)
 		    {
-		      if (p->type == bfd_fill_link_order)
+		      if (p->type == bfd_data_link_order)
 			continue;
 		      abort ();
 		    }
@@ -5634,7 +5634,7 @@ _bfd_mips_elf_final_link (abfd, info)
 
 	      if (p->type != bfd_indirect_link_order)
 		{
-		  if (p->type == bfd_fill_link_order)
+		  if (p->type == bfd_data_link_order)
 		    continue;
 		  abort ();
 		}
Index: bfd/elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.56
diff -u -p -r1.56 elf64-alpha.c
--- elf64-alpha.c	2002/02/09 22:53:53	1.56
+++ elf64-alpha.c	2002/02/14 23:21:56
@@ -4105,7 +4105,7 @@ elf64_alpha_final_link (abfd, info)
 
 	      if (p->type != bfd_indirect_link_order)
 		{
-		  if (p->type == bfd_fill_link_order)
+		  if (p->type == bfd_data_link_order)
 		    continue;
 		  abort ();
 		}
Index: bfd/elf64-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-mips.c,v
retrieving revision 1.26
diff -u -p -r1.26 elf64-mips.c
--- elf64-mips.c	2002/01/05 13:11:31	1.26
+++ elf64-mips.c	2002/02/14 23:22:01
@@ -6518,7 +6518,7 @@ mips_elf64_final_link (abfd, info)
 
 	      if (p->type != bfd_indirect_link_order)
 		{
-		  if (p->type == bfd_fill_link_order)
+		  if (p->type == bfd_data_link_order)
 		    continue;
 		  abort ();
 		}
@@ -6655,7 +6655,7 @@ mips_elf64_final_link (abfd, info)
 
 		  if (p->type != bfd_indirect_link_order)
 		    {
-		      if (p->type == bfd_fill_link_order)
+		      if (p->type == bfd_data_link_order)
 			continue;
 		      abort ();
 		    }
@@ -6734,7 +6734,7 @@ mips_elf64_final_link (abfd, info)
 
 	      if (p->type != bfd_indirect_link_order)
 		{
-		  if (p->type == bfd_fill_link_order)
+		  if (p->type == bfd_data_link_order)
 		    continue;
 		  abort ();
 		}
Index: ld/ldexp.c
===================================================================
RCS file: /cvs/src/src/ld/ldexp.c,v
retrieving revision 1.11
diff -u -p -r1.11 ldexp.c
--- ldexp.c	2002/02/12 14:50:06	1.11
+++ ldexp.c	2002/02/14 23:22:06
@@ -1,6 +1,6 @@
 /* This module handles expression trees.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001
+   2001, 2002
    Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
 
@@ -39,6 +39,7 @@ Software Foundation, 59 Temple Place - S
 #include "ldgram.h"
 #include "ldlang.h"
 #include "libiberty.h"
+#include "safe-ctype.h"
 
 static void exp_print_token PARAMS ((token_code_type code));
 static void make_abs PARAMS ((etree_value_type *ptr));
@@ -46,7 +47,7 @@ static etree_value_type new_abs PARAMS (
 static void check PARAMS ((lang_output_section_statement_type *os,
 			   const char *name, const char *op));
 static etree_value_type new_rel
-  PARAMS ((bfd_vma value, lang_output_section_statement_type *section));
+  PARAMS ((bfd_vma, char *, lang_output_section_statement_type *section));
 static etree_value_type new_rel_from_section
   PARAMS ((bfd_vma value, lang_output_section_statement_type *section));
 static etree_value_type fold_binary
@@ -176,9 +177,22 @@ exp_intop (value)
   etree_type *new = (etree_type *) stat_alloc (sizeof (new->value));
   new->type.node_code = INT;
   new->value.value = value;
+  new->value.str = NULL;
   new->type.node_class = etree_value;
   return new;
+}
 
+etree_type *
+exp_bigintop (value, str)
+     bfd_vma value;
+     char *str;
+{
+  etree_type *new = (etree_type *) stat_alloc (sizeof (new->value));
+  new->type.node_code = INT;
+  new->value.value = value;
+  new->value.str = str;
+  new->type.node_class = etree_value;
+  return new;
 }
 
 /* Build an expression representing an unnamed relocateable value.  */
@@ -197,13 +211,15 @@ exp_relop (section, value)
 }
 
 static etree_value_type
-new_rel (value, section)
+new_rel (value, str, section)
      bfd_vma value;
+     char *str;
      lang_output_section_statement_type *section;
 {
   etree_value_type new;
   new.valid_p = true;
   new.value = value;
+  new.str = str;
   new.section = section;
   return new;
 }
@@ -216,6 +232,7 @@ new_rel_from_section (value, section)
   etree_value_type new;
   new.valid_p = true;
   new.value = value;
+  new.str = NULL;
   new.section = section;
 
   new.value -= section->bfd_section->vma;
@@ -450,6 +467,7 @@ fold_name (tree, current_section, alloca
 			 being linked with -R?  */
 		      result = new_rel ((h->u.def.value
 					 + h->u.def.section->output_offset),
+					NULL,
 					os);
 		    }
 		}
@@ -467,7 +485,7 @@ fold_name (tree, current_section, alloca
 
 	  os = lang_output_section_find (tree->name.name);
 	  check (os, tree->name.name, "ADDR");
-	  result = new_rel (0, os);
+	  result = new_rel (0, NULL, os);
 	}
       else
 	result = invalid ();
@@ -481,7 +499,7 @@ fold_name (tree, current_section, alloca
 	  os = lang_output_section_find (tree->name.name);
 	  check (os, tree->name.name, "LOADADDR");
 	  if (os->load_base == NULL)
-	    result = new_rel (0, os);
+	    result = new_rel (0, NULL, os);
 	  else
 	    result = exp_fold_tree_no_dot (os->load_base,
 					   abs_output_section,
@@ -532,7 +550,7 @@ exp_fold_tree (tree, current_section, al
   switch (tree->type.node_class)
     {
     case etree_value:
-      result = new_rel (tree->value.value, current_section);
+      result = new_rel (tree->value.value, tree->value.str, current_section);
       break;
 
     case etree_rel:
@@ -542,6 +560,7 @@ exp_fold_tree (tree, current_section, al
 	result = new_rel ((tree->rel.value
 			   + tree->rel.section->output_section->vma
 			   + tree->rel.section->output_offset),
+			  NULL,
 			  current_section);
       break;
 
@@ -1023,6 +1042,65 @@ exp_get_value_int (tree, def, name, allo
      lang_phase_type allocation_done;
 {
   return (int) exp_get_vma (tree, (bfd_vma) def, name, allocation_done);
+}
+
+fill_type *
+exp_get_fill (tree, def, name, allocation_done)
+     etree_type *tree;
+     fill_type *def;
+     char *name;
+     lang_phase_type allocation_done;
+{
+  fill_type *fill;
+  etree_value_type r;
+  size_t len;
+  unsigned int val;
+
+  if (tree == NULL)
+    return def;
+
+  r = exp_fold_tree_no_dot (tree, abs_output_section, allocation_done);
+  if (! r.valid_p && name != NULL)
+    einfo (_("%F%S nonconstant expression for %s\n"), name);
+
+  if (r.str != NULL && (len = strlen (r.str)) != 0)
+    {
+      unsigned char *dst;
+      unsigned char *s;
+      fill = (fill_type *) xmalloc ((len + 1) / 2 + sizeof (*fill) - 1);
+      fill->size = (len + 1) / 2;
+      dst = fill->data;
+      s = r.str;
+      val = 0;
+      do
+	{
+	  unsigned int digit;
+
+	  digit = *s++ - '0';
+	  if (digit > 9)
+	    digit = (digit - 'A' + '0' + 10) & 0xf;
+	  val <<= 4;
+	  val += digit;
+	  --len;
+	  if ((len & 1) == 0)
+	    {
+	      *dst++ = val;
+	      val = 0;
+	    }
+	}
+      while (len != 0);
+    }
+  else
+    {
+      fill = (fill_type *) xmalloc (4 + sizeof (*fill) - 1);
+      val = r.value;
+      fill->data[0] = (val >> 24) & 0xff;
+      fill->data[1] = (val >> 16) & 0xff;
+      fill->data[2] = (val >>  8) & 0xff;
+      fill->data[3] = (val >>  0) & 0xff;
+      fill->size = 4;
+    }
+  return fill;
 }
 
 bfd_vma
Index: ld/ldexp.h
===================================================================
RCS file: /cvs/src/src/ld/ldexp.h,v
retrieving revision 1.6
diff -u -p -r1.6 ldexp.h
--- ldexp.h	2002/02/12 14:50:06	1.6
+++ ldexp.h	2002/02/14 23:22:06
@@ -1,5 +1,5 @@
 /* ldexp.h -
-   Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001
+   Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
    This file is part of GLD, the Gnu Linker.
@@ -25,6 +25,7 @@
 /* The result of an expression tree */
 typedef struct {
   bfd_vma value;
+  char *str;
   struct lang_output_section_statement_struct *section;
   boolean valid_p;
 } etree_value_type;
@@ -60,21 +61,21 @@ typedef union etree_union {
   } trinary;
   struct {
     node_type type;
-    CONST char *dst;
+    const char *dst;
     union etree_union *src;
   } assign;
-
   struct {
     node_type type;
     union etree_union *child;
   } unary;
   struct {
     node_type type;
-    CONST char *name;
+    const char *name;
   } name;
   struct {
     node_type type;
     bfd_vma value;
+    char *str;
   } value;
   struct {
     node_type type;
@@ -98,7 +99,10 @@ extern struct exp_data_seg {
   bfd_vma base, end, pagesize;
 } exp_data_seg;
 
+typedef struct _fill_type fill_type;
+
 etree_type *exp_intop PARAMS ((bfd_vma));
+etree_type *exp_bigintop PARAMS ((bfd_vma, char *));
 etree_type *exp_relop PARAMS ((asection *, bfd_vma));
 etree_value_type invalid PARAMS ((void));
 etree_value_type exp_fold_tree PARAMS ((etree_type *, struct
@@ -108,13 +112,15 @@ etree_value_type exp_fold_tree PARAMS ((
 etree_type *exp_binop PARAMS ((int, etree_type *, etree_type *));
 etree_type *exp_trinop PARAMS ((int,etree_type *, etree_type *, etree_type *));
 etree_type *exp_unop PARAMS ((int, etree_type *));
-etree_type *exp_nameop PARAMS ((int, CONST char *));
-etree_type *exp_assop PARAMS ((int, CONST char *, etree_type *));
+etree_type *exp_nameop PARAMS ((int, const char *));
+etree_type *exp_assop PARAMS ((int, const char *, etree_type *));
 etree_type *exp_provide PARAMS ((const char *, etree_type *));
 etree_type *exp_assert PARAMS ((etree_type *, const char *));
 void exp_print_tree PARAMS ((etree_type *));
 bfd_vma exp_get_vma PARAMS ((etree_type *, bfd_vma, char *, lang_phase_type));
 int exp_get_value_int PARAMS ((etree_type *, int, char *, lang_phase_type));
+fill_type *exp_get_fill PARAMS ((etree_type *, fill_type *, char *,
+				 lang_phase_type));
 bfd_vma exp_get_abs_int PARAMS ((etree_type *, int, char *, lang_phase_type));
 
 #endif
Index: ld/ldgram.y
===================================================================
RCS file: /cvs/src/src/ld/ldgram.y,v
retrieving revision 1.18
diff -u -p -r1.18 ldgram.y
--- ldgram.y	2002/02/14 04:24:33	1.18
+++ ldgram.y	2002/02/14 23:22:06
@@ -1,6 +1,6 @@
 /* A YACC grammar to parse a superset of the AT&T linker scripting language.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001 Free Software Foundation, Inc.
+   2001, 2002 Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
 
 This file is part of GNU ld.
@@ -66,6 +66,12 @@ static int error_index;
 %}
 %union {
   bfd_vma integer;
+  struct big_int
+    {
+      bfd_vma integer;
+      char *str;
+    } bigint;
+  fill_type *fill;
   char *name;
   const char *cname;
   struct wildcard_spec wildcard;
@@ -89,14 +95,14 @@ static int error_index;
 
 %type <etree> exp opt_exp_with_type mustbe_exp opt_at phdr_type phdr_val
 %type <etree> opt_exp_without_type
-%type <integer> fill_opt
+%type <fill> fill_opt fill_exp
 %type <name_list> exclude_name_list
 %type <wildcard_list> file_NAME_list
 %type <name> memspec_opt casesymlist
 %type <name> memspec_at_opt
 %type <cname> wildcard_name
 %type <wildcard> wildcard_spec
-%token <integer> INT  
+%token <bigint> INT  
 %token <name> NAME LNAME
 %type <integer> length
 %type <phdr> phdr_qualifiers
@@ -230,11 +236,11 @@ mri_script_command:
 	|	ALIAS NAME ',' NAME
 			{ mri_alias($2,$4,0);}
 	|	ALIAS NAME ',' INT
-			{ mri_alias($2,0,(int) $4);}
+			{ mri_alias ($2, 0, (int) $4.integer); }
 	|	BASE     exp
 			{ mri_base($2); }
-        |       TRUNCATE INT
-		{  mri_truncate((unsigned int) $2); }
+	|	TRUNCATE INT
+		{ mri_truncate ((unsigned int) $2.integer); }
 	|	CASE casesymlist
 	|	EXTERN extern_name_list
 	|	INCLUDE filename
@@ -512,16 +518,12 @@ statement:
 	| input_section_spec
         | length '(' mustbe_exp ')'
         	        {
-			lang_add_data((int) $1,$3);
+			  lang_add_data ((int) $1, $3);
 			}
   
-	| FILL '(' mustbe_exp ')'
+	| FILL '(' fill_exp ')'
 			{
-			  lang_add_fill
-			    (exp_get_value_int($3,
-					       0,
-					       "fill value",
-					       lang_first_phase_enum));
+			  lang_add_fill ($3);
 			}
 	;
 
@@ -548,18 +550,21 @@ length:
 			{ $$ = $1; }
 	;
 
-fill_opt:
-          '=' mustbe_exp
+fill_exp:
+	mustbe_exp
 		{
-		  $$ =	 exp_get_value_int($2,
-					   0,
-					   "fill value",
-					   lang_first_phase_enum);
+		  $$ = exp_get_fill ($1,
+				     0,
+				     "fill value",
+				     lang_first_phase_enum);
 		}
-	| 	{ $$ = 0; }
 	;
 
-		
+fill_opt:
+	  '=' fill_exp
+		{ $$ = $2; }
+	| 	{ $$ = (fill_type *) 0; }
+	;
 
 assign_op:
 		PLUSEQ
@@ -781,7 +786,7 @@ exp	:
 	|	DEFINED '(' NAME ')'
 			{ $$ = exp_nameop(DEFINED, $3); }
 	|	INT
-			{ $$ = exp_intop($1); }
+			{ $$ = exp_bigintop ($1.integer, $1.str); }
         |	SIZEOF_HEADERS
 			{ $$ = exp_nameop(SIZEOF_HEADERS,0); }
 
Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.74
diff -u -p -r1.74 ldlang.c
--- ldlang.c	2002/02/14 04:24:33	1.74
+++ ldlang.c	2002/02/14 23:22:09
@@ -29,9 +29,9 @@ Software Foundation, 59 Temple Place - S
 
 #include "ld.h"
 #include "ldmain.h"
-#include "ldgram.h"
 #include "ldexp.h"
 #include "ldlang.h"
+#include "ldgram.h"
 #include "ldlex.h"
 #include "ldmisc.h"
 #include "ldctor.h"
@@ -119,11 +119,11 @@ static void print_statement_list
   PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *));
 static void print_statements PARAMS ((void));
 static void insert_pad
-  PARAMS ((lang_statement_union_type **, fill_type,
+  PARAMS ((lang_statement_union_type **, fill_type *,
 	   unsigned int, asection *, bfd_vma));
 static bfd_vma size_input_section
   PARAMS ((lang_statement_union_type **, lang_output_section_statement_type *,
-	   fill_type, bfd_vma));
+	   fill_type *, bfd_vma));
 static void lang_finish PARAMS ((void));
 static void ignore_bfd_errors PARAMS ((const char *, ...));
 static void lang_check PARAMS ((void));
@@ -152,7 +152,7 @@ static void os_region_check
 	   struct memory_region_struct *, etree_type *, bfd_vma));
 static bfd_vma lang_size_sections_1
   PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *,
-	   lang_statement_union_type **, fill_type, bfd_vma, boolean *));
+	   lang_statement_union_type **, fill_type *, bfd_vma, boolean *));
 
 typedef void (*callback_t) PARAMS ((lang_wild_statement_type *,
 				    struct wildcard_list *,
@@ -721,7 +721,7 @@ lang_output_section_statement_lookup (na
 	new_stat (lang_output_section_statement, stat_ptr);
       lookup->region = (lang_memory_region_type *) NULL;
       lookup->lma_region = (lang_memory_region_type *) NULL;
-      lookup->fill = 0;
+      lookup->fill = (fill_type *) 0;
       lookup->block_value = 1;
       lookup->name = name;
 
@@ -2313,7 +2313,12 @@ static void
 print_fill_statement (fill)
      lang_fill_statement_type *fill;
 {
-  fprintf (config.map_file, " FILL mask 0x%x\n", fill->fill);
+  size_t size;
+  unsigned char *p;
+  fputs (" FILL mask 0x", config.map_file);
+  for (p = fill->fill->data, size = fill->fill->size; size != 0; p++, size--)
+    fprintf (config.map_file, "%02x", *p);
+  fputs ("\n", config.map_file);
 }
 
 static void
@@ -2442,10 +2447,15 @@ print_padding_statement (s)
   addr = s->output_offset;
   if (s->output_section != NULL)
     addr += s->output_section->vma;
-  minfo ("0x%V %W", addr, s->size);
+  minfo ("0x%V %W ", addr, s->size);
 
-  if (s->fill != 0)
-    minfo (" %u", s->fill);
+  if (s->fill->size != 0)
+    {
+      size_t size;
+      unsigned char *p;
+      for (p = s->fill->data, size = s->fill->size; size != 0; p++, size--)
+	fprintf (config.map_file, "%02x", *p);
+    }
 
   print_nl ();
 
@@ -2636,11 +2646,12 @@ dprint_statement (s, n)
 static void
 insert_pad (ptr, fill, alignment_needed, output_section, dot)
      lang_statement_union_type **ptr;
-     fill_type fill;
+     fill_type *fill;
      unsigned int alignment_needed;
      asection *output_section;
      bfd_vma dot;
 {
+  static fill_type zero_fill = { 1, { 0 } };
   lang_statement_union_type *pad;
 
   pad = ((lang_statement_union_type *)
@@ -2661,6 +2672,8 @@ insert_pad (ptr, fill, alignment_needed,
       *ptr = pad;
       pad->header.type = lang_padding_statement_enum;
       pad->padding_statement.output_section = output_section;
+      if (fill == (fill_type *) 0)
+	fill = &zero_fill;
       pad->padding_statement.fill = fill;
     }
   pad->padding_statement.output_offset = dot - output_section->vma;
@@ -2674,7 +2687,7 @@ static bfd_vma
 size_input_section (this_ptr, output_section_statement, fill, dot)
      lang_statement_union_type **this_ptr;
      lang_output_section_statement_type *output_section_statement;
-     fill_type fill;
+     fill_type *fill;
      bfd_vma dot;
 {
   lang_input_section_type *is = &((*this_ptr)->input_section);
@@ -2831,7 +2844,7 @@ lang_size_sections_1 (s, output_section_
      lang_statement_union_type *s;
      lang_output_section_statement_type *output_section_statement;
      lang_statement_union_type **prev;
-     fill_type fill;
+     fill_type *fill;
      bfd_vma dot;
      boolean *relax;
 {
@@ -3207,7 +3220,7 @@ lang_size_sections (s, output_section_st
      lang_statement_union_type *s;
      lang_output_section_statement_type *output_section_statement;
      lang_statement_union_type **prev;
-     fill_type fill;
+     fill_type *fill;
      bfd_vma dot;
      boolean *relax;
 {
@@ -3242,7 +3255,7 @@ bfd_vma
 lang_do_assignments (s, output_section_statement, fill, dot)
      lang_statement_union_type *s;
      lang_output_section_statement_type *output_section_statement;
-     fill_type fill;
+     fill_type *fill;
      bfd_vma dot;
 {
   unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
@@ -4211,7 +4224,7 @@ lang_process ()
 	     section sizes.  */
 	  lang_do_assignments (statement_list.head,
 			       abs_output_section,
-			       (fill_type) 0, (bfd_vma) 0);
+			       (fill_type *) 0, (bfd_vma) 0);
 
 	  /* Perform another relax pass - this time we know where the
 	     globals are, so can make better guess.  */
@@ -4235,7 +4248,7 @@ lang_process ()
 
   lang_do_assignments (statement_list.head,
 		       abs_output_section,
-		       (fill_type) 0, (bfd_vma) 0);
+		       (fill_type *) 0, (bfd_vma) 0);
 
   /* Make sure that the section addresses make sense.  */
   if (! link_info.relocateable
@@ -4351,13 +4364,13 @@ lang_add_map (name)
 }
 
 void
-lang_add_fill (exp)
-     int exp;
+lang_add_fill (fill)
+     fill_type *fill;
 {
   lang_fill_statement_type *new = new_stat (lang_fill_statement,
 					    stat_ptr);
 
-  new->fill = exp;
+  new->fill = fill;
 }
 
 void
@@ -4444,7 +4457,7 @@ lang_float (maybe)
 
 void
 lang_leave_output_section_statement (fill, memspec, phdrs, lma_memspec)
-     bfd_vma fill;
+     fill_type *fill;
      const char *memspec;
      struct lang_output_section_phdr_list *phdrs;
      const char *lma_memspec;
@@ -4822,7 +4835,7 @@ lang_enter_overlay_section (name)
 
 void
 lang_leave_overlay_section (fill, phdrs)
-     bfd_vma fill;
+     fill_type *fill;
      struct lang_output_section_phdr_list *phdrs;
 {
   const char *name;
@@ -4864,7 +4877,7 @@ lang_leave_overlay_section (fill, phdrs)
 
 void
 lang_leave_overlay (fill, memspec, phdrs, lma_memspec)
-     bfd_vma fill;
+     fill_type *fill;
      const char *memspec;
      struct lang_output_section_phdr_list *phdrs;
      const char *lma_memspec;
@@ -4894,7 +4907,7 @@ lang_leave_overlay (fill, memspec, phdrs
     {
       struct overlay_list *next;
 
-      if (fill != 0 && l->os->fill == 0)
+      if (fill != (fill_type *) 0 && l->os->fill == (fill_type *) 0)
 	l->os->fill = fill;
 
       /* Assign a region to the sections, if one has been specified.
Index: ld/ldlang.h
===================================================================
RCS file: /cvs/src/src/ld/ldlang.h,v
retrieving revision 1.17
diff -u -p -r1.17 ldlang.h
--- ldlang.h	2002/02/14 04:24:33	1.17
+++ ldlang.h	2002/02/14 23:22:11
@@ -32,7 +32,10 @@ typedef enum {
   lang_input_file_is_file_enum
 } lang_input_file_enum_type;
 
-typedef unsigned int fill_type;
+struct _fill_type {
+  size_t size;
+  unsigned char data[1];
+};
 
 typedef struct statement_list {
   union lang_statement_union *head;
@@ -125,7 +128,7 @@ typedef struct lang_output_section_state
   struct memory_region_struct *region;
   struct memory_region_struct *lma_region;
   size_t block_value;
-  fill_type fill;
+  fill_type *fill;
 
   int subsection_alignment;	/* alignment of components */
   int section_alignment;	/* alignment of start of section */
@@ -145,7 +148,7 @@ typedef struct {
 
 typedef struct {
   lang_statement_header_type header;
-  fill_type fill;
+  fill_type *fill;
   int size;
   asection *output_section;
 } lang_fill_statement_type;
@@ -275,7 +278,7 @@ typedef struct {
   bfd_vma output_offset;
   size_t size;
   asection *output_section;
-  fill_type fill;
+  fill_type *fill;
 } lang_padding_statement_type;
 
 /* A group statement collects a set of libraries together.  The
@@ -385,13 +388,13 @@ extern void lang_add_target PARAMS ((con
 extern void lang_add_wild
   PARAMS ((struct wildcard_spec *, struct wildcard_list *, boolean));
 extern void lang_add_map PARAMS ((const char *));
-extern void lang_add_fill PARAMS ((int));
+extern void lang_add_fill PARAMS ((fill_type *));
 extern lang_assignment_statement_type * lang_add_assignment PARAMS ((union etree_union *));
 extern void lang_add_attribute PARAMS ((enum statement_enum));
 extern void lang_startup PARAMS ((const char *));
 extern void lang_float PARAMS ((enum bfd_boolean));
 extern void lang_leave_output_section_statement
-  PARAMS ((bfd_vma, const char *, struct lang_output_section_phdr_list *,
+  PARAMS ((fill_type *, const char *, struct lang_output_section_phdr_list *,
            const char *));
 extern void lang_abs_symbol_at_end_of PARAMS ((const char *, const char *));
 extern void lang_abs_symbol_at_beginning_of PARAMS ((const char *,
@@ -407,7 +410,7 @@ extern void lang_reset_memory_regions PA
 extern bfd_vma lang_do_assignments
   PARAMS ((lang_statement_union_type * s,
 	   lang_output_section_statement_type *output_section_statement,
-	   fill_type fill,
+	   fill_type *fill,
 	   bfd_vma dot));
 
 #define LANG_FOR_EACH_INPUT_STATEMENT(statement)		\
@@ -441,7 +444,7 @@ extern void dprint_statement PARAMS ((la
 extern bfd_vma lang_size_sections
   PARAMS ((lang_statement_union_type *s,
 	   lang_output_section_statement_type *output_section_statement,
-	   lang_statement_union_type **prev, fill_type fill,
+	   lang_statement_union_type **prev, fill_type *fill,
 	   bfd_vma dot, boolean *relax));
 extern void lang_enter_group PARAMS ((void));
 extern void lang_leave_group PARAMS ((void));
@@ -456,9 +459,9 @@ extern void lang_add_nocrossref PARAMS (
 extern void lang_enter_overlay PARAMS ((etree_type *, etree_type *, int));
 extern void lang_enter_overlay_section PARAMS ((const char *));
 extern void lang_leave_overlay_section
-  PARAMS ((bfd_vma, struct lang_output_section_phdr_list *));
+  PARAMS ((fill_type *, struct lang_output_section_phdr_list *));
 extern void lang_leave_overlay
-  PARAMS ((bfd_vma, const char *, struct lang_output_section_phdr_list *,
+  PARAMS ((fill_type *, const char *, struct lang_output_section_phdr_list *,
            const char *));
 
 extern struct bfd_elf_version_tree *lang_elf_version_info;
Index: ld/ldlex.l
===================================================================
RCS file: /cvs/src/src/ld/ldlex.l,v
retrieving revision 1.12
diff -u -p -r1.12 ldlex.l
--- ldlex.l	2002/02/14 04:24:33	1.12
+++ ldlex.l	2002/02/15 01:59:49
@@ -38,10 +38,10 @@ This was written by steve chamberlain
 #include "sysdep.h"
 #include "safe-ctype.h"
 #include "ld.h"
-#include "ldgram.h"
 #include "ldmisc.h"
 #include "ldexp.h"
 #include "ldlang.h"
+#include "ldgram.h"
 #include "ldfile.h"
 #include "ldlex.h"
 #include "ldmain.h"
@@ -153,6 +153,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?
 
 <MRI,EXPRESSION>"$"([0-9A-Fa-f])+ {
   				yylval.integer = bfd_scan_vma (yytext+1, 0,16);
+				yylval.bigint.str = (char *) 0;
 				return INT;
 			}
 
@@ -178,20 +179,36 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?
 				   }
 				   yylval.integer = bfd_scan_vma (yytext, 0,
 								  ibase);
+				   yylval.bigint.str = (char *) 0;
 				   return INT;
 				 }
-<SCRIPT,DEFSYMEXP,MRI,BOTH,EXPRESSION>((("$"|"0x")([0-9A-Fa-f])+)|(([0-9])+))(M|K|m|k)? {
+<SCRIPT,DEFSYMEXP,MRI,BOTH,EXPRESSION>((("$"|0[xX])([0-9A-Fa-f])+)|(([0-9])+))(M|K|m|k)? {
 				  char *s = yytext;
+				  int ibase = 0;
 
 				  if (*s == '$')
-				    ++s;
-				  yylval.integer = bfd_scan_vma (s, 0, 0);
+				    {
+				      ++s;
+				      ibase = 16;
+				    }
+				  yylval.integer = bfd_scan_vma (s, 0, ibase);
+				  yylval.bigint.str = (char *) 0;
 				  if (yytext[yyleng-1] == 'M'
 				      || yytext[yyleng-1] == 'm')
-				    yylval.integer *= 1024 * 1024;
-				  if (yytext[yyleng-1] == 'K' 
+				    {
+				      yylval.integer *= 1024 * 1024;
+				    }
+				  else if (yytext[yyleng-1] == 'K' 
 				      || yytext[yyleng-1]=='k')
-				    yylval.integer *= 1024;
+				    {
+				      yylval.integer *= 1024;
+				    }
+				  else if (yytext[0] == '0'
+					   && (yytext[1] == 'x'
+					       || yytext[1] == 'X'))
+				    {
+				      yylval.bigint.str = xstrdup (yytext + 2);
+				    }
 				  return INT;
 				}
 <BOTH,SCRIPT,EXPRESSION,MRI>"]"		{ RTOKEN(']');}
Index: ld/ldmain.c
===================================================================
RCS file: /cvs/src/src/ld/ldmain.c,v
retrieving revision 1.42
diff -u -p -r1.42 ldmain.c
--- ldmain.c	2002/02/10 19:12:13	1.42
+++ ldmain.c	2002/02/14 23:22:13
@@ -34,9 +34,9 @@ Software Foundation, 59 Temple Place - S
 #include "ldmain.h"
 #include "ldmisc.h"
 #include "ldwrite.h"
-#include "ldgram.h"
 #include "ldexp.h"
 #include "ldlang.h"
+#include "ldgram.h"
 #include "ldlex.h"
 #include "ldfile.h"
 #include "ldemul.h"
Index: ld/ldwrite.c
===================================================================
RCS file: /cvs/src/src/ld/ldwrite.c,v
retrieving revision 1.7
diff -u -p -r1.7 ldwrite.c
--- ldwrite.c	2001/03/13 06:14:27	1.7
+++ ldwrite.c	2002/02/14 23:22:13
@@ -1,5 +1,5 @@
 /* ldwrite.c -- write out the linked file
-   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000
+   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002
    Free Software Foundation, Inc.
    Written by Steve Chamberlain sac@cygnus.com
 
@@ -243,9 +243,10 @@ build_link_order (statement)
 		{
 		  /* We've got a never load section inside one which
 		     is going to be output, we'll change it into a
-		     fill link_order */
-		  link_order->type = bfd_fill_link_order;
-		  link_order->u.fill.value = 0;
+		     fill.  */
+		  link_order->type = bfd_data_link_order;
+		  link_order->u.data.contents = "";
+		  link_order->u.data.size = 1;
 		}
 	      else
 		{
@@ -274,10 +275,11 @@ build_link_order (statement)
 	if ((output_section->flags & SEC_HAS_CONTENTS) != 0)
 	  {
 	    link_order = bfd_new_link_order (output_bfd, output_section);
-	    link_order->type = bfd_fill_link_order;
+	    link_order->type = bfd_data_link_order;
 	    link_order->size = statement->padding_statement.size;
 	    link_order->offset = statement->padding_statement.output_offset;
-	    link_order->u.fill.value = statement->padding_statement.fill;
+	    link_order->u.data.contents = statement->padding_statement.fill->data;
+	    link_order->u.data.size = statement->padding_statement.fill->size;
 	  }
       }
       break;
Index: ld/pe-dll.c
===================================================================
RCS file: /cvs/src/src/ld/pe-dll.c,v
retrieving revision 1.37
diff -u -p -r1.37 pe-dll.c
--- pe-dll.c	2001/10/19 14:25:51	1.37
+++ pe-dll.c	2002/02/14 23:22:16
@@ -1,5 +1,5 @@
 /* Routines to help build PEI-format DLLs (Win32 etc)
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
    Written by DJ Delorie <dj@cygnus.com>
 
    This file is part of GLD, the Gnu Linker.
@@ -2437,7 +2437,7 @@ pe_dll_fill_sections (abfd, info)
       /* Do the assignments again.  */
       lang_do_assignments (stat_ptr->head,
 			   abs_output_section,
-			   (fill_type) 0, (bfd_vma) 0);
+			   (fill_type *) 0, (bfd_vma) 0);
     }
 
   fill_edata (abfd, info);
@@ -2471,7 +2471,7 @@ pe_exe_fill_sections (abfd, info)
       /* Do the assignments again.  */
       lang_do_assignments (stat_ptr->head,
 			   abs_output_section,
-			   (fill_type) 0, (bfd_vma) 0);
+			   (fill_type *) 0, (bfd_vma) 0);
     }
   reloc_s->contents = reloc_d;
 }
Index: ld/emultempl/beos.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/beos.em,v
retrieving revision 1.16
diff -u -p -r1.16 beos.em
--- beos.em	2001/09/18 10:10:21	1.16
+++ beos.em	2002/02/14 23:22:17
@@ -7,7 +7,7 @@ else
 fi
 cat >e${EMULATION_NAME}.c <<EOF
 /* This file is part of GLD, the Gnu Linker.
-   Copyright 1995, 1996, 1997, 1998, 2000, 2001
+   Copyright 1995, 1996, 1997, 1998, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
@@ -38,11 +38,11 @@ Foundation, Inc., 59 Temple Place - Suit
 #include "libiberty.h"
 #include "ld.h"
 #include "ldmain.h"
-#include "ldgram.h"
 #include "ldexp.h"
 #include "ldlang.h"
 #include "ldfile.h"
 #include "ldemul.h"
+#include "ldgram.h"
 #include "ldlex.h"
 #include "ldmisc.h"
 #include "ldctor.h"
@@ -416,7 +416,7 @@ gld_${EMULATION_NAME}_set_symbols()
   for (j = 0; init[j].ptr; j++)
     {
       long val = init[j].value;
-      lang_add_assignment (exp_assop ('=' ,init[j].symbol, exp_intop (val)));
+      lang_add_assignment (exp_assop ('=', init[j].symbol, exp_intop (val)));
       if (init[j].size == sizeof(short))
 	*(short *)init[j].ptr = val;
       else if (init[j].size == sizeof(int))
Index: ld/emultempl/elf32.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/elf32.em,v
retrieving revision 1.71
diff -u -p -r1.71 elf32.em
--- elf32.em	2002/02/05 06:52:17	1.71
+++ elf32.em	2002/02/14 23:22:19
@@ -1341,7 +1341,7 @@ gld${EMULATION_NAME}_finish ()
 
       /* Do the assignments again.  */
       lang_do_assignments (stat_ptr->head, abs_output_section,
-			   (fill_type) 0, (bfd_vma) 0);
+			   (fill_type *) 0, (bfd_vma) 0);
     }
 }
 EOF
Index: ld/emultempl/hppaelf.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/hppaelf.em,v
retrieving revision 1.20
diff -u -p -r1.20 hppaelf.em
--- hppaelf.em	2002/02/05 07:12:38	1.20
+++ hppaelf.em	2002/02/14 23:22:19
@@ -237,7 +237,7 @@ hppaelf_layout_sections_again ()
 
   /* Do the assignments again.  */
   lang_do_assignments (stat_ptr->head, abs_output_section,
-		       (fill_type) 0, (bfd_vma) 0);
+		       (fill_type *) 0, (bfd_vma) 0);
 }
 
 
Index: ld/emultempl/pe.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/pe.em,v
retrieving revision 1.58
diff -u -p -r1.58 pe.em
--- pe.em	2002/01/05 13:14:00	1.58
+++ pe.em	2002/02/14 23:22:21
@@ -9,7 +9,7 @@ rm -f e${EMULATION_NAME}.c
 (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
 cat >>e${EMULATION_NAME}.c <<EOF
 /* This file is part of GLD, the Gnu Linker.
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001
+   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
@@ -52,11 +52,11 @@ Foundation, Inc., 59 Temple Place - Suit
 #include "libiberty.h"
 #include "ld.h"
 #include "ldmain.h"
-#include "ldgram.h"
 #include "ldexp.h"
 #include "ldlang.h"
 #include "ldfile.h"
 #include "ldemul.h"
+#include "ldgram.h"
 #include "ldlex.h"
 #include "ldmisc.h"
 #include "ldctor.h"
@@ -708,7 +708,8 @@ gld_${EMULATION_NAME}_set_symbols ()
     {
       long val = init[j].value;
       lang_assignment_statement_type *rv;
-      rv = lang_add_assignment (exp_assop ('=' ,init[j].symbol, exp_intop (val)));
+      rv = lang_add_assignment (exp_assop ('=', init[j].symbol,
+					   exp_intop (val)));
       if (init[j].size == sizeof(short))
 	*(short *)init[j].ptr = val;
       else if (init[j].size == sizeof(int))
Index: ld/emultempl/ppc64elf.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/ppc64elf.em,v
retrieving revision 1.3
diff -u -p -r1.3 ppc64elf.em
--- ppc64elf.em	2002/02/10 10:55:23	1.3
+++ ppc64elf.em	2002/02/14 23:22:21
@@ -92,7 +92,7 @@ gld${EMULATION_NAME}_finish ()
 
       /* Do the assignments again.  */
       lang_do_assignments (stat_ptr->head, abs_output_section,
-			   (fill_type) 0, (bfd_vma) 0);
+			   (fill_type *) 0, (bfd_vma) 0);
     }
 
   if (! ppc64_elf_build_stubs (output_bfd, &link_info))


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