This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH PR 936: sh64-elf is broken
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Fri, 6 May 2005 11:04:06 -0700
- Subject: PATCH PR 936: sh64-elf is broken
sh64-elf has additonal fake labels. This patch supports them.
H.J.
---
2005-05-06 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.
--- gas/config/tc-sh64.c.fake 2005-05-05 09:15:40.000000000 -0700
+++ gas/config/tc-sh64.c 2005-05-06 10:48:08.000000000 -0700
@@ -3513,3 +3513,18 @@ sh64_vtable_inherit (int ignore ATTRIBUT
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;
+}
--- gas/config/tc-sh64.h.fake 2005-05-05 09:15:40.000000000 -0700
+++ gas/config/tc-sh64.h 2005-05-06 10:44:03.000000000 -0700
@@ -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 *);
--- gas/doc/internals.texi.fake 2005-04-29 08:44:57.000000000 -0700
+++ gas/doc/internals.texi 2005-05-06 10:55:42.000000000 -0700
@@ -1014,6 +1014,11 @@ is a label, even if it does not have a c
You may define this macro to control what GAS considers to be a label. The
default definition is to accept any name followed by a colon character.
+@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 TC_START_LABEL_WITHOUT_COLON
@cindex TC_START_LABEL_WITHOUT_COLON
Same as TC_START_LABEL, but should be used instead of TC_START_LABEL when
--- gas/write.c.fake 2005-05-05 09:15:36.000000000 -0700
+++ gas/write.c 2005-05-06 10:48:00.000000000 -0700
@@ -97,6 +97,10 @@
#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_U
= 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);