bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/11396] New: objcopy adds IMAGE_FILE_RELOCS_STRIPPED


From: hjl dot tools at gmail dot com
Subject: [Bug binutils/11396] New: objcopy adds IMAGE_FILE_RELOCS_STRIPPED
Date: 17 Mar 2010 22:31:27 -0000

According to PE-COFF spec, IMAGE_FILE_RELOCS_STRIPPED means

--
Image only, Windows CE, and Microsoft Windows NT® and later.
This indicates that the file does not contain base relocations
and must therefore be loaded at its preferred base address.
If the base address is not available, the loader reports an
error. The default behavior of the linker is to strip base
relocations from executable (EXE) files.
--

An empty .reloc section is used to create an PIE file:

address@hidden pr959]$ cat foo.s
        .text
        .globl _start
_start:
        .section .reloc
address@hidden pr959]$ make
./as   -o foo.o foo.s
./ld -pie -o foo.exe foo.o
./objdump -f foo.exe

foo.exe:     file format pei-x86-64
architecture: i386:x86-64, flags 0x00000133:
HAS_RELOC, EXEC_P, HAS_SYMS, HAS_LOCALS, D_PAGED
start address 0x0000000000401000

But objcopy adds IMAGE_FILE_RELOCS_STRIPPED even if
it doesn't strip any relocations:

./objcopy foo.exe bar.exe
./objdump -f bar.exe

bar.exe:     file format pei-x86-64
architecture: i386:x86-64, flags 0x00000132:
EXEC_P, HAS_SYMS, HAS_LOCALS, D_PAGED
start address 0x0000000000401000

address@hidden pr959]$

-- 
           Summary: objcopy adds IMAGE_FILE_RELOCS_STRIPPED
           Product: binutils
           Version: 2.21 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: hjl dot tools at gmail dot com
                CC: bug-binutils at gnu dot org


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

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