gas: sparc: fix collision of registers and pseudo-ops.
[deliverable/binutils-gdb.git] / bfd / syms.c
index 0b0d26ded606bed121789b225c8d938a79663325..5a22c0b38b8b325ebe1a9eeae7f9318c2abc7c8c 100644 (file)
@@ -1,5 +1,5 @@
 /* Generic symbol-table support for the BFD library.
-   Copyright (C) 1990-2015 Free Software Foundation, Inc.
+   Copyright (C) 1990-2016 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -219,8 +219,7 @@ CODE_FRAGMENT
 .#define BSF_EXPORT    BSF_GLOBAL {* No real difference.  *}
 .
 .  {* A normal C symbol would be one of:
-.     <<BSF_LOCAL>>, <<BSF_COMMON>>,  <<BSF_UNDEFINED>> or
-.     <<BSF_GLOBAL>>.  *}
+.     <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>.  *}
 .
 .  {* The symbol is a debugging record. The value has an arbitrary
 .     meaning, unless BSF_DEBUGGING_RELOC is also set.  *}
@@ -232,7 +231,9 @@ CODE_FRAGMENT
 .
 .  {* Used by the linker.  *}
 .#define BSF_KEEP              (1 << 5)
-.#define BSF_KEEP_G            (1 << 6)
+.
+.  {* An ELF common symbol.  *}
+.#define BSF_ELF_COMMON                (1 << 6)
 .
 .  {* A weak global symbol, overridable without warnings by
 .     a regular global symbol of the same name.  *}
@@ -1082,11 +1083,13 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
                  return FALSE;
                }
 
-             val = bfd_get_32 (abfd, info->stabs + r->address);
+             val = bfd_get_32 (abfd, info->stabs
+                               + r->address * bfd_octets_per_byte (abfd));
              val &= r->howto->src_mask;
              sym = *r->sym_ptr_ptr;
              val += sym->value + sym->section->vma + r->addend;
-             bfd_put_32 (abfd, (bfd_vma) val, info->stabs + r->address);
+             bfd_put_32 (abfd, (bfd_vma) val, info->stabs
+                         + r->address * bfd_octets_per_byte (abfd));
            }
        }
 
@@ -1192,7 +1195,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
                {
                  nul_fun = stab;
                  nul_str = str;
-                 if (file_name >= (char *) info->strs + strsize)
+                 if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
                    file_name = NULL;
                  if (stab + STABSIZE + TYPEOFF < info->stabs + stabsize
                      && *(stab + STABSIZE + TYPEOFF) == (bfd_byte) N_SO)
@@ -1203,7 +1206,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
                      directory_name = file_name;
                      file_name = ((char *) str
                                   + bfd_get_32 (abfd, stab + STRDXOFF));
-                     if (file_name >= (char *) info->strs + strsize)
+                     if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
                        file_name = NULL;
                    }
                }
@@ -1213,7 +1216,8 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
              /* The name of an include file.  */
              file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
              /* PR 17512: file: 0c680a1f.  */
-             if (file_name >= (char *) info->strs + strsize)
+             /* PR 17512: file: 5da8aec4.  */
+             if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
                file_name = NULL;
              break;
 
@@ -1331,7 +1335,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
          if (val <= offset)
            {
              file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
-             if (file_name >= (char *) info->strs + strsize)
+             if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
                file_name = NULL;
              *pline = 0;
            }
This page took 0.02513 seconds and 4 git commands to generate.