aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-10-16 14:42:15 +0000
committerNick Clifton <nickc@redhat.com>2007-10-16 14:42:15 +0000
commit504b7d2026f1fbbe912b6f513c069c0d47ba2505 (patch)
treeaa3186b5ab4a002cd64900af269e99d41031d584 /gas/config
parent62c018fe4a6de89d710e84b7efffe2462fa435cd (diff)
downloadgdb-504b7d2026f1fbbe912b6f513c069c0d47ba2505.zip
gdb-504b7d2026f1fbbe912b6f513c069c0d47ba2505.tar.gz
gdb-504b7d2026f1fbbe912b6f513c069c0d47ba2505.tar.bz2
Support the use of the STT_COMMON type. (In source and object files only at the moment)
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/obj-elf.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 429b32f..ab1550d 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -1587,6 +1587,33 @@ obj_elf_type (int ignore ATTRIBUTE_UNUSED)
else if (strcmp (typename, "notype") == 0
|| strcmp (typename, "STT_NOTYPE") == 0)
;
+ else if (strcmp (typename, "common") == 0
+ || strcmp (typename, "STT_COMMON") == 0)
+ {
+ type = BSF_OBJECT;
+
+ if (! S_IS_COMMON (sym))
+ {
+ if (S_IS_VOLATILE (sym))
+ {
+ sym = symbol_clone (sym, 1);
+ S_SET_SEGMENT (sym, bfd_com_section_ptr);
+ S_SET_VALUE (sym, 0);
+ S_SET_EXTERNAL (sym);
+ symbol_set_frag (sym, &zero_address_frag);
+ S_CLEAR_VOLATILE (sym);
+ }
+ else if (S_IS_DEFINED (sym) || symbol_equated_p (sym))
+ as_bad (_("symbol '%s' is already defined"), S_GET_NAME (sym));
+ else
+ {
+ /* FIXME: Is it safe to just change the section ? */
+ S_SET_SEGMENT (sym, bfd_com_section_ptr);
+ S_SET_VALUE (sym, 0);
+ S_SET_EXTERNAL (sym);
+ }
+ }
+ }
#ifdef md_elf_symbol_type
else if ((type = md_elf_symbol_type (typename, sym, elfsym)) != -1)
;