[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/30561] conversion from binary to PE broken
From: |
nickc at redhat dot com |
Subject: |
[Bug binutils/30561] conversion from binary to PE broken |
Date: |
Mon, 19 Jun 2023 12:52:25 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=30561
Nick Clifton <nickc at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |nickc at redhat dot com
--- Comment #1 from Nick Clifton <nickc at redhat dot com> ---
Hi Stas,
To be honest I am not at all surprised by this. Converting arbitrary binary
input into a specific file format is never going to work well. There is just
not enough information in the input format to enable a proper conversion.
Instead may I suggest an alternative, using the assembler's .incbin
directive, like this:
$ cat tst.s
.data
.incbin "/etc/resolv.conf"
$ as tst.s -o tst.o
$ file tst.o
tst.o: Intel amd64 COFF object file, no relocation info, no line number info,
not stripped, 3 sections, symbol offset=0x43c, 8 symbols, 1st section name
".text"
$ objdump -P header tst.o
tst.o: file format pe-x86-64
File header not present
Image Header (at offset 0):
Machine Number: 0x8664 - AMD64
Number of sections: 3
Time/Date: 00000000 - not set
Symbol table offset: 0x00043c
Number of symbols: 8
Optional header size: 0
Flags: 0x0005 - RELOCS STRIPPED,LINE NUMS
STRIPPED
Optional header not present
Cheers
Nick
--
You are receiving this mail because:
You are on the CC list for the bug.