This is the mail archive of the binutils@sourceware.org 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]

link script output section type


DSECT, COPY, INFO and OVERLAY in section type all do the same thing
according to ld.texinfo, so we may as well simplify the code a little.

	* ldlang.h (enum section_type): Delete dsect_section, copy_section,
	info_section and overlay_section.  Add noalloc_section.
	* ldlang.c (lang_add_section): Adjust.
	* ldgram.y (type): Adjust.

Index: ld/ldlang.h
===================================================================
RCS file: /cvs/src/src/ld/ldlang.h,v
retrieving revision 1.60
diff -u -p -r1.60 ldlang.h
--- ld/ldlang.h	24 Dec 2005 07:48:30 -0000	1.60
+++ ld/ldlang.h	7 Jun 2006 04:28:43 -0000
@@ -108,11 +108,8 @@ typedef struct lang_output_statement_str
 enum section_type
 {
   normal_section,
-  dsect_section,
-  copy_section,
   noload_section,
-  info_section,
-  overlay_section
+  noalloc_section
 };
 
 /* This structure holds a list of program headers describing
Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.221
diff -u -p -r1.221 ldlang.c
--- ld/ldlang.c	6 Jun 2006 02:24:33 -0000	1.221
+++ ld/ldlang.c	7 Jun 2006 04:28:42 -0000
@@ -1962,10 +1962,7 @@ lang_add_section (lang_statement_list_ty
 	{
 	case normal_section:
 	  break;
-	case dsect_section:
-	case copy_section:
-	case info_section:
-	case overlay_section:
+	case noalloc_section:
 	  output->bfd_section->flags &= ~SEC_ALLOC;
 	  break;
 	case noload_section:
Index: ld/ldgram.y
===================================================================
RCS file: /cvs/src/src/ld/ldgram.y,v
retrieving revision 1.49
diff -u -p -r1.49 ldgram.y
--- ld/ldgram.y	30 May 2006 16:45:31 -0000	1.49
+++ ld/ldgram.y	7 Jun 2006 04:28:39 -0000
@@ -963,10 +963,10 @@ section:	NAME 		{ ldlex_expression(); }
 
 type:
 	   NOLOAD  { sectype = noload_section; }
-	|  DSECT   { sectype = dsect_section; }
-	|  COPY    { sectype = copy_section; }
-	|  INFO    { sectype = info_section; }
-	|  OVERLAY { sectype = overlay_section; }
+	|  DSECT   { sectype = noalloc_section; }
+	|  COPY    { sectype = noalloc_section; }
+	|  INFO    { sectype = noalloc_section; }
+	|  OVERLAY { sectype = noalloc_section; }
 	;
 
 atype:

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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