You could use EDITBIN /SECTION Option to rename the section in an .obj file before it is processed by the linker. In a C++ project this could be done by using a Pre-Link Build Event. In order to do this the build cannot be using Link Time Code Generation.
Port Linker script to MSBuild link.exe
I have done a lot of linker modifications under G++ using the ld linker scirpts. I am trying to figure out of there is a way to do something similar in windows. I thought about trying to do it in a def file, but I have had no luck. Specifically what I would like to do is create a new section in the PE file that will contain all the contents of an object file. I would like to do this without having to modify the source code. In a linux linker scirpt it is pretty easy:
SECTIONS {
.newSection : {
test.o(.text)
}
}
This will create a new executable section and place all the executable code from the object file test.o into that section. How can I do this without modifying the source code?