aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-07-22 18:53:23 +0000
committerIan Lance Taylor <ian@airs.com>1994-07-22 18:53:23 +0000
commit7c6da9cade1c47d725fac11ddc9aaf921f85c22d (patch)
tree50cc77e306108de96cf41f87a4c731bdbae277c6 /bfd/elfcode.h
parent36c6e8c37fc1ebc698b8d260c6ef09fe2d18ea69 (diff)
downloadgdb-7c6da9cade1c47d725fac11ddc9aaf921f85c22d.zip
gdb-7c6da9cade1c47d725fac11ddc9aaf921f85c22d.tar.gz
gdb-7c6da9cade1c47d725fac11ddc9aaf921f85c22d.tar.bz2
* aoutx.h (aout_link_check_ar_symbols): When changing a symbol to
common, set the alignment. (aout_link_add_symbols): Restrict the alignment of a common symbol to the alignment power given by the architecture. * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize align. Do initialize copy_offset. * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use copy_offset field rather than align field. Get alignment using bfd_log2 rather than switch. * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use copy_offset, not align. * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Likewise.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index e34951c..fd02038 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -4334,6 +4334,10 @@ elf_link_add_object_symbols (abfd, info)
weaks = *sym_hash;
}
+ if (sym.st_shndx == SHN_COMMON
+ && h->root.type == bfd_link_hash_common)
+ h->root.u.c.alignment_power = bfd_log2 (sym.st_value);
+
if (info->hash->creator->flavour == bfd_target_elf_flavour)
{
int old_flags;
@@ -4347,9 +4351,6 @@ elf_link_add_object_symbols (abfd, info)
the symbol size changes. */
h->size = sym.st_size;
}
- if (sym.st_shndx == SHN_COMMON
- && sym.st_value > h->align)
- h->align = sym.st_value;
if (ELF_ST_TYPE (sym.st_info) != STT_NOTYPE)
{
/* FIXME: We should probably somehow give a warning if
@@ -5701,10 +5702,7 @@ elf_link_output_extsym (h, data)
case bfd_link_hash_common:
input_sec = bfd_com_section_ptr;
sym.st_shndx = SHN_COMMON;
- if (h->align == 0)
- sym.st_value = 1;
- else
- sym.st_value = h->align;
+ sym.st_value = 1 << h->root.u.c.alignment_power;
break;
case bfd_link_hash_indirect: