[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/17466] objcopy corrupts Windows executables when adding a
From: |
js at lastlog dot de |
Subject: |
[Bug binutils/17466] objcopy corrupts Windows executables when adding a section |
Date: |
Fri, 31 May 2024 15:27:37 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=17466
Joachim Schiele <js at lastlog dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |js at lastlog dot de
--- Comment #2 from Joachim Schiele <js at lastlog dot de> ---
Maybe someone else reads your ticket therefore this is what I did instead:
https://stackoverflow.com/questions/78555828/adding-custom-section-to-pe-with-gcc-mingw
Basically I had the same issue like you but found a workaround:
$ echo 'int main() { puts ("Hello world"); }' | gcc -x c - -c -o main.o
$ echo "this is my special data" >mydata
$ objcopy --add-section .mydata=mydata main.o
$ gcc main.o -o main
$ objdump -h main.exe
The difference is one adds the new section to the .o file instead the exe.
--
You are receiving this mail because:
You are on the CC list for the bug.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug binutils/17466] objcopy corrupts Windows executables when adding a section,
js at lastlog dot de <=