* config/obj-elf.c (elf_copy_symbol_attributes): Make it a global
authorAlan Modra <amodra@gmail.com>
Wed, 8 Aug 2001 13:11:58 +0000 (13:11 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 8 Aug 2001 13:11:58 +0000 (13:11 +0000)
function, and expand old obj-elf.h OBJ_COPY_SYMBOL_ATTRIBUTES here.
* config/obj-elf.h (elf_copy_symbol_attributes): Declare.
(OBJ_COPY_SYMBOL_ATTRIBUTES): Call elf_copy_symbol_attributes.

gas/ChangeLog
gas/config/obj-elf.c
gas/config/obj-elf.h

index 0478495dee371dcf0abf42ca722b1db7189dbf25..424a69b0e31e076f3dc39cf162947d65006cae86 100644 (file)
@@ -1,5 +1,10 @@
 2001-08-08  Alan Modra  <amodra@bigpond.net.au>
 
+       * config/obj-elf.c (elf_copy_symbol_attributes): Make it a global
+       function, and expand old obj-elf.h OBJ_COPY_SYMBOL_ATTRIBUTES here.
+       * config/obj-elf.h (elf_copy_symbol_attributes): Declare.
+       (OBJ_COPY_SYMBOL_ATTRIBUTES): Call elf_copy_symbol_attributes.
+
        * output-file.c (output_file_create): Don't try to open using
        FOPEN_W as it's unnecessary and VMS doesn't define FOPEN_W.
 
index 8c59479f06847bbe0b2fa229105aef099f4690f7..f29849888363e2cc2aea94240de461208f212532 100644 (file)
@@ -1,5 +1,5 @@
 /* ELF object file format
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -55,7 +55,6 @@ static void elf_s_set_size PARAMS ((symbolS *, bfd_vma));
 static bfd_vma elf_s_get_align PARAMS ((symbolS *));
 static void elf_s_set_align PARAMS ((symbolS *, bfd_vma));
 static void elf_s_set_other PARAMS ((symbolS *, int));
-static void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *));
 static int elf_sec_sym_ok_for_reloc PARAMS ((asection *));
 static void adjust_stab_sections PARAMS ((bfd *, asection *, PTR));
 static int elf_separate_stab_sections PARAMS ((void));
@@ -242,13 +241,6 @@ elf_s_set_other (sym, other)
   S_SET_OTHER (sym, other);
 }
 
-static void
-elf_copy_symbol_attributes (dest, src)
-     symbolS *dest, *src;
-{
-  OBJ_COPY_SYMBOL_ATTRIBUTES (dest, src);
-}
-
 static int
 elf_sec_sym_ok_for_reloc (sec)
      asection *sec;
@@ -1330,6 +1322,33 @@ elf_obj_symbol_new_hook (symbolP)
 #endif
 }
 
+/* When setting one symbol equal to another, by default we probably
+   want them to have the same "size", whatever it means in the current
+   context.  */
+
+void
+elf_copy_symbol_attributes (dest, src)
+     symbolS *dest, *src;
+{
+  struct elf_obj_sy *srcelf = symbol_get_obj (src);            
+  struct elf_obj_sy *destelf = symbol_get_obj (dest);          
+  if (srcelf->size)                                            
+    {                                                          
+      if (destelf->size == NULL)                               
+       destelf->size =                                 
+         (expressionS *) xmalloc (sizeof (expressionS));       
+      *destelf->size = *srcelf->size;                          
+    }                                                          
+  else                                                 
+    {                                                          
+      if (destelf->size != NULL)                               
+       free (destelf->size);                                   
+      destelf->size = NULL;                                    
+    }                                                          
+  S_SET_SIZE (dest, S_GET_SIZE (src));                 
+  S_SET_OTHER (dest, S_GET_OTHER (src));                       
+}
+
 void
 obj_elf_version (ignore)
      int ignore ATTRIBUTE_UNUSED;
index 8e3ce7dd3ff1745bbc547fa4e38f5c9fca1ddbbe..33c5f436a416ef157b42a6d3fde217cc1b469d9a 100644 (file)
@@ -182,32 +182,10 @@ void elf_obj_symbol_new_hook PARAMS ((symbolS *));
 #define obj_symbol_new_hook    elf_obj_symbol_new_hook
 #endif
 
-/* When setting one symbol equal to another, by default we probably
-   want them to have the same "size", whatever it means in the current
-   context.  */
+void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *));
 #ifndef OBJ_COPY_SYMBOL_ATTRIBUTES
-#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST,SRC)                   \
-do                                                             \
-  {                                                            \
-    struct elf_obj_sy *srcelf = symbol_get_obj (SRC);          \
-    struct elf_obj_sy *destelf = symbol_get_obj (DEST);                \
-    if (srcelf->size)                                          \
-      {                                                                \
-       if (destelf->size == NULL)                              \
-         destelf->size =                                       \
-           (expressionS *) xmalloc (sizeof (expressionS));     \
-       *destelf->size = *srcelf->size;                         \
-      }                                                                \
-    else                                                       \
-      {                                                                \
-       if (destelf->size != NULL)                              \
-         free (destelf->size);                                 \
-       destelf->size = NULL;                                   \
-      }                                                                \
-    S_SET_SIZE ((DEST), S_GET_SIZE (SRC));                     \
-    S_SET_OTHER ((DEST), S_GET_OTHER (SRC));                   \
-  }                                                            \
-while (0)
+#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \
+  (elf_copy_symbol_attributes (DEST, SRC))
 #endif
 
 #ifndef SEPARATE_STAB_SECTIONS