[BFD PATCH] set alignment of BFD sections for ELF core files
Roland McGrath
roland@redhat.com
Tue Oct 7 07:24:00 GMT 2003
This patch makes the BFD sections syntehsized for ELF core files more
accurately represent what the ELF file says by including the alignment
information. The incorrect value can be seen in the output of objdump -hp,
where the fake sections don't match the phdrs they represent. (This change
is also necessary for a gdb patch I am proposing.)
Ok to commit?
Thanks,
Roland
2003-10-07 Roland McGrath <roland@redhat.com>
* elf.c (_bfd_elf_make_section_from_phdr): Set alignment_power of
new section from p_align header field.
--- elf.c.~1.200.~ 2003-09-23 03:01:04.000000000 -0700
+++ elf.c 2003-10-07 00:12:25.000000000 -0700
@@ -2206,6 +2206,7 @@ _bfd_elf_make_section_from_phdr (bfd *ab
newsect->_raw_size = hdr->p_filesz;
newsect->filepos = hdr->p_offset;
newsect->flags |= SEC_HAS_CONTENTS;
+ newsect->alignment_power = bfd_log2 (hdr->p_align);
if (hdr->p_type == PT_LOAD)
{
newsect->flags |= SEC_ALLOC;
More information about the Binutils
mailing list