bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/4479] New: objcopy --only-keep-debug broken


From: schwab at suse dot de
Subject: [Bug binutils/4479] New: objcopy --only-keep-debug broken
Date: 9 May 2007 16:45:38 -0000

The patch for PR4144 broke objcopy --only-keep-debug.

$ objcopy --only-keep-debug vmlinux-2.6.21-4-default 
vmlinux-2.6.21-4-default.debug
BFD: vmlinux-2.6.21-4-default.debug: section `.text' can't be allocated in 
segment 0
objcopy: vmlinux-2.6.21-4-default.debug: Bad value
BFD: vmlinux-2.6.21-4-default.debug: section `.text' can't be allocated in 
segment 0
objcopy: vmlinux-2.6.21-4-default.debug: Bad value

The problem is that a !SEC_LOAD section does not contribute to p_filesz, so 
that in assign_file_positions_for_load_sections the value for adjust includes 
the size of all previous sections.  This causes p_memsz to overshoot, 
eventually growing so much that p_vaddr + p_memsz overflows in 
ELF_IS_SECTION_IN_SEGMENT.  Even if it does not overflow the values for p_memsz 
in the segments will be wrong.

-- 
           Summary: objcopy --only-keep-debug broken
           Product: binutils
           Version: 2.18 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: schwab at suse dot de
                CC: amodra at bigpond dot net dot au,bug-binutils at gnu dot
                    org
OtherBugsDependingO 4144
             nThis:


http://sourceware.org/bugzilla/show_bug.cgi?id=4479

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

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