bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/4499] assign file positions assumes segment offsets increa


From: cvs-commit at gcc dot gnu.org
Subject: [Bug binutils/4499] assign file positions assumes segment offsets increasing
Date: Fri, 25 Oct 2019 04:50:10 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=4499

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The master branch has been updated by Alan Modra <address@hidden>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=30fe183248b2523ecff9da36853e2f893c4c4b91

commit 30fe183248b2523ecff9da36853e2f893c4c4b91
Author: Alan Modra <address@hidden>
Date:   Wed Oct 23 17:40:51 2019 +1030

    PR4499, assign file positions assumes segment offsets increasing

    This rewrites much of assign_file_positions_for_non_load_sections to
    allow objcopy and strip to handle cases like that in PR4499 where
    program headers were not in their usual position immediately after the
    ELF file header, and PT_LOAD headers were not sorted by paddr.

        PR 4499
    include/
        * elf/internal.h (struct elf_segment_map): Delete header_size.
        Add no_sort_lma and idx.
    bfd/
        * elf-nacl.c (nacl_modify_segment_map): Set no_sort_lma for all
        PT_LOAD segments.
        * elf32-spu.c (spu_elf_modify_segment_map): Likewise on overlay
        PT_LOAD segments.
        * elf.c (elf_sort_segments): New function.
        (assign_file_positions_except_relocs): Use shortcuts to elfheader
        and elf_tdata.  Seek to e_phoff not sizeof_ehdr to write program
        headers.  Move PT_PHDR check..
        (assign_file_positions_for_non_load_sections): ..and code setting
        PT_PHDR p_vaddr and p_paddr, and code setting __ehdr_start value..
        (assign_file_positions_for_load_sections): ..to here.  Sort
        PT_LOAD headers.  Delete header_pad code.  Use actual number of
        headers rather than allocated in calculating size for program
        headers.  Don't assume program headers follow ELF file header.
        Simplify pt_load_count code.  Only set "off" for PT_LOAD or
        PT_NOTE in cores.
        (rewrite_elf_program_header): Set p_vaddr_offset for segments
        that include file and program headers.
        (copy_elf_program_header): Likewise, replacing header_size code.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]