58725c
diff -rup binutils.orig/bfd/aoutx.h binutils-2.27/bfd/aoutx.h
58725c
--- binutils.orig/bfd/aoutx.h	2017-03-24 13:50:55.358188013 +0000
58725c
+++ binutils-2.27/bfd/aoutx.h	2017-03-24 14:26:38.438542134 +0000
58725c
@@ -2807,9 +2807,17 @@ NAME (aout, find_nearest_line) (bfd *abf
58725c
 	*filename_ptr = main_file_name;
58725c
       else
58725c
 	{
58725c
-	  sprintf (buf, "%s%s", directory_name, main_file_name);
58725c
-	  *filename_ptr = buf;
58725c
-	  buf += filelen + 1;
58725c
+	  if (buf == NULL)
58725c
+	    /* PR binutils/20891: In a corrupt input file both
58725c
+	       main_file_name and directory_name can be empty...  */
58725c
+	    * filename_ptr = NULL;
58725c
+	  else
58725c
+	    {
58725c
+	      snprintf (buf, filelen + 1, "%s%s", directory_name,
58725c
+			main_file_name);
58725c
+	      *filename_ptr = buf;
58725c
+	      buf += filelen + 1;
58725c
+	    }
58725c
 	}
58725c
     }
58725c
 
58725c
@@ -2818,6 +2826,13 @@ NAME (aout, find_nearest_line) (bfd *abf
58725c
       const char *function = func->name;
58725c
       char *colon;
58725c
 
58725c
+      if (buf == NULL)
58725c
+	{
58725c
+	  /* PR binutils/20892: In a corrupt input file func can be empty.  */
58725c
+	  * functionname_ptr = NULL;
58725c
+	  return TRUE;
58725c
+	}
58725c
+
58725c
       /* The caller expects a symbol name.  We actually have a
58725c
 	 function name, without the leading underscore.  Put the
58725c
 	 underscore back in, so that the caller gets a symbol name.  */
58725c
diff -rup binutils.orig/bfd/compress.c binutils-2.27/bfd/compress.c
58725c
--- binutils.orig/bfd/compress.c	2017-03-24 13:50:55.362187961 +0000
58725c
+++ binutils-2.27/bfd/compress.c	2017-03-24 14:17:49.075366778 +0000
58725c
@@ -292,7 +292,7 @@ bfd_get_full_section_contents (bfd *abfd
58725c
 	   SHF_COMPRESSED section.  */
58725c
 	compression_header_size = 12;
58725c
       if (!decompress_contents (compressed_buffer + compression_header_size,
58725c
-				sec->compressed_size, p, sz))
58725c
+				sec->compressed_size - compression_header_size, p, sz))
58725c
 	{
58725c
 	  bfd_set_error (bfd_error_bad_value);
58725c
 	  if (p != *ptr)
58725c
diff -rup binutils.orig/bfd/peicode.h binutils-2.27/bfd/peicode.h
58725c
--- binutils.orig/bfd/peicode.h	2017-03-24 13:50:55.374187806 +0000
58725c
+++ binutils-2.27/bfd/peicode.h	2017-03-24 14:22:36.326663483 +0000
58725c
@@ -1264,7 +1264,8 @@ pe_ILF_object_p (bfd * abfd)
58725c
     }
58725c
 
58725c
   symbol_name = (char *) ptr;
58725c
-  source_dll  = symbol_name + strlen (symbol_name) + 1;
58725c
+  /* See PR 20905 for an example of where the strnlen is necessary.  */
58725c
+  source_dll  = symbol_name + strnlen (symbol_name, size - 1) + 1;
58725c
 
58725c
   /* Verify that the strings are null terminated.  */
