I need to update machine type in ELF header. Objcopy doesn't work.
On Linux/x86-64, I got

[...@gnu-6 binutils]$ objcopy -O elf64-l1om /bin/ls ls
objcopy: Warning: Output file cannot represent architecture `i386:x86-64'

and no output was written. I wrote updelfhdr:

http://sourceware.org/ml/binutils/2009-12/msg00236.html

and got

[...@gnu-6 binutils]$ cp /bin/ls /tmp/
[...@gnu-6 binutils]$ ./updelfhdr --output-mach L1OM /tmp/ls
[...@gnu-6 binutils]$ readelf -h /tmp/ls
ELF Header:
 Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
 Class:                             ELF64
 Data:                              2's complement, little endian
 Version:                           1 (current)
 OS/ABI:                            UNIX - System V
 ABI Version:                       0
 Type:                              EXEC (Executable file)
 Machine:                           Intel L1OM
 Version:                           0x1
 Entry point address:               0x4026b0
 Start of program headers:          64 (bytes into file)
 Start of section headers:          111976 (bytes into file)
 Flags:                             0x0
 Size of this header:               64 (bytes)
 Size of program headers:           56 (bytes)
 Number of program headers:         8
 Size of section headers:           64 (bytes)
 Number of section headers:         32
 Section header string table index: 31
[...@gnu-6 binutils]$

-- 
           Summary: Add updelfhdr
           Product: binutils
           Version: 2.21 (HEAD)
            Status: NEW
          Severity: enhancement
          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=11131

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


_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to