bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/20659] Objcopy and change section lma failing


From: cvs-commit at gcc dot gnu.org
Subject: [Bug binutils/20659] Objcopy and change section lma failing
Date: Sat, 12 May 2018 07:03:18 +0000

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

--- 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=9933dc52736dd349503e00a68cd0b9be4388f5a9

commit 9933dc52736dd349503e00a68cd0b9be4388f5a9
Author: Alan Modra <address@hidden>
Date:   Fri May 11 14:34:48 2018 +0930

    PR20659, Objcopy and change section lma failing

    Sections may well belong in multiple segments.  The testcase in the PR
    saw an allocated section being assigned to an ABIFLAGS segment, then
    not being assigned to a LOAD segment because it had already been
    handled.  To fix that particular problem this patch sets and tests
    segment_mark only for LOAD segments.  I kept the segment_mark test for
    LOAD segments because I think there may otherwise be a problem with
    zero size sections.

    A few other problems showed up with the testcase.  Some targets align
    .dynamic, resulting in the test failing with "section .dynamic lma
    0x800000c0 adjusted to 0x800000cc" and similar messages.  I've tried
    to handle that with some more hacks to the segment lma, which do the
    right thing for the testcase, but may well fail in other situations.

    I've also removed the tests of segment lma (p_paddr) and code involved
    in deciding that an adjusted segment no longer covers the file or
    program headers.  Those test can't be correct in the face of objcopy
    --change-section-lma.  It may be necessary to reinstate the tests but
    do them modulo page size, but we'll see how this goes.

        PR 20659
    bfd/
        * elf.c (rewrite_elf_program_header): Use segment_mark only for
        PT_LOAD headers.  Delete first_matching_lma and first_suggested_lma.
        Instead make matching_lma and suggested_lma pointers to the
        sections.  Align section vma and lma calculated from segment.
        Don't clear includes_phdrs or includes_filehdr based on p_paddr
        test.  Try to handle alignment padding before first section by
        adjusting new segment lma down.  Adjust PT_PHDR map p_paddr.
    ld/
        * testsuite/ld-elf/changelma.d,
        * testsuite/ld-elf/changelma.lnk,
        * testsuite/ld-elf/changelma.s: New test.

-- 
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]