diff options
author | Alan Modra <amodra@gmail.com> | 2001-08-08 13:11:58 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2001-08-08 13:11:58 +0000 |
commit | 8fd3e36b8404118d6331e42fef1257af6fa54e5e (patch) | |
tree | 8ffec551dceafc0029f0af54b333e4718fc998c5 /gas/config/obj-elf.c | |
parent | 2517a57fdf395c6e5068577d1d4f86b3c6935e6d (diff) | |
download | gdb-8fd3e36b8404118d6331e42fef1257af6fa54e5e.zip gdb-8fd3e36b8404118d6331e42fef1257af6fa54e5e.tar.gz gdb-8fd3e36b8404118d6331e42fef1257af6fa54e5e.tar.bz2 |
* 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.
Diffstat (limited to 'gas/config/obj-elf.c')
-rw-r--r-- | gas/config/obj-elf.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 8c59479..f298498 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -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; |