This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
v850-ld use of elf_link_hash_entry.other
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sourceware dot org
- Date: Thu, 8 Mar 2007 22:09:55 +1030
- Subject: v850-ld use of elf_link_hash_entry.other
Make some horrible hacks in the v850 backend a little more palatable.
include/elf/
* v850.h (V850_OTHER_TDA_BYTE): Delete.
(V850_OTHER_SDA, V850_OTHER_ZDA, V850_OTHER_TDA): Assign bits
that don't clash with visibility bits.
bfd/
* elf32-v850.c (v850_elf_link_output_symbol_hook): Clean out
V850_OTHER_* bits.
Index: include/elf/v850.h
===================================================================
RCS file: /cvs/src/src/include/elf/v850.h,v
retrieving revision 1.12
diff -u -p -r1.12 v850.h
--- include/elf/v850.h 10 May 2005 10:21:10 -0000 1.12
+++ include/elf/v850.h 8 Mar 2007 11:16:26 -0000
@@ -41,10 +41,9 @@
/* Flags for the st_other field. */
-#define V850_OTHER_SDA 0x01 /* Symbol had SDA relocations. */
-#define V850_OTHER_ZDA 0x02 /* Symbol had ZDA relocations. */
-#define V850_OTHER_TDA 0x04 /* Symbol had TDA relocations. */
-#define V850_OTHER_TDA_BYTE 0x08 /* Symbol had TDA byte relocations. */
+#define V850_OTHER_SDA 0x10 /* Symbol had SDA relocations. */
+#define V850_OTHER_ZDA 0x20 /* Symbol had ZDA relocations. */
+#define V850_OTHER_TDA 0x40 /* Symbol had TDA relocations. */
#define V850_OTHER_ERROR 0x80 /* Symbol had an error reported. */
/* V850 relocations. */
Index: bfd/elf32-v850.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-v850.c,v
retrieving revision 1.65
diff -u -p -r1.65 elf32-v850.c
--- bfd/elf32-v850.c 7 Mar 2007 08:54:34 -0000 1.65
+++ bfd/elf32-v850.c 8 Mar 2007 11:37:06 -0000
@@ -2099,6 +2099,12 @@ v850_elf_link_output_symbol_hook (struct
sym->st_shndx = SHN_V850_ZCOMMON;
}
+ /* The price we pay for using h->other unused bits as flags in the
+ linker is cleaning up after ourselves. */
+
+ sym->st_other &= ~(V850_OTHER_SDA | V850_OTHER_ZDA | V850_OTHER_TDA
+ | V850_OTHER_ERROR);
+
return TRUE;
}
--
Alan Modra
IBM OzLabs - Linux Technology Centre