2005-05-09 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 9 May 2005 14:20:52 +0000 (14:20 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 9 May 2005 14:20:52 +0000 (14:20 +0000)
PR 936
* config/tc-sh64.c (sh64_fake_label): New.

* config/tc-sh64.h (TC_FAKE_LABEL): New.

* doc/internals.texi (TC_FAKE_LABEL): Document.

* write.c (TC_FAKE_LABEL): New.
(adjust_reloc_syms): Use it.
(write_object_file): Likewise.

gas/ChangeLog
gas/config/tc-sh64.c
gas/config/tc-sh64.h
gas/doc/internals.texi
gas/write.c

index cf43685..a9a6c5f 100644 (file)
@@ -1,3 +1,16 @@
+2005-05-09  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR 936
+       * config/tc-sh64.c (sh64_fake_label): New.
+
+       * config/tc-sh64.h (TC_FAKE_LABEL): New.
+
+       * doc/internals.texi (TC_FAKE_LABEL): Document.
+
+       * write.c (TC_FAKE_LABEL): New.
+       (adjust_reloc_syms): Use it.
+       (write_object_file): Likewise.
+
 2005-05-09  Jan Beulich  <jbeulich@novell.com>
 
        * config/tc-i386.c (parse_insn): Disallow use of prefix separator
index 54f704f..a7a61fb 100644 (file)
@@ -3513,3 +3513,18 @@ sh64_vtable_inherit (int ignore ATTRIBUTE_UNUSED)
   input_line_pointer = eol;
 }
 
+int
+sh64_fake_label (const char *name)
+{
+  size_t len;
+
+  if (strcmp (name, FAKE_LABEL_NAME) == 0)
+    return 1;
+
+  len = strlen (name);
+  if (len >= (sizeof (DATALABEL_SUFFIX) - 1))
+    return strcmp (&name [len - sizeof (DATALABEL_SUFFIX) + 1],
+                  DATALABEL_SUFFIX) == 0;
+
+  return 0;
+}
index 89a7e77..cbb3779 100644 (file)
@@ -221,3 +221,6 @@ void shmedia_md_end (void);
    we have to say we only have minimum byte-size insns.  */
 #undef  DWARF2_LINE_MIN_INSN_LENGTH
 #define DWARF2_LINE_MIN_INSN_LENGTH 1
+
+#define TC_FAKE_LABEL(NAME) sh64_fake_label(NAME)
+extern int sh64_fake_label (const char *);
index 1770a44..e75281f 100644 (file)
@@ -1019,6 +1019,11 @@ default definition is to accept any name followed by a colon character.
 Same as TC_START_LABEL, but should be used instead of TC_START_LABEL when
 LABELS_WITHOUT_COLONS is defined.
 
+@item TC_FAKE_LABEL
+@cindex TC_FAKE_LABEL
+You may define this macro to control what GAS considers to be a fake
+label.  The default fake label is FAKE_LABEL_NAME.
+
 @item NO_PSEUDO_DOT
 @cindex NO_PSEUDO_DOT
 If you define this macro, GAS will not require pseudo-ops to start with a
index 5e25e0b..7f4e2d5 100644 (file)
 #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from (FIX)
 #endif
 
+#ifndef TC_FAKE_LABEL
+#define TC_FAKE_LABEL(NAME) (strcmp ((NAME), FAKE_LABEL_NAME) == 0)
+#endif
+
 /* Used to control final evaluation of expressions.  */
 int finalize_syms = 0;
 
@@ -795,7 +799,7 @@ adjust_reloc_syms (bfd *abfd ATTRIBUTE_UNUSED,
              = symbol_get_value_expression (sym)->X_add_symbol;
            const char *name = S_GET_NAME (sym);
            if (!S_IS_COMMON (new_sym)
-               && strcmp (name, FAKE_LABEL_NAME)
+               && !TC_FAKE_LABEL (name)
                && (!S_IS_EXTERNAL (sym) || S_IS_LOCAL (sym)))
              as_bad (_("Local symbol `%s' can't be equated to undefined symbol `%s'"),
                      name, S_GET_NAME (new_sym));
@@ -1928,7 +1932,7 @@ write_object_file (void)
            {
              const char *name = S_GET_NAME (symp);
              if (S_IS_COMMON (symp)
-                 && strcmp (name, FAKE_LABEL_NAME)
+                 && !TC_FAKE_LABEL (name)
                  && (!S_IS_EXTERNAL (symp) || S_IS_LOCAL (symp)))
                {
                  expressionS *e = symbol_get_value_expression (symp);