58725c
   if (ptr[size - 1] != 0
58725c
diff -rup binutils.orig/binutils/dwarf.c binutils-2.27/binutils/dwarf.c
58725c
--- binutils.orig/binutils/dwarf.c	2017-03-24 13:50:55.381187716 +0000
58725c
+++ binutils-2.27/binutils/dwarf.c	2017-03-24 13:58:05.061648769 +0000
58725c
@@ -76,7 +76,6 @@ int dwarf_check = 0;
58725c
    as a zero-terminated list of section indexes comprising one set of debug
58725c
    sections from a .dwo file.  */
58725c
 
58725c
-static int cu_tu_indexes_read = 0;
58725c
 static unsigned int *shndx_pool = NULL;
58725c
 static unsigned int shndx_pool_size = 0;
58725c
 static unsigned int shndx_pool_used = 0;
58725c
@@ -99,7 +98,7 @@ static int tu_count = 0;
58725c
 static struct cu_tu_set *cu_sets = NULL;
58725c
 static struct cu_tu_set *tu_sets = NULL;
58725c
 
58725c
-static void load_cu_tu_indexes (void *file);
58725c
+static bfd_boolean load_cu_tu_indexes (void *);
58725c
 
58725c
 /* Values for do_debug_lines.  */
58725c
 #define FLAG_DEBUG_LINES_RAW	 1
58725c
@@ -2713,7 +2712,7 @@ load_debug_info (void * file)
58725c
     return num_debug_info_entries;
58725c
 
58725c
   /* If this is a DWARF package file, load the CU and TU indexes.  */
58725c
-  load_cu_tu_indexes (file);
58725c
+  (void) load_cu_tu_indexes (file);
58725c
 
58725c
   if (load_debug_section (info, file)
58725c
       && process_debug_info (&debug_displays [info].section, file, abbrev, 1, 0))
58725c
@@ -7302,21 +7301,27 @@ process_cu_tu_index (struct dwarf_sectio
58725c
    section sets that we can use to associate a .debug_info.dwo section
58725c
    with its associated .debug_abbrev.dwo section in a .dwp file.  */
58725c
 
58725c
-static void
58725c
+static bfd_boolean
58725c
 load_cu_tu_indexes (void *file)
58725c
 {
58725c
+  static int cu_tu_indexes_read = -1; /* Tri-state variable.  */
58725c
+
58725c
   /* If we have already loaded (or tried to load) the CU and TU indexes
58725c
      then do not bother to repeat the task.  */
58725c
-  if (cu_tu_indexes_read)
58725c
-    return;
58725c
-
58725c
-  if (load_debug_section (dwp_cu_index, file))
58725c
-    process_cu_tu_index (&debug_displays [dwp_cu_index].section, 0);
58725c
+  if (cu_tu_indexes_read == -1)
58725c
+    {
58725c
+      cu_tu_indexes_read = TRUE;
58725c
+  
58725c
+      if (load_debug_section (dwp_cu_index, file))
58725c
+       if (! process_cu_tu_index (&debug_displays [dwp_cu_index].section, 0))
58725c
+         cu_tu_indexes_read = FALSE;
58725c
 
58725c
-  if (load_debug_section (dwp_tu_index, file))
58725c
-    process_cu_tu_index (&debug_displays [dwp_tu_index].section, 0);
58725c
+      if (load_debug_section (dwp_tu_index, file))
58725c
+       if (! process_cu_tu_index (&debug_displays [dwp_tu_index].section, 0))
58725c
+         cu_tu_indexes_read = FALSE;
58725c
+    }
58725c
 
58725c
-  cu_tu_indexes_read = 1;
58725c
+  return (bfd_boolean) cu_tu_indexes_read;
58725c
 }
58725c
 
58725c
 /* Find the set of sections that includes section SHNDX.  */
58725c
@@ -7326,7 +7331,8 @@ find_cu_tu_set (void *file, unsigned int
58725c
 {
58725c
   unsigned int i;
58725c
 
58725c
-  load_cu_tu_indexes (file);
58725c
+  if (! load_cu_tu_indexes (file))
58725c
+    return NULL;
58725c
 
58725c
   /* Find SHNDX in the shndx pool.  */
58725c
   for (i = 0; i < shndx_pool_used; i++)
58725c
diff -rup binutils.orig/binutils/readelf.c binutils-2.27/binutils/readelf.c
58725c
--- binutils.orig/binutils/readelf.c	2017-03-24 13:50:55.390187599 +0000
58725c
+++ binutils-2.27/binutils/readelf.c	2017-03-24 14:16:39.008271196 +0000
58725c
@@ -674,8 +674,14 @@ find_section_in_set (const char * name,
58725c
   if (set != NULL)
58725c
     {
58725c
       while ((i = *set++) > 0)
58725c
-	if (streq (SECTION_NAME (section_headers + i), name))
58725c
-	  return section_headers + i;
58725c
+       {
58725c
+         /* See PR 21156 for a reproducer.  */
58725c
+         if (i >= elf_header.e_shnum)
58725c
+           continue; /* FIXME: Should we issue an error message ?  */
58725c
+
58725c
+         if (streq (SECTION_NAME (section_headers + i), name))
58725c
+           return section_headers + i;
58725c
+       }
58725c
     }
58725c
 
58725c
   return find_section (name);
58725c
@@ -11342,16 +11348,32 @@ process_syminfo (FILE * file ATTRIBUTE_U
58725c
   return 1;
58725c
 }
58725c
 
58725c
+#define IN_RANGE(START,END,ADDR,OFF)		\
58725c
+  (((ADDR) >= (START)) && ((ADDR) + (OFF) < (END)))
58725c
+
58725c
 /* Check to see if the given reloc needs to be handled in a target specific
58725c
    manner.  If so then process the reloc and return TRUE otherwise return
58725c
-   FALSE.  */
58725c
+   FALSE.
58725c
+
58725c
+   If called with reloc == NULL, then this is a signal that reloc processing
58725c
+   for the current section has finished, and any saved state should be
58725c
+   discarded.  */
58725c
 
58725c
 static bfd_boolean
58725c
 target_specific_reloc_handling (Elf_Internal_Rela * reloc,
58725c
 				unsigned char *     start,
58725c
-				Elf_Internal_Sym *  symtab)
58725c
+				unsigned char *     end,
58725c
+				Elf_Internal_Sym *  symtab,
58725c
+				unsigned long       num_syms)
58725c
 {
58725c
-  unsigned int reloc_type = get_reloc_type (reloc->r_info);
58725c
+  unsigned int reloc_type = 0;
58725c
+  unsigned long sym_index = 0;
58725c
+
58725c
+  if (reloc)
58725c
+    {
58725c
+      reloc_type = get_reloc_type (reloc->r_info);
58725c
+      sym_index = get_reloc_symindex (reloc->r_info);
58725c
+    }
58725c
 
58725c
   switch (elf_header.e_machine)
58725c
     {
58725c
@@ -11360,13 +11382,25 @@ target_specific_reloc_handling (Elf_Inte
58725c
       {
58725c
 	static Elf_Internal_Sym * saved_sym = NULL;
58725c
 
58725c
+	if (reloc == NULL)
58725c
+	  {
58725c
+	    saved_sym = NULL;
58725c
+	    return TRUE;
58725c
+	  }
58725c
+
58725c
 	switch (reloc_type)
58725c
 	  {
58725c
 	  case 10: /* R_MSP430_SYM_DIFF */
58725c
 	    if (uses_msp430x_relocs ())
58725c
 	      break;
58725c
+	    /* Fall through.  */
58725c
 	  case 21: /* R_MSP430X_SYM_DIFF */
58725c
-	    saved_sym = symtab + get_reloc_symindex (reloc->r_info);
58725c
+	    /* PR 21139.  */
58725c
+	    if (sym_index >= num_syms)
58725c
+	      error (_("MSP430 SYM_DIFF reloc contains invalid symbol index %lu\n"),
58725c
+		     sym_index);
58725c
+	    else
58725c
+	      saved_sym = symtab + sym_index;
58725c
 	    return TRUE;
58725c
 
58725c
 	  case 1: /* R_MSP430_32 or R_MSP430_ABS32 */
58725c
@@ -11388,13 +11422,24 @@ target_specific_reloc_handling (Elf_Inte
58725c
 	  handle_sym_diff:
58725c
 	    if (saved_sym != NULL)
58725c
 	      {
58725c
+		int reloc_size = reloc_type == 1 ? 4 : 2;
58725c
 		bfd_vma value;
58725c
 
58725c
-		value = reloc->r_addend
58725c
-		  + (symtab[get_reloc_symindex (reloc->r_info)].st_value
58725c
-		     - saved_sym->st_value);
58725c
+		if (sym_index >= num_syms)
58725c
+		  error (_("MSP430 reloc contains invalid symbol index %lu\n"),
58725c
+			 sym_index);
58725c
+		else
58725c
+		  {
58725c
+		    value = reloc->r_addend + (symtab[sym_index].st_value
58725c
+					       - saved_sym->st_value);
58725c
 
58725c
-		byte_put (start + reloc->r_offset, value, reloc_type == 1 ? 4 : 2);
58725c
+		    if (IN_RANGE (start, end, start + reloc->r_offset, reloc_size))
58725c
+		      byte_put (start + reloc->r_offset, value, reloc_size);
58725c
+		    else
58725c
+		      /* PR 21137 */
58725c
+		      error (_("MSP430 sym diff reloc contains invalid offset: 0x%lx\n"),
58725c
+			     (long) reloc->r_offset);
58725c
+		  }
58725c
 
58725c
 		saved_sym = NULL;
58725c
 		return TRUE;
58725c
@@ -11414,24 +11459,46 @@ target_specific_reloc_handling (Elf_Inte
58725c
       {
58725c
 	static Elf_Internal_Sym * saved_sym = NULL;
58725c
 
58725c
+	if (reloc == NULL)
58725c
+	  {
58725c
+	    saved_sym = NULL;
58725c
+	    return TRUE;
58725c
+	  }
58725c
+
58725c
 	switch (reloc_type)
58725c
 	  {
58725c
 	  case 34: /* R_MN10300_ALIGN */
58725c
 	    return TRUE;
58725c
+
58725c
 	  case 33: /* R_MN10300_SYM_DIFF */
58725c
-	    saved_sym = symtab + get_reloc_symindex (reloc->r_info);
58725c
+	    if (sym_index >= num_syms)
58725c
+	      error (_("MN10300_SYM_DIFF reloc contains invalid symbol index %lu\n"),
58725c
+		     sym_index);
58725c
+	    else
58725c
+	      saved_sym = symtab + sym_index;
58725c
 	    return TRUE;
58725c
+
58725c
 	  case 1: /* R_MN10300_32 */
58725c
 	  case 2: /* R_MN10300_16 */
58725c
 	    if (saved_sym != NULL)
58725c
 	      {
58725c
+		int reloc_size = reloc_type == 1 ? 4 : 2;
58725c
 		bfd_vma value;
58725c
 
58725c
-		value = reloc->r_addend
58725c
-		  + (symtab[get_reloc_symindex (reloc->r_info)].st_value
58725c
-		     - saved_sym->st_value);
58725c
+		if (sym_index >= num_syms)
58725c
+		  error (_("MN10300 reloc contains invalid symbol index %lu\n"),
58725c
+			 sym_index);
58725c
+		else
58725c
+		  {
58725c
+		    value = reloc->r_addend + (symtab[sym_index].st_value
58725c
+					       - saved_sym->st_value);
58725c
 
58725c
-		byte_put (start + reloc->r_offset, value, reloc_type == 1 ? 4 : 2);
58725c
+		    if (IN_RANGE (start, end, start + reloc->r_offset, reloc_size))
58725c
+		      byte_put (start + reloc->r_offset, value, reloc_size);
58725c
+		    else
58725c
+		      error (_("MN10300 sym diff reloc contains invalid offset: 0x%lx\n"),
58725c
+			     (long) reloc->r_offset);
58725c
+		  }
58725c
 
58725c
 		saved_sym = NULL;
58725c
 		return TRUE;
58725c
@@ -11451,12 +11518,24 @@ target_specific_reloc_handling (Elf_Inte
58725c
 	static bfd_vma saved_sym2 = 0;
58725c
 	static bfd_vma value;
58725c
 
58725c
+	if (reloc == NULL)
58725c
+	  {
58725c
+	    saved_sym1 = saved_sym2 = 0;
58725c
+	    return TRUE;
58725c
+	  }
58725c
+
58725c
 	switch (reloc_type)
58725c
 	  {
58725c
 	  case 0x80: /* R_RL78_SYM.  */
58725c
 	    saved_sym1 = saved_sym2;
58725c
-	    saved_sym2 = symtab[get_reloc_symindex (reloc->r_info)].st_value;
58725c
-	    saved_sym2 += reloc->r_addend;
58725c
+	    if (sym_index >= num_syms)
58725c
+	      error (_("RL78_SYM reloc contains invalid symbol index %lu\n"),
58725c
+		     sym_index);
58725c
+	    else
58725c
+	      {
58725c
+		saved_sym2 = symtab[sym_index].st_value;
58725c
+		saved_sym2 += reloc->r_addend;
58725c
+	      }
58725c
 	    return TRUE;
58725c
 
58725c
 	  case 0x83: /* R_RL78_OPsub.  */
58725c
@@ -11466,12 +11545,20 @@ target_specific_reloc_handling (Elf_Inte
58725c
 	    break;
58725c
 
58725c
 	  case 0x41: /* R_RL78_ABS32.  */
58725c
-	    byte_put (start + reloc->r_offset, value, 4);
58725c
+	    if (IN_RANGE (start, end, start + reloc->r_offset, 4))
58725c
+	      byte_put (start + reloc->r_offset, value, 4);
58725c
+	    else
58725c
+	      error (_("RL78 sym diff reloc contains invalid offset: 0x%lx\n"),
58725c
+		     (long) reloc->r_offset);
58725c
 	    value = 0;
58725c
 	    return TRUE;
58725c
 
58725c
 	  case 0x43: /* R_RL78_ABS16.  */
58725c
-	    byte_put (start + reloc->r_offset, value, 2);
58725c
+	    if (IN_RANGE (start, end, start + reloc->r_offset, 2))
58725c
+	      byte_put (start + reloc->r_offset, value, 2);
58725c
+	    else
58725c
+	      error (_("RL78 sym diff reloc contains invalid offset: 0x%lx\n"),
58725c
+		     (long) reloc->r_offset);
58725c
 	    value = 0;
58725c
 	    return TRUE;
58725c
 
58725c
@@ -12078,7 +12165,7 @@ apply_relocations (void *
58725c
 
58725c
 	  reloc_type = get_reloc_type (rp->r_info);
58725c
 
58725c
-	  if (target_specific_reloc_handling (rp, start, symtab))
58725c
+	  if (target_specific_reloc_handling (rp, start, end, symtab, num_syms))
58725c
 	    continue;
58725c
 	  else if (is_none_reloc (reloc_type))
58725c
 	    continue;
58725c
@@ -12174,6 +12261,9 @@ apply_relocations (void *
58725c
 	}
58725c
 
58725c
       free (symtab);
58725c
+      /* Let the target specific reloc processing code know that
58725c
+        we have finished with these relocs.  */
58725c
+      target_specific_reloc_handling (NULL, NULL, NULL, NULL, 0);
58725c
 
58725c
       if (relocs_return)
58725c
 	{
58725c
@@ -12471,10 +12561,18 @@ dump_section_as_bytes (Elf_Internal_Shdr
58725c
 	  new_size -= 12;
58725c
 	}
58725c
 
58725c
-      if (uncompressed_size
58725c
-	  && uncompress_section_contents (& start, uncompressed_size,
58725c
-					  & new_size))
58725c
-	section_size = new_size;
58725c
+      if (uncompressed_size)
58725c
+	{
58725c
+	  if (uncompress_section_contents (& start, uncompressed_size,
58725c
+					   & new_size))
58725c
+	    section_size = new_size;
58725c
+	  else
58725c
+	    {
58725c
+	      error (_("Unable to decompress section %s\n"),
58725c
+		     printable_section_name (section));
58725c
+	      return;
58725c
+	    }
58725c
+	}
58725c
     }
58725c
 
58725c
   if (relocate)
58725c
diff -rup binutils.orig/binutils/stabs.c binutils-2.27/binutils/stabs.c
58725c
--- binutils.orig/binutils/stabs.c	2017-03-24 13:50:55.386187651 +0000
58725c
+++ binutils-2.27/binutils/stabs.c	2017-03-24 14:14:20.823055085 +0000
58725c
@@ -232,6 +232,10 @@ parse_number (const char **pp, bfd_boole
58725c
 
58725c
   orig = *pp;
58725c
 
58725c
+  /* Stop early if we are passed an empty string.  */
58725c
+  if (*orig == 0)
58725c
+    return (bfd_vma) 0;
58725c
+
58725c
   errno = 0;
58725c
   ul = strtoul (*pp, (char **) pp, 0);
58725c
   if (ul + 1 != 0 || errno == 0)
58725c
@@ -1975,9 +1979,17 @@ parse_stab_enum_type (void *dhandle, con
58725c
       bfd_signed_vma val;
58725c
 
58725c
       p = *pp;
58725c
-      while (*p != ':')
58725c
+      while (*p != ':' && *p != 0)
58725c
 	++p;
58725c
 
58725c
+      if (*p == 0)
58725c
+       {
58725c
+         bad_stab (orig);
58725c
+         free (names);
58725c
+         free (values);
58725c
+         return DEBUG_TYPE_NULL;
58725c
+       }
58725c
+
58725c
       name = savestring (*pp, p - *pp);
58725c
 
58725c
       *pp = p + 1;
58725c
diff -rup binutils.orig/gas/app.c binutils-2.27/gas/app.c
58725c
--- binutils.orig/gas/app.c	2017-03-24 13:50:55.395187534 +0000
58725c
+++ binutils-2.27/gas/app.c	2017-03-24 13:52:02.141327121 +0000
58725c
@@ -1187,7 +1187,7 @@ do_scrub_chars (size_t (*get) (char *, s
58725c
 		  state = -2;
58725c
 		  break;
58725c
 		}
58725c
-	      else
58725c
+	      else if (ch2 != EOF)
58725c
 		{
58725c
 		  UNGET (ch2);
58725c
 		}
58725c
diff -rup binutils.orig/ld/ldlex.c binutils-2.27/ld/ldlex.c
58725c
--- binutils.orig/ld/ldlex.c	2017-03-24 13:50:55.613184724 +0000
58725c
+++ binutils-2.27/ld/ldlex.c	2017-03-24 14:20:47.319068827 +0000
58725c
@@ -1,5 +1,5 @@
58725c
 
58725c
-#line 3 "ldlex.c"
58725c
+#line 3 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.c"
58725c
 
58725c
 #define  YY_INT_ALIGNED short int
58725c
 
58725c
@@ -7,8 +7,8 @@
58725c
 
58725c
 #define FLEX_SCANNER
58725c
 #define YY_FLEX_MAJOR_VERSION 2
58725c
-#define YY_FLEX_MINOR_VERSION 5
58725c
-#define YY_FLEX_SUBMINOR_VERSION 35
58725c
+#define YY_FLEX_MINOR_VERSION 6
58725c
+#define YY_FLEX_SUBMINOR_VERSION 0
58725c
 #if YY_FLEX_SUBMINOR_VERSION > 0
58725c
 #define FLEX_BETA
58725c
 #endif
58725c
@@ -46,7 +46,6 @@ typedef int16_t flex_int16_t;
58725c
 typedef uint16_t flex_uint16_t;
58725c
 typedef int32_t flex_int32_t;
58725c
 typedef uint32_t flex_uint32_t;
58725c
-typedef uint64_t flex_uint64_t;
58725c
 #else
58725c
 typedef signed char flex_int8_t;
58725c
 typedef short int flex_int16_t;
58725c
@@ -54,7 +53,6 @@ typedef int flex_int32_t;
58725c
 typedef unsigned char flex_uint8_t; 
58725c
 typedef unsigned short int flex_uint16_t;
58725c
 typedef unsigned int flex_uint32_t;
58725c
-#endif /* ! C99 */
58725c
 
58725c
 /* Limits of integral types. */
58725c
 #ifndef INT8_MIN
58725c
@@ -85,6 +83,8 @@ typedef unsigned int flex_uint32_t;
58725c
 #define UINT32_MAX             (4294967295U)
58725c
 #endif
58725c
 
58725c
+#endif /* ! C99 */
58725c
+
58725c
 #endif /* ! FLEXINT_H */
58725c
 
58725c
 #ifdef __cplusplus
58725c
@@ -141,7 +141,15 @@ typedef unsigned int flex_uint32_t;
58725c
 
58725c
 /* Size of default input buffer. */
58725c
 #ifndef YY_BUF_SIZE
58725c
+#ifdef __ia64__
58725c
+/* On IA-64, the buffer size is 16k, not 8k.
58725c
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
58725c
+ * Ditto for the __ia64__ case accordingly.
58725c
+ */
58725c
+#define YY_BUF_SIZE 32768
58725c
+#else
58725c
 #define YY_BUF_SIZE 16384
58725c
+#endif /* __ia64__ */
58725c
 #endif
58725c
 
58725c
 /* The state buf must be large enough to hold one state per character in the main buffer.
58725c
@@ -167,13 +175,14 @@ extern FILE *yyin, *yyout;
58725c
 #define EOB_ACT_LAST_MATCH 2
58725c
 
58725c
     #define YY_LESS_LINENO(n)
58725c
+    #define YY_LINENO_REWIND_TO(ptr)
58725c
     
58725c
 /* Return all but the first "n" matched characters back to the input stream. */
58725c
 #define yyless(n) \
58725c
 	do \
58725c
 		{ \
58725c
 		/* Undo effects of setting up yytext. */ \
58725c
-        int yyless_macro_arg = (n); \
58725c
+        yy_size_t yyless_macro_arg = (n); \
58725c
         YY_LESS_LINENO(yyless_macro_arg);\
58725c
 		*yy_cp = (yy_hold_char); \
58725c
 		YY_RESTORE_YY_MORE_OFFSET \
58725c
@@ -343,11 +352,17 @@ extern int yylineno;
58725c
 int yylineno = 1;
58725c
 
58725c
 extern char *yytext;
58725c
+#ifdef yytext_ptr
58725c
+#undef yytext_ptr
58725c
+#endif
58725c
 #define yytext_ptr yytext
58725c
 
58725c
 static yy_state_type yy_get_previous_state (void );
58725c
 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
58725c
 static int yy_get_next_buffer (void );
58725c
+#if defined(__GNUC__) && __GNUC__ >= 3
58725c
+__attribute__((__noreturn__))
58725c
+#endif
58725c
 static void yy_fatal_error (yyconst char msg[]  );
58725c
 
58725c
 /* Done after the current pattern has been matched and before the
58725c
@@ -355,7 +370,7 @@ static void yy_fatal_error (yyconst char
58725c
  */
58725c
 #define YY_DO_BEFORE_ACTION \
58725c
 	(yytext_ptr) = yy_bp; \
58725c
-	yyleng = (yy_size_t) (yy_cp - yy_bp); \
58725c
+	yyleng = (size_t) (yy_cp - yy_bp); \
58725c
 	(yy_hold_char) = *yy_cp; \
58725c
 	*yy_cp = '\0'; \
58725c
 	(yy_c_buf_p) = yy_cp;
58725c
@@ -568,7 +583,7 @@ static yyconst flex_int16_t yy_accept[17
58725c
       174,   84,   84,    0
58725c
     } ;
58725c
 
58725c
-static yyconst flex_int32_t yy_ec[256] =
58725c
+static yyconst YY_CHAR yy_ec[256] =
58725c
     {   0,
58725c
         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
58725c
         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
58725c
@@ -600,7 +615,7 @@ static yyconst flex_int32_t yy_ec[256] =
58725c
         1,    1,    1,    1,    1
58725c
     } ;
58725c
 
58725c
-static yyconst flex_int32_t yy_meta[83] =
58725c
+static yyconst YY_CHAR yy_meta[83] =
58725c
     {   0,
58725c
         1,    1,    2,    3,    1,    1,    4,    1,    1,    1,
58725c
         1,    3,    5,    6,    7,    8,    9,   10,   10,   10,
58725c
@@ -613,7 +628,7 @@ static yyconst flex_int32_t yy_meta[83]
58725c
         1,    9
58725c
     } ;
58725c
 
58725c
-static yyconst flex_int16_t yy_base[1807] =
58725c
+static yyconst flex_uint16_t yy_base[1807] =
58725c
     {   0,
58725c
         0,    0,    0,    0,   82,  163,  244,    0,  326,    0,
58725c
       408,  489,  570,    0,  112,  114,  652,  734,  816,  898,
58725c
@@ -1019,7 +1034,7 @@ static yyconst flex_int16_t yy_def[1807]
58725c
      1774, 1774, 1774, 1774, 1774, 1774
58725c
     } ;
58725c
 
58725c
-static yyconst flex_int16_t yy_nxt[2940] =
58725c
+static yyconst flex_uint16_t yy_nxt[2940] =
58725c
     {   0,
58725c
        23,   24,   25,   26,   27,   23,   28,   29,   30,   31,
58725c
        32,   33,   34,   35,   36,   37,   38,   39,   40,   40,
58725c
@@ -1687,8 +1702,8 @@ int yy_flex_debug = 0;
58725c
 #define YY_MORE_ADJ 0
58725c
 #define YY_RESTORE_YY_MORE_OFFSET
58725c
 char *yytext;
58725c
-#line 1 "ldlex.l"
58725c
-#line 4 "ldlex.l"
58725c
+#line 1 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
+#line 4 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 
58725c
 /* Copyright (C) 1991-2016 Free Software Foundation, Inc.
58725c
    Written by Steve Chamberlain of Cygnus Support.
58725c
@@ -1788,7 +1803,7 @@ int yywrap (void) { return 1; }
58725c
 
58725c
 
58725c
 
58725c
-#line 1792 "ldlex.c"
58725c
+#line 1807 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.c"
58725c
 
58725c
 #define INITIAL 0
58725c
 #define SCRIPT 1
58725c
@@ -1830,11 +1845,11 @@ void yyset_extra (YY_EXTRA_TYPE user_def
58725c
 
58725c
 FILE *yyget_in (void );
58725c
 
58725c
-void yyset_in  (FILE * in_str  );
58725c
+void yyset_in  (FILE * _in_str  );
58725c
 
58725c
 FILE *yyget_out (void );
58725c
 
58725c
-void yyset_out  (FILE * out_str  );
58725c
+void yyset_out  (FILE * _out_str  );
58725c
 
58725c
 yy_size_t yyget_leng (void );
58725c
 
58725c
@@ -1842,7 +1857,7 @@ char *yyget_text (void );
58725c
 
58725c
 int yyget_lineno (void );
58725c
 
58725c
-void yyset_lineno (int line_number  );
58725c
+void yyset_lineno (int _line_number  );
58725c
 
58725c
 /* Macros after this point can all be overridden by user definitions in
58725c
  * section 1.
58725c
@@ -1856,6 +1871,10 @@ extern int yywrap (void );
58725c
 #endif
58725c
 #endif
58725c
 
58725c
+#ifndef YY_NO_UNPUT
58725c
+    
58725c
+#endif
58725c
+
58725c
 #ifndef yytext_ptr
58725c
 static void yy_flex_strncpy (char *,yyconst char *,int );
58725c
 #endif
58725c
@@ -1876,7 +1895,12 @@ static int input (void );
58725c
 
58725c
 /* Amount of stuff to slurp up with each read. */
58725c
 #ifndef YY_READ_BUF_SIZE
58725c
+#ifdef __ia64__
58725c
+/* On IA-64, the buffer size is 16k, not 8k */
58725c
+#define YY_READ_BUF_SIZE 16384
58725c
+#else
58725c
 #define YY_READ_BUF_SIZE 8192
58725c
+#endif /* __ia64__ */
58725c
 #endif
58725c
 
58725c
 /* Copy whatever the last rule matched to the standard output. */
58725c
@@ -1884,7 +1908,7 @@ static int input (void );
58725c
 /* This used to be an fputs(), but since the string might contain NUL's,
58725c
  * we now use fwrite().
58725c
  */
58725c
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
58725c
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
58725c
 #endif
58725c
 
58725c
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
58725c
@@ -1895,7 +1919,7 @@ static int input (void );
58725c
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
58725c
 		{ \
58725c
 		int c = '*'; \
58725c
-		yy_size_t n; \
58725c
+		size_t n; \
58725c
 		for ( n = 0; n < max_size && \
58725c
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
58725c
 			buf[n] = (char) c; \
58725c
@@ -1963,7 +1987,7 @@ extern int yylex (void);
58725c
 
58725c
 /* Code executed at the end of each rule. */
58725c
 #ifndef YY_BREAK
58725c
-#define YY_BREAK break;
58725c
+#define YY_BREAK /*LINTED*/break;
58725c
 #endif
58725c
 
58725c
 #define YY_RULE_SETUP \
58725c
@@ -1973,31 +1997,10 @@ extern int yylex (void);
58725c
  */
58725c
 YY_DECL
58725c
 {
58725c
-	register yy_state_type yy_current_state;
58725c
-	register char *yy_cp, *yy_bp;
58725c
-	register int yy_act;
58725c
+	yy_state_type yy_current_state;
58725c
+	char *yy_cp, *yy_bp;
58725c
+	int yy_act;
58725c
     
58725c
-#line 121 "ldlex.l"
58725c
-
58725c
-
58725c
-  if (parser_input != input_selected)
58725c
-    {
58725c
-      /* The first token of the input determines the initial parser state.  */
58725c
-      input_type t = parser_input;
58725c
-      parser_input = input_selected;
58725c
-      switch (t)
58725c
-	{
58725c
-	case input_script: return INPUT_SCRIPT; break;
58725c
-	case input_mri_script: return INPUT_MRI_SCRIPT; break;
58725c
-	case input_version_script: return INPUT_VERSION_SCRIPT; break;
58725c
-	case input_dynamic_list: return INPUT_DYNAMIC_LIST; break;
58725c
-	case input_defsym: return INPUT_DEFSYM; break;
58725c
-	default: abort ();
58725c
-	}
58725c
-    }
58725c
-
58725c
-#line 2000 "ldlex.c"
58725c
-
58725c
 	if ( !(yy_init) )
58725c
 		{
58725c
 		(yy_init) = 1;
58725c
@@ -2024,7 +2027,29 @@ YY_DECL
58725c
 		yy_load_buffer_state( );
58725c
 		}
58725c
 
58725c
-	while ( 1 )		/* loops until end-of-file is reached */
58725c
+	{
58725c
+#line 121 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
+
58725c
+
58725c
+  if (parser_input != input_selected)
58725c
+    {
58725c
+      /* The first token of the input determines the initial parser state.  */
58725c
+      input_type t = parser_input;
58725c
+      parser_input = input_selected;
58725c
+      switch (t)
58725c
+	{
58725c
+	case input_script: return INPUT_SCRIPT; break;
58725c
+	case input_mri_script: return INPUT_MRI_SCRIPT; break;
58725c
+	case input_version_script: return INPUT_VERSION_SCRIPT; break;
58725c
+	case input_dynamic_list: return INPUT_DYNAMIC_LIST; break;
58725c
+	case input_defsym: return INPUT_DEFSYM; break;
58725c
+	default: abort ();
58725c
+	}
58725c
+    }
58725c
+
58725c
+#line 2051 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.c"
58725c
+
58725c
+	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
58725c
 		{
58725c
 		yy_cp = (yy_c_buf_p);
58725c
 
58725c
@@ -2040,7 +2065,7 @@ YY_DECL
58725c
 yy_match:
58725c
 		do
58725c
 			{
58725c
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
58725c
+			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
58725c
 			if ( yy_accept[yy_current_state] )
58725c
 				{
58725c
 				(yy_last_accepting_state) = yy_current_state;
58725c
@@ -2081,32 +2106,32 @@ do_action:	/* This label is used only to
58725c
 
58725c
 case 1:
58725c
 YY_RULE_SETUP
58725c
-#line 139 "ldlex.l"
58725c
+#line 139 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { comment (); }
58725c
 	YY_BREAK
58725c
 case 2:
58725c
 YY_RULE_SETUP
58725c
-#line 142 "ldlex.l"
58725c
+#line 142 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('-');}
58725c
 	YY_BREAK
58725c
 case 3:
58725c
 YY_RULE_SETUP
58725c
-#line 143 "ldlex.l"
58725c
+#line 143 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('+');}
58725c
 	YY_BREAK
58725c
 case 4:
58725c
 YY_RULE_SETUP
58725c
-#line 144 "ldlex.l"
58725c
+#line 144 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { yylval.name = xstrdup (yytext); return NAME; }
58725c
 	YY_BREAK
58725c
 case 5:
58725c
 YY_RULE_SETUP
58725c
-#line 145 "ldlex.l"
58725c
+#line 145 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('='); }
58725c
 	YY_BREAK
58725c
 case 6:
58725c
 YY_RULE_SETUP
58725c
-#line 147 "ldlex.l"
58725c
+#line 147 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 {
58725c
   				yylval.integer = bfd_scan_vma (yytext + 1, 0, 16);
58725c
 				yylval.bigint.str = NULL;
58725c
@@ -2115,7 +2140,7 @@ YY_RULE_SETUP
58725c
 	YY_BREAK
58725c
 case 7:
58725c
 YY_RULE_SETUP
58725c
-#line 153 "ldlex.l"
58725c
+#line 153 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 {
58725c
 				   int ibase ;
58725c
 				   switch (yytext[yyleng - 1]) {
58725c
@@ -2144,7 +2169,7 @@ YY_RULE_SETUP
58725c
 	YY_BREAK
58725c
 case 8:
58725c
 YY_RULE_SETUP
58725c
-#line 178 "ldlex.l"
58725c
+#line 178 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 {
58725c
 				  char *s = yytext;
58725c
 				  int ibase = 0;
58725c
@@ -2177,829 +2202,829 @@ YY_RULE_SETUP
58725c
 	YY_BREAK
58725c
 case 9:
58725c
 YY_RULE_SETUP
58725c
-#line 207 "ldlex.l"
58725c
+#line 207 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(']');}
58725c
 	YY_BREAK
58725c
 case 10:
58725c
 YY_RULE_SETUP
58725c
-#line 208 "ldlex.l"
58725c
+#line 208 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('[');}
58725c
 	YY_BREAK
58725c
 case 11:
58725c
 YY_RULE_SETUP
58725c
-#line 209 "ldlex.l"
58725c
+#line 209 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(LSHIFTEQ);}
58725c
 	YY_BREAK
58725c
 case 12:
58725c
 YY_RULE_SETUP
58725c
-#line 210 "ldlex.l"
58725c
+#line 210 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(RSHIFTEQ);}
58725c
 	YY_BREAK
58725c
 case 13:
58725c
 YY_RULE_SETUP
58725c
-#line 211 "ldlex.l"
58725c
+#line 211 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(OROR);}
58725c
 	YY_BREAK
58725c
 case 14:
58725c
 YY_RULE_SETUP
58725c
-#line 212 "ldlex.l"
58725c
+#line 212 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(EQ);}
58725c
 	YY_BREAK
58725c
 case 15:
58725c
 YY_RULE_SETUP
58725c
-#line 213 "ldlex.l"
58725c
+#line 213 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(NE);}
58725c
 	YY_BREAK
58725c
 case 16:
58725c
 YY_RULE_SETUP
58725c
-#line 214 "ldlex.l"
58725c
+#line 214 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(GE);}
58725c
 	YY_BREAK
58725c
 case 17:
58725c
 YY_RULE_SETUP
58725c
-#line 215 "ldlex.l"
58725c
+#line 215 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(LE);}
58725c
 	YY_BREAK
58725c
 case 18:
58725c
 YY_RULE_SETUP
58725c
-#line 216 "ldlex.l"
58725c
+#line 216 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(LSHIFT);}
58725c
 	YY_BREAK
58725c
 case 19:
58725c
 YY_RULE_SETUP
58725c
-#line 217 "ldlex.l"
58725c
+#line 217 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(RSHIFT);}
58725c
 	YY_BREAK
58725c
 case 20:
58725c
 YY_RULE_SETUP
58725c
-#line 218 "ldlex.l"
58725c
+#line 218 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(PLUSEQ);}
58725c
 	YY_BREAK
58725c
 case 21:
58725c
 YY_RULE_SETUP
58725c
-#line 219 "ldlex.l"
58725c
+#line 219 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(MINUSEQ);}
58725c
 	YY_BREAK
58725c
 case 22:
58725c
 YY_RULE_SETUP
58725c
-#line 220 "ldlex.l"
58725c
+#line 220 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(MULTEQ);}
58725c
 	YY_BREAK
58725c
 case 23:
58725c
 YY_RULE_SETUP
58725c
-#line 221 "ldlex.l"
58725c
+#line 221 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(DIVEQ);}
58725c
 	YY_BREAK
58725c
 case 24:
58725c
 YY_RULE_SETUP
58725c
-#line 222 "ldlex.l"
58725c
+#line 222 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ANDEQ);}
58725c
 	YY_BREAK
58725c
 case 25:
58725c
 YY_RULE_SETUP
58725c
-#line 223 "ldlex.l"
58725c
+#line 223 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(OREQ);}
58725c
 	YY_BREAK
58725c
 case 26:
58725c
 YY_RULE_SETUP
58725c
-#line 224 "ldlex.l"
58725c
+#line 224 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ANDAND);}
58725c
 	YY_BREAK
58725c
 case 27:
58725c
 YY_RULE_SETUP
58725c
-#line 225 "ldlex.l"
58725c
+#line 225 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('>');}
58725c
 	YY_BREAK
58725c
 case 28:
58725c
 YY_RULE_SETUP
58725c
-#line 226 "ldlex.l"
58725c
+#line 226 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(',');}
58725c
 	YY_BREAK
58725c
 case 29:
58725c
 YY_RULE_SETUP
58725c
-#line 227 "ldlex.l"
58725c
+#line 227 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('&';;}
58725c
 	YY_BREAK
58725c
 case 30:
58725c
 YY_RULE_SETUP
58725c
-#line 228 "ldlex.l"
58725c
+#line 228 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('|');}
58725c
 	YY_BREAK
58725c
 case 31:
58725c
 YY_RULE_SETUP
58725c
-#line 229 "ldlex.l"
58725c
+#line 229 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('~');}
58725c
 	YY_BREAK
58725c
 case 32:
58725c
 YY_RULE_SETUP
58725c
-#line 230 "ldlex.l"
58725c
+#line 230 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('!');}
58725c
 	YY_BREAK
58725c
 case 33:
58725c
 YY_RULE_SETUP
58725c
-#line 231 "ldlex.l"
58725c
+#line 231 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('?');}
58725c
 	YY_BREAK
58725c
 case 34:
58725c
 YY_RULE_SETUP
58725c
-#line 232 "ldlex.l"
58725c
+#line 232 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('*');}
58725c
 	YY_BREAK
58725c
 case 35:
58725c
 YY_RULE_SETUP
58725c
-#line 233 "ldlex.l"
58725c
+#line 233 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('+');}
58725c
 	YY_BREAK
58725c
 case 36:
58725c
 YY_RULE_SETUP
58725c
-#line 234 "ldlex.l"
58725c
+#line 234 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('-');}
58725c
 	YY_BREAK
58725c
 case 37:
58725c
 YY_RULE_SETUP
58725c
-#line 235 "ldlex.l"
58725c
+#line 235 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('/');}
58725c
 	YY_BREAK
58725c
 case 38:
58725c
 YY_RULE_SETUP
58725c
-#line 236 "ldlex.l"
58725c
+#line 236 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('%');}
58725c
 	YY_BREAK
58725c
 case 39:
58725c
 YY_RULE_SETUP
58725c
-#line 237 "ldlex.l"
58725c
+#line 237 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('<');}
58725c
 	YY_BREAK
58725c
 case 40:
58725c
 YY_RULE_SETUP
58725c
-#line 238 "ldlex.l"
58725c
+#line 238 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('=');}
58725c
 	YY_BREAK
58725c
 case 41:
58725c
 YY_RULE_SETUP
58725c
-#line 239 "ldlex.l"
58725c
+#line 239 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('}') ; }
58725c
 	YY_BREAK
58725c
 case 42:
58725c
 YY_RULE_SETUP
58725c
-#line 240 "ldlex.l"
58725c
+#line 240 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('{'); }
58725c
 	YY_BREAK
58725c
 case 43:
58725c
 YY_RULE_SETUP
58725c
-#line 241 "ldlex.l"
58725c
+#line 241 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(')');}
58725c
 	YY_BREAK
58725c
 case 44:
58725c
 YY_RULE_SETUP
58725c
-#line 242 "ldlex.l"
58725c
+#line 242 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN('(');}
58725c
 	YY_BREAK
58725c
 case 45:
58725c
 YY_RULE_SETUP
58725c
-#line 243 "ldlex.l"
58725c
+#line 243 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(':'); }
58725c
 	YY_BREAK
58725c
 case 46:
58725c
 YY_RULE_SETUP
58725c
-#line 244 "ldlex.l"
58725c
+#line 244 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(';');}
58725c
 	YY_BREAK
58725c
 case 47:
58725c
 YY_RULE_SETUP
58725c
-#line 245 "ldlex.l"
58725c
+#line 245 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(MEMORY);}
58725c
 	YY_BREAK
58725c
 case 48:
58725c
 YY_RULE_SETUP
58725c
-#line 246 "ldlex.l"
58725c
+#line 246 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(REGION_ALIAS);}
58725c
 	YY_BREAK
58725c
 case 49:
58725c
 YY_RULE_SETUP
58725c
-#line 247 "ldlex.l"
58725c
+#line 247 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(LD_FEATURE);}
58725c
 	YY_BREAK
58725c
 case 50:
58725c
 YY_RULE_SETUP
58725c
-#line 248 "ldlex.l"
58725c
+#line 248 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ORIGIN);}
58725c
 	YY_BREAK
58725c
 case 51:
58725c
 YY_RULE_SETUP
58725c
-#line 249 "ldlex.l"
58725c
+#line 249 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(VERSIONK);}
58725c
 	YY_BREAK
58725c
 case 52:
58725c
 YY_RULE_SETUP
58725c
-#line 250 "ldlex.l"
58725c
+#line 250 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(BLOCK);}
58725c
 	YY_BREAK
58725c
 case 53:
58725c
 YY_RULE_SETUP
58725c
-#line 251 "ldlex.l"
58725c
+#line 251 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(BIND);}
58725c
 	YY_BREAK
58725c
 case 54:
58725c
 YY_RULE_SETUP
58725c
-#line 252 "ldlex.l"
58725c
+#line 252 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(LENGTH);}
58725c
 	YY_BREAK
58725c
 case 55:
58725c
 YY_RULE_SETUP
58725c
-#line 253 "ldlex.l"
58725c
+#line 253 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ALIGN_K);}
58725c
 	YY_BREAK
58725c
 case 56:
58725c
 YY_RULE_SETUP
58725c
-#line 254 "ldlex.l"
58725c
+#line 254 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(DATA_SEGMENT_ALIGN);}
58725c
 	YY_BREAK
58725c
 case 57:
58725c
 YY_RULE_SETUP
58725c
-#line 255 "ldlex.l"
58725c
+#line 255 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(DATA_SEGMENT_RELRO_END);}
58725c
 	YY_BREAK
58725c
 case 58:
58725c
 YY_RULE_SETUP
58725c
-#line 256 "ldlex.l"
58725c
+#line 256 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(DATA_SEGMENT_END);}
58725c
 	YY_BREAK
58725c
 case 59:
58725c
 YY_RULE_SETUP
58725c
-#line 257 "ldlex.l"
58725c
+#line 257 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ADDR);}
58725c
 	YY_BREAK
58725c
 case 60:
58725c
 YY_RULE_SETUP
58725c
-#line 258 "ldlex.l"
58725c
+#line 258 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(LOADADDR);}
58725c
 	YY_BREAK
58725c
 case 61:
58725c
 YY_RULE_SETUP
58725c
-#line 259 "ldlex.l"
58725c
+#line 259 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ALIGNOF); }
58725c
 	YY_BREAK
58725c
 case 62:
58725c
 YY_RULE_SETUP
58725c
-#line 260 "ldlex.l"
58725c
+#line 260 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(MAX_K); }
58725c
 	YY_BREAK
58725c
 case 63:
58725c
 YY_RULE_SETUP
58725c
-#line 261 "ldlex.l"
58725c
+#line 261 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(MIN_K); }
58725c
 	YY_BREAK
58725c
 case 64:
58725c
 YY_RULE_SETUP
58725c
-#line 262 "ldlex.l"
58725c
+#line 262 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(LOG2CEIL); }
58725c
 	YY_BREAK
58725c
 case 65:
58725c
 YY_RULE_SETUP
58725c
-#line 263 "ldlex.l"
58725c
+#line 263 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ASSERT_K); }
58725c
 	YY_BREAK
58725c
 case 66:
58725c
 YY_RULE_SETUP
58725c
-#line 264 "ldlex.l"
58725c
+#line 264 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ENTRY);}
58725c
 	YY_BREAK
58725c
 case 67:
58725c
 YY_RULE_SETUP
58725c
-#line 265 "ldlex.l"
58725c
+#line 265 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(EXTERN);}
58725c
 	YY_BREAK
58725c
 case 68:
58725c
 YY_RULE_SETUP
58725c
-#line 266 "ldlex.l"
58725c
+#line 266 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(NEXT);}
58725c
 	YY_BREAK
58725c
 case 69:
58725c
 YY_RULE_SETUP
58725c
-#line 267 "ldlex.l"
58725c
+#line 267 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SIZEOF_HEADERS);}
58725c
 	YY_BREAK
58725c
 case 70:
58725c
 YY_RULE_SETUP
58725c
-#line 268 "ldlex.l"
58725c
+#line 268 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SIZEOF_HEADERS);}
58725c
 	YY_BREAK
58725c
 case 71:
58725c
 YY_RULE_SETUP
58725c
-#line 269 "ldlex.l"
58725c
+#line 269 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SEGMENT_START);}
58725c
 	YY_BREAK
58725c
 case 72:
58725c
 YY_RULE_SETUP
58725c
-#line 270 "ldlex.l"
58725c
+#line 270 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(MAP);}
58725c
 	YY_BREAK
58725c
 case 73:
58725c
 YY_RULE_SETUP
58725c
-#line 271 "ldlex.l"
58725c
+#line 271 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SIZEOF);}
58725c
 	YY_BREAK
58725c
 case 74:
58725c
 YY_RULE_SETUP
58725c
-#line 272 "ldlex.l"
58725c
+#line 272 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(TARGET_K);}
58725c
 	YY_BREAK
58725c
 case 75:
58725c
 YY_RULE_SETUP
58725c
-#line 273 "ldlex.l"
58725c
+#line 273 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SEARCH_DIR);}
58725c
 	YY_BREAK
58725c
 case 76:
58725c
 YY_RULE_SETUP
58725c
-#line 274 "ldlex.l"
58725c
+#line 274 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(OUTPUT);}
58725c
 	YY_BREAK
58725c
 case 77:
58725c
 YY_RULE_SETUP
58725c
-#line 275 "ldlex.l"
58725c
+#line 275 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(INPUT);}
58725c
 	YY_BREAK
58725c
 case 78:
58725c
 YY_RULE_SETUP
58725c
-#line 276 "ldlex.l"
58725c
+#line 276 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(GROUP);}
58725c
 	YY_BREAK
58725c
 case 79:
58725c
 YY_RULE_SETUP
58725c
-#line 277 "ldlex.l"
58725c
+#line 277 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(AS_NEEDED);}
58725c
 	YY_BREAK
58725c
 case 80:
58725c
 YY_RULE_SETUP
58725c
-#line 278 "ldlex.l"
58725c
+#line 278 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(DEFINED);}
58725c
 	YY_BREAK
58725c
 case 81:
58725c
 YY_RULE_SETUP
58725c
-#line 279 "ldlex.l"
58725c
+#line 279 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(CREATE_OBJECT_SYMBOLS);}
58725c
 	YY_BREAK
58725c
 case 82:
58725c
 YY_RULE_SETUP
58725c
-#line 280 "ldlex.l"
58725c
+#line 280 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN( CONSTRUCTORS);}
58725c
 	YY_BREAK
58725c
 case 83:
58725c
 YY_RULE_SETUP
58725c
-#line 281 "ldlex.l"
58725c
+#line 281 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(FORCE_COMMON_ALLOCATION);}
58725c
 	YY_BREAK
58725c
 case 84:
58725c
 YY_RULE_SETUP
58725c
-#line 282 "ldlex.l"
58725c
+#line 282 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(INHIBIT_COMMON_ALLOCATION);}
58725c
 	YY_BREAK
58725c
 case 85:
58725c
 YY_RULE_SETUP
58725c
-#line 283 "ldlex.l"
58725c
+#line 283 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SECTIONS);}
58725c
 	YY_BREAK
58725c
 case 86:
58725c
 YY_RULE_SETUP
58725c
-#line 284 "ldlex.l"
58725c
+#line 284 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(INSERT_K);}
58725c
 	YY_BREAK
58725c
 case 87:
58725c
 YY_RULE_SETUP
58725c
-#line 285 "ldlex.l"
58725c
+#line 285 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(AFTER);}
58725c
 	YY_BREAK
58725c
 case 88:
58725c
 YY_RULE_SETUP
58725c
-#line 286 "ldlex.l"
58725c
+#line 286 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(BEFORE);}
58725c
 	YY_BREAK
58725c
 case 89:
58725c
 YY_RULE_SETUP
58725c
-#line 287 "ldlex.l"
58725c
+#line 287 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(FILL);}
58725c
 	YY_BREAK
58725c
 case 90:
58725c
 YY_RULE_SETUP
58725c
-#line 288 "ldlex.l"
58725c
+#line 288 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(STARTUP);}
58725c
 	YY_BREAK
58725c
 case 91:
58725c
 YY_RULE_SETUP
58725c
-#line 289 "ldlex.l"
58725c
+#line 289 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(OUTPUT_FORMAT);}
58725c
 	YY_BREAK
58725c
 case 92:
58725c
 YY_RULE_SETUP
58725c
-#line 290 "ldlex.l"
58725c
+#line 290 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN( OUTPUT_ARCH);}
58725c
 	YY_BREAK
58725c
 case 93:
58725c
 YY_RULE_SETUP
58725c
-#line 291 "ldlex.l"
58725c
+#line 291 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(HLL);}
58725c
 	YY_BREAK
58725c
 case 94:
58725c
 YY_RULE_SETUP
58725c
-#line 292 "ldlex.l"
58725c
+#line 292 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SYSLIB);}
58725c
 	YY_BREAK
58725c
 case 95:
58725c
 YY_RULE_SETUP
58725c
-#line 293 "ldlex.l"
58725c
+#line 293 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(FLOAT);}
58725c
 	YY_BREAK
58725c
 case 96:
58725c
 YY_RULE_SETUP
58725c
-#line 294 "ldlex.l"
58725c
+#line 294 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN( QUAD);}
58725c
 	YY_BREAK
58725c
 case 97:
58725c
 YY_RULE_SETUP
58725c
-#line 295 "ldlex.l"
58725c
+#line 295 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN( SQUAD);}
58725c
 	YY_BREAK
58725c
 case 98:
58725c
 YY_RULE_SETUP
58725c
-#line 296 "ldlex.l"
58725c
+#line 296 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN( LONG);}
58725c
 	YY_BREAK
58725c
 case 99:
58725c
 YY_RULE_SETUP
58725c
-#line 297 "ldlex.l"
58725c
+#line 297 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN( SHORT);}
58725c
 	YY_BREAK
58725c
 case 100:
58725c
 YY_RULE_SETUP
58725c
-#line 298 "ldlex.l"
58725c
+#line 298 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN( BYTE);}
58725c
 	YY_BREAK
58725c
 case 101:
58725c
 YY_RULE_SETUP
58725c
-#line 299 "ldlex.l"
58725c
+#line 299 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(NOFLOAT);}
58725c
 	YY_BREAK
58725c
 case 102:
58725c
 YY_RULE_SETUP
58725c
-#line 300 "ldlex.l"
58725c
+#line 300 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(NOCROSSREFS);}
58725c
 	YY_BREAK
58725c
 case 103:
58725c
 YY_RULE_SETUP
58725c
-#line 301 "ldlex.l"
58725c
+#line 301 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(NOCROSSREFS_TO);}
58725c
 	YY_BREAK
58725c
 case 104:
58725c
 YY_RULE_SETUP
58725c
-#line 302 "ldlex.l"
58725c
+#line 302 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(OVERLAY); }
58725c
 	YY_BREAK
58725c
 case 105:
58725c
 YY_RULE_SETUP
58725c
-#line 303 "ldlex.l"
58725c
+#line 303 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SORT_BY_NAME); }
58725c
 	YY_BREAK
58725c
 case 106:
58725c
 YY_RULE_SETUP
58725c
-#line 304 "ldlex.l"
58725c
+#line 304 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SORT_BY_ALIGNMENT); }
58725c
 	YY_BREAK
58725c
 case 107:
58725c
 YY_RULE_SETUP
58725c
-#line 305 "ldlex.l"
58725c
+#line 305 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SORT_BY_NAME); }
58725c
 	YY_BREAK
58725c
 case 108:
58725c
 YY_RULE_SETUP
58725c
-#line 306 "ldlex.l"
58725c
+#line 306 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SORT_BY_INIT_PRIORITY); }
58725c
 	YY_BREAK
58725c
 case 109:
58725c
 YY_RULE_SETUP
58725c
-#line 307 "ldlex.l"
58725c
+#line 307 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SORT_NONE); }
58725c
 	YY_BREAK
58725c
 case 110:
58725c
 YY_RULE_SETUP
58725c
-#line 308 "ldlex.l"
58725c
+#line 308 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(NOLOAD);}
58725c
 	YY_BREAK
58725c
 case 111:
58725c
 YY_RULE_SETUP
58725c
-#line 309 "ldlex.l"
58725c
+#line 309 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(DSECT);}
58725c
 	YY_BREAK
58725c
 case 112:
58725c
 YY_RULE_SETUP
58725c
-#line 310 "ldlex.l"
58725c
+#line 310 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(COPY);}
58725c
 	YY_BREAK
58725c
 case 113:
58725c
 YY_RULE_SETUP
58725c
-#line 311 "ldlex.l"
58725c
+#line 311 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(INFO);}
58725c
 	YY_BREAK
58725c
 case 114:
58725c
 YY_RULE_SETUP
58725c
-#line 312 "ldlex.l"
58725c
+#line 312 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(OVERLAY);}
58725c
 	YY_BREAK
58725c
 case 115:
58725c
 YY_RULE_SETUP
58725c
-#line 313 "ldlex.l"
58725c
+#line 313 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ONLY_IF_RO); }
58725c
 	YY_BREAK
58725c
 case 116:
58725c
 YY_RULE_SETUP
58725c
-#line 314 "ldlex.l"
58725c
+#line 314 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ONLY_IF_RW); }
58725c
 	YY_BREAK
58725c
 case 117:
58725c
 YY_RULE_SETUP
58725c
-#line 315 "ldlex.l"
58725c
+#line 315 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SPECIAL); }
58725c
 	YY_BREAK
58725c
 case 118:
58725c
 YY_RULE_SETUP
58725c
-#line 316 "ldlex.l"
58725c
+#line 316 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ORIGIN);}
58725c
 	YY_BREAK
58725c
 case 119:
58725c
 YY_RULE_SETUP
58725c
-#line 317 "ldlex.l"
58725c
+#line 317 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ORIGIN);}
58725c
 	YY_BREAK
58725c
 case 120:
58725c
 YY_RULE_SETUP
58725c
-#line 318 "ldlex.l"
58725c
+#line 318 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN( LENGTH);}
58725c
 	YY_BREAK
58725c
 case 121:
58725c
 YY_RULE_SETUP
58725c
-#line 319 "ldlex.l"
58725c
+#line 319 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN( LENGTH);}
58725c
 	YY_BREAK
58725c
 case 122:
58725c
 YY_RULE_SETUP
58725c
-#line 320 "ldlex.l"
58725c
+#line 320 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(INPUT_SECTION_FLAGS); }
58725c
 	YY_BREAK
58725c
 case 123:
58725c
 YY_RULE_SETUP
58725c
-#line 321 "ldlex.l"
58725c
+#line 321 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(INCLUDE);}
58725c
 	YY_BREAK
58725c
 case 124:
58725c
 YY_RULE_SETUP
58725c
-#line 322 "ldlex.l"
58725c
+#line 322 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN (PHDRS); }
58725c
 	YY_BREAK
58725c
 case 125:
58725c
 YY_RULE_SETUP
58725c
-#line 323 "ldlex.l"
58725c
+#line 323 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(AT);}
58725c
 	YY_BREAK
58725c
 case 126:
58725c
 YY_RULE_SETUP
58725c
-#line 324 "ldlex.l"
58725c
+#line 324 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ALIGN_WITH_INPUT);}
58725c
 	YY_BREAK
58725c
 case 127:
58725c
 YY_RULE_SETUP
58725c
-#line 325 "ldlex.l"
58725c
+#line 325 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SUBALIGN);}
58725c
 	YY_BREAK
58725c
 case 128:
58725c
 YY_RULE_SETUP
58725c
-#line 326 "ldlex.l"
58725c
+#line 326 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(HIDDEN); }
58725c
 	YY_BREAK
58725c
 case 129:
58725c
 YY_RULE_SETUP
58725c
-#line 327 "ldlex.l"
58725c
+#line 327 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(PROVIDE); }
58725c
 	YY_BREAK
58725c
 case 130:
58725c
 YY_RULE_SETUP
58725c
-#line 328 "ldlex.l"
58725c
+#line 328 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(PROVIDE_HIDDEN); }
58725c
 	YY_BREAK
58725c
 case 131:
58725c
 YY_RULE_SETUP
58725c
-#line 329 "ldlex.l"
58725c
+#line 329 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(KEEP); }
58725c
 	YY_BREAK
58725c
 case 132:
58725c
 YY_RULE_SETUP
58725c
-#line 330 "ldlex.l"
58725c
+#line 330 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(EXCLUDE_FILE); }
58725c
 	YY_BREAK
58725c
 case 133:
58725c
 YY_RULE_SETUP
58725c
-#line 331 "ldlex.l"
58725c
+#line 331 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(CONSTANT);}
58725c
 	YY_BREAK
58725c
 case 134:
58725c
 /* rule 134 can match eol */
58725c
 YY_RULE_SETUP
58725c
-#line 332 "ldlex.l"
58725c
+#line 332 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { ++ lineno; }
58725c
 	YY_BREAK
58725c
 case 135:
58725c
 /* rule 135 can match eol */
58725c
 YY_RULE_SETUP
58725c
-#line 333 "ldlex.l"
58725c
+#line 333 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { ++ lineno;  RTOKEN(NEWLINE); }
58725c
 	YY_BREAK
58725c
 case 136:
58725c
 YY_RULE_SETUP
58725c
-#line 334 "ldlex.l"
58725c
+#line 334 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { /* Mri comment line */ }
58725c
 	YY_BREAK
58725c
 case 137:
58725c
 YY_RULE_SETUP
58725c
-#line 335 "ldlex.l"
58725c
+#line 335 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { /* Mri comment line */ }
58725c
 	YY_BREAK
58725c
 case 138:
58725c
 YY_RULE_SETUP
58725c
-#line 336 "ldlex.l"
58725c
+#line 336 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ENDWORD); }
58725c
 	YY_BREAK
58725c
 case 139:
58725c
 YY_RULE_SETUP
58725c
-#line 337 "ldlex.l"
58725c
+#line 337 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ALIGNMOD);}
58725c
 	YY_BREAK
58725c
 case 140:
58725c
 YY_RULE_SETUP
58725c
-#line 338 "ldlex.l"
58725c
+#line 338 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ALIGN_K);}
58725c
 	YY_BREAK
58725c
 case 141:
58725c
 YY_RULE_SETUP
58725c
-#line 339 "ldlex.l"
58725c
+#line 339 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(CHIP); }
58725c
 	YY_BREAK
58725c
 case 142:
58725c
 YY_RULE_SETUP
58725c
-#line 340 "ldlex.l"
58725c
+#line 340 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(BASE); }
58725c
 	YY_BREAK
58725c
 case 143:
58725c
 YY_RULE_SETUP
58725c
-#line 341 "ldlex.l"
58725c
+#line 341 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ALIAS); }
58725c
 	YY_BREAK
58725c
 case 144:
58725c
 YY_RULE_SETUP
58725c
-#line 342 "ldlex.l"
58725c
+#line 342 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(TRUNCATE); }
58725c
 	YY_BREAK
58725c
 case 145:
58725c
 YY_RULE_SETUP
58725c
-#line 343 "ldlex.l"
58725c
+#line 343 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(LOAD); }
58725c
 	YY_BREAK
58725c
 case 146:
58725c
 YY_RULE_SETUP
58725c
-#line 344 "ldlex.l"
58725c
+#line 344 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(PUBLIC); }
58725c
 	YY_BREAK
58725c
 case 147:
58725c
 YY_RULE_SETUP
58725c
-#line 345 "ldlex.l"
58725c
+#line 345 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ORDER); }
58725c
 	YY_BREAK
58725c
 case 148:
58725c
 YY_RULE_SETUP
58725c
-#line 346 "ldlex.l"
58725c
+#line 346 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(NAMEWORD); }
58725c
 	YY_BREAK
58725c
 case 149:
58725c
 YY_RULE_SETUP
58725c
-#line 347 "ldlex.l"
58725c
+#line 347 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(FORMAT); }
58725c
 	YY_BREAK
58725c
 case 150:
58725c
 YY_RULE_SETUP
58725c
-#line 348 "ldlex.l"
58725c
+#line 348 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(CASE); }
58725c
 	YY_BREAK
58725c
 case 151:
58725c
 YY_RULE_SETUP
58725c
-#line 349 "ldlex.l"
58725c
+#line 349 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(START); }
58725c
 	YY_BREAK
58725c
 case 152:
58725c
 YY_RULE_SETUP
58725c
-#line 350 "ldlex.l"
58725c
+#line 350 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(LIST); /* LIST and ignore to end of line */ }
58725c
 	YY_BREAK
58725c
 case 153:
58725c
 YY_RULE_SETUP
58725c
-#line 351 "ldlex.l"
58725c
+#line 351 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SECT); }
58725c
 	YY_BREAK
58725c
 case 154:
58725c
 YY_RULE_SETUP
58725c
-#line 352 "ldlex.l"
58725c
+#line 352 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ABSOLUTE); }
58725c
 	YY_BREAK
58725c
 case 155:
58725c
 YY_RULE_SETUP
58725c
-#line 353 "ldlex.l"
58725c
+#line 353 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ENDWORD); }
58725c
 	YY_BREAK
58725c
 case 156:
58725c
 YY_RULE_SETUP
58725c
-#line 354 "ldlex.l"
58725c
+#line 354 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ALIGNMOD);}
58725c
 	YY_BREAK
58725c
 case 157:
58725c
 YY_RULE_SETUP
58725c
-#line 355 "ldlex.l"
58725c
+#line 355 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ALIGN_K);}
58725c
 	YY_BREAK
58725c
 case 158:
58725c
 YY_RULE_SETUP
58725c
-#line 356 "ldlex.l"
58725c
+#line 356 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(CHIP); }
58725c
 	YY_BREAK
58725c
 case 159:
58725c
 YY_RULE_SETUP
58725c
-#line 357 "ldlex.l"
58725c
+#line 357 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(BASE); }
58725c
 	YY_BREAK
58725c
 case 160:
58725c
 YY_RULE_SETUP
58725c
-#line 358 "ldlex.l"
58725c
+#line 358 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ALIAS); }
58725c
 	YY_BREAK
58725c
 case 161:
58725c
 YY_RULE_SETUP
58725c
-#line 359 "ldlex.l"
58725c
+#line 359 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(TRUNCATE); }
58725c
 	YY_BREAK
58725c
 case 162:
58725c
 YY_RULE_SETUP
58725c
-#line 360 "ldlex.l"
58725c
+#line 360 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(LOAD); }
58725c
 	YY_BREAK
58725c
 case 163:
58725c
 YY_RULE_SETUP
58725c
-#line 361 "ldlex.l"
58725c
+#line 361 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(PUBLIC); }
58725c
 	YY_BREAK
58725c
 case 164:
58725c
 YY_RULE_SETUP
58725c
-#line 362 "ldlex.l"
58725c
+#line 362 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ORDER); }
58725c
 	YY_BREAK
58725c
 case 165:
58725c
 YY_RULE_SETUP
58725c
-#line 363 "ldlex.l"
58725c
+#line 363 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(NAMEWORD); }
58725c
 	YY_BREAK
58725c
 case 166:
58725c
 YY_RULE_SETUP
58725c
-#line 364 "ldlex.l"
58725c
+#line 364 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(FORMAT); }
58725c
 	YY_BREAK
58725c
 case 167:
58725c
 YY_RULE_SETUP
58725c
-#line 365 "ldlex.l"
58725c
+#line 365 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(CASE); }
58725c
 	YY_BREAK
58725c
 case 168:
58725c
 YY_RULE_SETUP
58725c
-#line 366 "ldlex.l"
58725c
+#line 366 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(EXTERN); }
58725c
 	YY_BREAK
58725c
 case 169:
58725c
 YY_RULE_SETUP
58725c
-#line 367 "ldlex.l"
58725c
+#line 367 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(START); }
58725c
 	YY_BREAK
58725c
 case 170:
58725c
 YY_RULE_SETUP
58725c
-#line 368 "ldlex.l"
58725c
+#line 368 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(LIST); /* LIST and ignore to end of line */ }
58725c
 	YY_BREAK
58725c
 case 171:
58725c
 YY_RULE_SETUP
58725c
-#line 369 "ldlex.l"
58725c
+#line 369 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(SECT); }
58725c
 	YY_BREAK
58725c
 case 172:
58725c
 YY_RULE_SETUP
58725c
-#line 370 "ldlex.l"
58725c
+#line 370 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(ABSOLUTE); }
58725c
 	YY_BREAK
58725c
 case 173:
58725c
 YY_RULE_SETUP
58725c
-#line 372 "ldlex.l"
58725c
+#line 372 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 {
58725c
 /* Filename without commas, needed to parse mri stuff */
58725c
 				 yylval.name = xstrdup (yytext);
58725c
@@ -3008,7 +3033,7 @@ YY_RULE_SETUP
58725c
 	YY_BREAK
58725c
 case 174:
58725c
 YY_RULE_SETUP
58725c
-#line 379 "ldlex.l"
58725c
+#line 379 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 {
58725c
 				 yylval.name = xstrdup (yytext);
58725c
 				  return NAME;
58725c
@@ -3016,7 +3041,7 @@ YY_RULE_SETUP
58725c
 	YY_BREAK
58725c
 case 175:
58725c
 YY_RULE_SETUP
58725c
-#line 383 "ldlex.l"
58725c
+#line 383 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 {
58725c
 /* Filename to be prefixed by --sysroot or when non-sysrooted, nothing.  */
58725c
 				 yylval.name = xstrdup (yytext);
58725c
@@ -3025,7 +3050,7 @@ YY_RULE_SETUP
58725c
 	YY_BREAK
58725c
 case 176:
58725c
 YY_RULE_SETUP
58725c
-#line 388 "ldlex.l"
58725c
+#line 388 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 {
58725c
 				  yylval.name = xstrdup (yytext + 2);
58725c
 				  return LNAME;
58725c
@@ -3033,7 +3058,7 @@ YY_RULE_SETUP
58725c
 	YY_BREAK
58725c
 case 177:
58725c
 YY_RULE_SETUP
58725c
-#line 392 "ldlex.l"
58725c
+#line 392 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 {
58725c
 				 yylval.name = xstrdup (yytext);
58725c
 				  return NAME;
58725c
@@ -3041,7 +3066,7 @@ YY_RULE_SETUP
58725c
 	YY_BREAK
58725c
 case 178:
58725c
 YY_RULE_SETUP
58725c
-#line 396 "ldlex.l"
58725c
+#line 396 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 {
58725c
 				  yylval.name = xstrdup (yytext + 2);
58725c
 				  return LNAME;
58725c
@@ -3049,7 +3074,7 @@ YY_RULE_SETUP
58725c
 	YY_BREAK
58725c
 case 179:
58725c
 YY_RULE_SETUP
58725c
-#line 400 "ldlex.l"
58725c
+#line 400 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 {
58725c
 		/* Annoyingly, this pattern can match comments, and we have
58725c
 		   longest match issues to consider.  So if the first two
58725c
@@ -3070,66 +3095,72 @@ YY_RULE_SETUP
58725c
 case 180:
58725c
 /* rule 180 can match eol */
58725c
 YY_RULE_SETUP
58725c
-#line 417 "ldlex.l"
58725c
+#line 417 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 {
58725c
 					/* No matter the state, quotes
58725c
-					   give what's inside */
58725c
+                                           give what's inside.  */
58725c
+					bfd_size_type len;
58725c
 					yylval.name = xstrdup (yytext + 1);
58725c
-					yylval.name[yyleng - 2] = 0;
58725c
+					/* PR ld/20906.  A corrupt input file
58725c
+                                        can contain bogus strings.  */
58725c
+					len = strlen (yylval.name);
58725c
+					if (len > yyleng - 2)
58725c
+					  len = yyleng - 2;
58725c
+					yylval.name[len] = 0;
58725c
 					return NAME;
58725c
 				}
58725c
 	YY_BREAK
58725c
 case 181:
58725c
 /* rule 181 can match eol */
58725c
 YY_RULE_SETUP
58725c
-#line 424 "ldlex.l"
58725c
+#line 430 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { lineno++;}
58725c
 	YY_BREAK
58725c
 case 182:
58725c
 YY_RULE_SETUP
58725c
-#line 425 "ldlex.l"
58725c
+#line 431 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { }
58725c
 	YY_BREAK
58725c
 case 183:
58725c
 YY_RULE_SETUP
58725c
-#line 427 "ldlex.l"
58725c
+#line 433 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { return *yytext; }
58725c
 	YY_BREAK
58725c
 case 184:
58725c
 YY_RULE_SETUP
58725c
-#line 429 "ldlex.l"
58725c
+#line 435 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(GLOBAL); }
58725c
 	YY_BREAK
58725c
 case 185:
58725c
 YY_RULE_SETUP
58725c
-#line 431 "ldlex.l"
58725c
+#line 437 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(LOCAL); }
58725c
 	YY_BREAK
58725c
 case 186:
58725c
 YY_RULE_SETUP
58725c
-#line 433 "ldlex.l"
58725c
+#line 439 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { RTOKEN(EXTERN); }
58725c
 	YY_BREAK
58725c
 case 187:
58725c
 YY_RULE_SETUP
58725c
-#line 435 "ldlex.l"
58725c
+#line 441 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { yylval.name = xstrdup (yytext);
58725c
 				  return VERS_IDENTIFIER; }
58725c
 	YY_BREAK
58725c
 case 188:
58725c
 YY_RULE_SETUP
58725c
-#line 438 "ldlex.l"
58725c
+#line 444 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { yylval.name = xstrdup (yytext);
58725c
 				  return VERS_TAG; }
58725c
 	YY_BREAK
58725c
 case 189:
58725c
 YY_RULE_SETUP
58725c
-#line 441 "ldlex.l"
58725c
+#line 447 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { BEGIN(VERS_SCRIPT); return *yytext; }
58725c
 	YY_BREAK
58725c
 case 190:
58725c
 YY_RULE_SETUP
58725c
-#line 443 "ldlex.l"
58725c
+#line 449 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { BEGIN(VERS_NODE);
58725c
 				  vers_node_nesting = 0;
58725c
 				  return *yytext;
58725c
@@ -3137,17 +3168,17 @@ YY_RULE_SETUP
58725c
 	YY_BREAK
58725c
 case 191:
58725c
 YY_RULE_SETUP
58725c
-#line 447 "ldlex.l"
58725c
+#line 453 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { return *yytext; }
58725c
 	YY_BREAK
58725c
 case 192:
58725c
 YY_RULE_SETUP
58725c
-#line 448 "ldlex.l"
58725c
+#line 454 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { vers_node_nesting++; return *yytext; }
58725c
 	YY_BREAK
58725c
 case 193:
58725c
 YY_RULE_SETUP
58725c
-#line 449 "ldlex.l"
58725c
+#line 455 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { if (--vers_node_nesting < 0)
58725c
 				    BEGIN(VERS_SCRIPT);
58725c
 				  return *yytext;
58725c
@@ -3156,17 +3187,17 @@ YY_RULE_SETUP
58725c
 case 194:
58725c
 /* rule 194 can match eol */
58725c
 YY_RULE_SETUP
58725c
-#line 454 "ldlex.l"
58725c
+#line 460 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { lineno++; }
58725c
 	YY_BREAK
58725c
 case 195:
58725c
 YY_RULE_SETUP
58725c
-#line 456 "ldlex.l"
58725c
+#line 462 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { /* Eat up comments */ }
58725c
 	YY_BREAK
58725c
 case 196:
58725c
 YY_RULE_SETUP
58725c
-#line 458 "ldlex.l"
58725c
+#line 464 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 { /* Eat up whitespace */ }
58725c
 	YY_BREAK
58725c
 case YY_STATE_EOF(INITIAL):
58725c
@@ -3179,7 +3210,7 @@ case YY_STATE_EOF(MRI):
58725c
 case YY_STATE_EOF(VERS_START):
58725c
 case YY_STATE_EOF(VERS_SCRIPT):
58725c
 case YY_STATE_EOF(VERS_NODE):
58725c
-#line 460 "ldlex.l"
58725c
+#line 466 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 {
58725c
   include_stack_ptr--;
58725c
   if (include_stack_ptr == 0)
58725c
@@ -3195,20 +3226,20 @@ case YY_STATE_EOF(VERS_NODE):
58725c
 	YY_BREAK
58725c
 case 197:
58725c
 YY_RULE_SETUP
58725c
-#line 473 "ldlex.l"
58725c
+#line 479 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 lex_warn_invalid (" in script", yytext);
58725c
 	YY_BREAK
58725c
 case 198:
58725c
 YY_RULE_SETUP
58725c
-#line 474 "ldlex.l"
58725c
+#line 480 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 lex_warn_invalid (" in expression", yytext);
58725c
 	YY_BREAK
58725c
 case 199:
58725c
 YY_RULE_SETUP
58725c
-#line 476 "ldlex.l"
58725c
+#line 482 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 ECHO;
58725c
 	YY_BREAK
58725c
-#line 3212 "ldlex.c"
58725c
+#line 3243 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.c"
58725c
 
58725c
 	case YY_END_OF_BUFFER:
58725c
 		{
58725c
@@ -3337,6 +3368,7 @@ ECHO;
58725c
 			"fatal flex scanner internal error--no action found" );
58725c
 	} /* end of action switch */
58725c
 		} /* end of scanning one token */
58725c
+	} /* end of user's declarations */
58725c
 } /* end of yylex */
58725c
 
58725c
 /* yy_get_next_buffer - try to read in a new buffer
58725c
@@ -3348,9 +3380,9 @@ ECHO;
58725c
  */
58725c
 static int yy_get_next_buffer (void)
58725c
 {
58725c
-    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
58725c
-	register char *source = (yytext_ptr);
58725c
-	register int number_to_move, i;
58725c
+    	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
58725c
+	char *source = (yytext_ptr);
58725c
+	yy_size_t number_to_move, i;
58725c
 	int ret_val;
58725c
 
58725c
 	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
58725c
@@ -3379,7 +3411,7 @@ static int yy_get_next_buffer (void)
58725c
 	/* Try to read more data. */
58725c
 
58725c
 	/* First move last chars to start of buffer. */
58725c
-	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
58725c
+	number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
58725c
 
58725c
 	for ( i = 0; i < number_to_move; ++i )
58725c
 		*(dest++) = *(source++);
58725c
@@ -3392,14 +3424,14 @@ static int yy_get_next_buffer (void)
58725c
 
58725c
 	else
58725c
 		{
58725c
-			yy_size_t num_to_read =
58725c
+			int num_to_read =
58725c
 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
58725c
 
58725c
 		while ( num_to_read <= 0 )
58725c
 			{ /* Not enough room in the buffer - grow it. */
58725c
 
58725c
 			/* just a shorter name for the current buffer */
58725c
-			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
58725c
+			YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
58725c
 
58725c
 			int yy_c_buf_p_offset =
58725c
 				(int) ((yy_c_buf_p) - b->yy_ch_buf);
58725c
@@ -3482,14 +3514,14 @@ static int yy_get_next_buffer (void)
58725c
 
58725c
     static yy_state_type yy_get_previous_state (void)
58725c
 {
58725c
-	register yy_state_type yy_current_state;
58725c
-	register char *yy_cp;
58725c
+	yy_state_type yy_current_state;
58725c
+	char *yy_cp;
58725c
     
58725c
 	yy_current_state = (yy_start);
58725c
 
58725c
 	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
58725c
 		{
58725c
-		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
58725c
+		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
58725c
 		if ( yy_accept[yy_current_state] )
58725c
 			{
58725c
 			(yy_last_accepting_state) = yy_current_state;
58725c
@@ -3514,10 +3546,10 @@ static int yy_get_next_buffer (void)
58725c
  */
58725c
     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
58725c
 {
58725c
-	register int yy_is_jam;
58725c
-    	register char *yy_cp = (yy_c_buf_p);
58725c
+	int yy_is_jam;
58725c
+    	char *yy_cp = (yy_c_buf_p);
58725c
 
58725c
-	register YY_CHAR yy_c = 1;
58725c
+	YY_CHAR yy_c = 1;
58725c
 	if ( yy_accept[yy_current_state] )
58725c
 		{
58725c
 		(yy_last_accepting_state) = yy_current_state;
58725c
@@ -3532,9 +3564,13 @@ static int yy_get_next_buffer (void)
58725c
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
58725c
 	yy_is_jam = (yy_current_state == 1774);
58725c
 
58725c
-	return yy_is_jam ? 0 : yy_current_state;
58725c
+		return yy_is_jam ? 0 : yy_current_state;
58725c
 }
58725c
 
58725c
+#ifndef YY_NO_UNPUT
58725c
+
58725c
+#endif
58725c
+
58725c
 #ifndef YY_NO_INPUT
58725c
 #ifdef __cplusplus
58725c
     static int yyinput (void)
58725c
@@ -3583,7 +3619,7 @@ static int yy_get_next_buffer (void)
58725c
 				case EOB_ACT_END_OF_FILE:
58725c
 					{
58725c
 					if ( yywrap( ) )
58725c
-						return 0;
58725c
+						return EOF;
58725c
 
58725c
 					if ( ! (yy_did_buffer_switch_on_eof) )
58725c
 						YY_NEW_FILE;
58725c
@@ -3684,7 +3720,7 @@ static void yy_load_buffer_state  (void)
58725c
 	if ( ! b )
58725c
 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
58725c
 
58725c
-	b->yy_buf_size = size;
58725c
+	b->yy_buf_size = (yy_size_t)size;
58725c
 
58725c
 	/* yy_ch_buf has to be 2 characters longer than the size given because
58725c
 	 * we need to put in 2 end-of-buffer characters.
58725c
@@ -3719,10 +3755,6 @@ static void yy_load_buffer_state  (void)
58725c
 	yyfree((void *) b  );
58725c
 }
58725c
 
58725c
-#ifndef __cplusplus
58725c
-extern int isatty (int );
58725c
-#endif /* __cplusplus */
58725c
-    
58725c
 /* Initializes or reinitializes a buffer.
58725c
  * This function is sometimes called more than once on the same buffer,
58725c
  * such as during a yyrestart() or at EOF.
58725c
@@ -3843,7 +3875,7 @@ static void yyensure_buffer_stack (void)
58725c
 		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
58725c
 		 * immediate realloc on the next call.
58725c
          */
58725c
-		num_to_alloc = 1;
58725c
+      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
58725c
 		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
58725c
 								(num_to_alloc * sizeof(struct yy_buffer_state*)
58725c
 								);
58725c
@@ -3860,7 +3892,7 @@ static void yyensure_buffer_stack (void)
58725c
 	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
58725c
 
58725c
 		/* Increase the buffer to prepare for a possible push. */
58725c
-		int grow_size = 8 /* arbitrary grow size */;
58725c
+		yy_size_t grow_size = 8 /* arbitrary grow size */;
58725c
 
58725c
 		num_to_alloc = (yy_buffer_stack_max) + grow_size;
58725c
 		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
58725c
@@ -3927,8 +3959,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst
58725c
 
58725c
 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
58725c
  * scan from a @e copy of @a bytes.
58725c
- * @param bytes the byte buffer to scan
58725c
- * @param len the number of bytes in the buffer pointed to by @a bytes.
58725c
+ * @param yybytes the byte buffer to scan
58725c
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
58725c
  * 
58725c
  * @return the newly allocated buffer state object.
58725c
  */
58725c
@@ -3936,7 +3968,8 @@ YY_BUFFER_STATE yy_scan_bytes  (yyconst
58725c
 {
58725c
 	YY_BUFFER_STATE b;
58725c
 	char *buf;
58725c
-	yy_size_t n, i;
58725c
+	yy_size_t n;
58725c
+	yy_size_t i;
58725c
     
58725c
 	/* Get memory for full buffer, including space for trailing EOB's. */
58725c
 	n = _yybytes_len + 2;
58725c
@@ -3967,7 +4000,7 @@ YY_BUFFER_STATE yy_scan_bytes  (yyconst
58725c
 
58725c
 static void yy_fatal_error (yyconst char* msg )
58725c
 {
58725c
-    	(void) fprintf( stderr, "%s\n", msg );
58725c
+			(void) fprintf( stderr, "%s\n", msg );
58725c
 	exit( YY_EXIT_FAILURE );
58725c
 }
58725c
 
58725c
@@ -3978,7 +4011,7 @@ static void yy_fatal_error (yyconst char
58725c
 	do \
58725c
 		{ \
58725c
 		/* Undo effects of setting up yytext. */ \
58725c
-        int yyless_macro_arg = (n); \
58725c
+        yy_size_t yyless_macro_arg = (n); \
58725c
         YY_LESS_LINENO(yyless_macro_arg);\
58725c
 		yytext[yyleng] = (yy_hold_char); \
58725c
 		(yy_c_buf_p) = yytext + yyless_macro_arg; \
58725c
@@ -4033,29 +4066,29 @@ char *yyget_text  (void)
58725c
 }
58725c
 
58725c
 /** Set the current line number.
58725c
- * @param line_number
58725c
+ * @param _line_number line number
58725c
  * 
58725c
  */
58725c
-void yyset_lineno (int  line_number )
58725c
+void yyset_lineno (int  _line_number )
58725c
 {
58725c
     
58725c
-    yylineno = line_number;
58725c
+    yylineno = _line_number;
58725c
 }
58725c
 
58725c
 /** Set the input stream. This does not discard the current
58725c
  * input buffer.
58725c
- * @param in_str A readable stream.
58725c
+ * @param _in_str A readable stream.
58725c
  * 
58725c
  * @see yy_switch_to_buffer
58725c
  */
58725c
-void yyset_in (FILE *  in_str )
58725c
+void yyset_in (FILE *  _in_str )
58725c
 {
58725c
-        yyin = in_str ;
58725c
+        yyin = _in_str ;
58725c
 }
58725c
 
58725c
-void yyset_out (FILE *  out_str )
58725c
+void yyset_out (FILE *  _out_str )
58725c
 {
58725c
-        yyout = out_str ;
58725c
+        yyout = _out_str ;
58725c
 }
58725c
 
58725c
 int yyget_debug  (void)
58725c
@@ -4063,9 +4096,9 @@ int yyget_debug  (void)
58725c
         return yy_flex_debug;
58725c
 }
58725c
 
58725c
-void yyset_debug (int  bdebug )
58725c
+void yyset_debug (int  _bdebug )
58725c
 {
58725c
-        yy_flex_debug = bdebug ;
58725c
+        yy_flex_debug = _bdebug ;
58725c
 }
58725c
 
58725c
 static int yy_init_globals (void)
58725c
@@ -4125,7 +4158,8 @@ int yylex_destroy  (void)
58725c
 #ifndef yytext_ptr
58725c
 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
58725c
 {
58725c
-	register int i;
58725c
+		
58725c
+	int i;
58725c
 	for ( i = 0; i < n; ++i )
58725c
 		s1[i] = s2[i];
58725c
 }
58725c
@@ -4134,7 +4168,7 @@ static void yy_flex_strncpy (char* s1, y
58725c
 #ifdef YY_NEED_STRLEN
58725c
 static int yy_flex_strlen (yyconst char * s )
58725c
 {
58725c
-	register int n;
58725c
+	int n;
58725c
 	for ( n = 0; s[n]; ++n )
58725c
 		;
58725c
 
58725c
@@ -4144,11 +4178,12 @@ static int yy_flex_strlen (yyconst char
58725c
 
58725c
 void *yyalloc (yy_size_t  size )
58725c
 {
58725c
-	return (void *) malloc( size );
58725c
+			return (void *) malloc( size );
58725c
 }
58725c
 
58725c
 void *yyrealloc  (void * ptr, yy_size_t  size )
58725c
 {
58725c
+		
58725c
 	/* The cast to (char *) in the following accommodates both
58725c
 	 * implementations that use char* generic pointers, and those
58725c
 	 * that use void* generic pointers.  It works with the latter
58725c
@@ -4161,12 +4196,12 @@ void *yyrealloc  (void * ptr, yy_size_t
58725c
 
58725c
 void yyfree (void * ptr )
58725c
 {
58725c
-	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
58725c
+			free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
58725c
 }
58725c
 
58725c
 #define YYTABLES_NAME "yytables"
58725c
 
58725c
-#line 476 "ldlex.l"
58725c
+#line 482 "/work/sources/rhel/binutils/rhel-7.4/binutils-2.27/ld/ldlex.l"
58725c
 
58725c
 
58725c
 
58725c
diff -rup binutils.orig/ld/ldlex.l binutils-2.27/ld/ldlex.l
58725c
--- binutils.orig/ld/ldlex.l	2017-03-24 13:50:55.613184724 +0000
58725c
+++ binutils-2.27/ld/ldlex.l	2017-03-24 14:20:35.039227142 +0000
58725c
@@ -416,9 +416,15 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([
58725c
 
58725c
 <EXPRESSION,BOTH,SCRIPT,VERS_NODE,INPUTLIST>"\""[^\"]*"\"" {
58725c
 					/* No matter the state, quotes
58725c
-					   give what's inside */
58725c
+                                           give what's inside.  */
58725c
+					bfd_size_type len;
58725c
 					yylval.name = xstrdup (yytext + 1);
58725c
-					yylval.name[yyleng - 2] = 0;
58725c
+					/* PR ld/20906.  A corrupt input file
58725c
+                                        can contain bogus strings.  */
58725c
+					len = strlen (yylval.name);
58725c
+					if (len > yyleng - 2)
58725c
+					  len = yyleng - 2;
58725c
+					yylval.name[len] = 0;
58725c
 					return NAME;
58725c
 				}
58725c
 <BOTH,SCRIPT,EXPRESSION>"\n"		{ lineno++;}