summaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 72fe61c4a3c..fa4416d0b60 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -271,7 +271,7 @@ bfd_elf_hash (namearg)
h ^= g;
}
}
- return h;
+ return h & 0xffffffff;
}
/* Read a specified number of bytes at a specified offset in an ELF
@@ -2335,7 +2335,7 @@ _bfd_elf_init_reloc_shdr (abfd, rel_hdr, asect, use_rela_p)
rel_hdr->sh_entsize = (use_rela_p
? bed->s->sizeof_rela
: bed->s->sizeof_rel);
- rel_hdr->sh_addralign = bed->s->file_align;
+ rel_hdr->sh_addralign = 1 << bed->s->log_file_align;
rel_hdr->sh_flags = 0;
rel_hdr->sh_addr = 0;
rel_hdr->sh_size = 0;
@@ -2365,9 +2365,9 @@ elf_fake_sections (abfd, asect, failedptrarg)
this_hdr = &elf_section_data (asect)->this_hdr;
- this_hdr->sh_name = (unsigned long) _bfd_elf_strtab_add (elf_shstrtab (abfd),
- asect->name, FALSE);
- if (this_hdr->sh_name == (unsigned long) -1)
+ this_hdr->sh_name = (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd),
+ asect->name, FALSE);
+ if (this_hdr->sh_name == (unsigned int) -1)
{
*failedptr = TRUE;
return;
@@ -3748,7 +3748,7 @@ assign_file_positions_for_segments (abfd)
&& (abfd->flags & D_PAGED) != 0)
p->p_align = bed->maxpagesize;
else if (m->count == 0)
- p->p_align = bed->s->file_align;
+ p->p_align = 1 << bed->s->log_file_align;
else
p->p_align = 0;
@@ -4245,7 +4245,7 @@ assign_file_positions_except_relocs (abfd)
}
/* Place the section headers. */
- off = align_file_position (off, bed->s->file_align);
+ off = align_file_position (off, 1 << bed->s->log_file_align);
i_ehdrp->e_shoff = off;
off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize;
@@ -5302,7 +5302,7 @@ swap_out_syms (abfd, sttp, relocatable_p)
symtab_hdr->sh_entsize = bed->s->sizeof_sym;
symtab_hdr->sh_size = symtab_hdr->sh_entsize * (symcount + 1);
symtab_hdr->sh_info = elf_num_locals (abfd) + 1;
- symtab_hdr->sh_addralign = bed->s->file_align;
+ symtab_hdr->sh_addralign = 1 << bed->s->log_file_align;
symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr;
symstrtab_hdr->sh_type = SHT_STRTAB;
@@ -7125,7 +7125,7 @@ elfcore_write_note (abfd, buf, bufsiz, name, type, input, size)
namesz = strlen (name) + 1;
bed = get_elf_backend_data (abfd);
- pad = -namesz & (bed->s->file_align - 1);
+ pad = -namesz & ((1 << bed->s->log_file_align) - 1);
}
newspace = sizeof (Elf_External_Note) - 1 + namesz + pad + size;