Comments (14)
As you said this is a binutils issue and not with djgpp itself. But this brings up an interesting point: I don't know where djgpp patches for binutils (or other packages) are developed. As far as I can tell this isn't checked in to source control anywhere. All we get is the zip file from delorie.com with djgpp specific patches already applied.
from djgpp-cvs.
I can see them in djgpp/*
directory.
from djgpp-cvs.
Yes those are the patch files. But they're not being developed in any cvs/svn/git repository as far as I can tell. And I don't understand why those patches aren't being merged with binutils upstream. You can build the official binutils release with --target=i*86-pc-msdosdjgpp
but then you'll end up with subtly broken things like non-functional ldscripts.
from djgpp-cvs.
Maybe you can setup the source tree,
review and upstream all the patches. :)
from djgpp-cvs.
Someday, maybe. I have enough other stuff to deal with for now.
from djgpp-cvs.
The number you'll want to change is #define GO32_STUBSIZE 2048
at binutils-2.33.1/include/coff/internal.h
line 61.
It looks like binutils always regards the first 2k bytes to be part of the stub, so changing this number will break compatibility with any executables that have a 2k stub. You'd have to find space for a version byte in the stub somewhere and make binutils determine the stub size based on that.
from djgpp-cvs.
Also there's probably a lot of other code out there that expects a fixed stub size, eg. upx and other exe packers.
from djgpp-cvs.
MZ header should itself contain the
exe size (stub size) and overlay size
(prog itself), so I hope things like upx
etc do not have this all hard-coded.
But I didn't check.
from djgpp-cvs.
https://github.com/upx/upx/blob/d7ba31cab8ce8d95d2c10e88d2ec787ac52005ef/src/p_djgpp2.cpp#L198-L205
You're right, upx reads the stub size from the header.
On the binutils side it seems everything is nailed down with #define
s.
from djgpp-cvs.
So at worst case we can lose
compatibility with older binutils.
But this doesn't look like the real
problem.
from djgpp-cvs.
I did some hacking last night... haven't tried it yet.
jwt27/binutils-gdb@djgpp-patches...go32stub
If this works then we can have variable length stubs without losing backward compatibility.
from djgpp-cvs.
What do you need to test that? :)
Well, you can just enlarge the no envseg$
msg. Its quite easy to test I think.
from djgpp-cvs.
I took a program with a 2k stub and inserted some bytes before the coff image. objdump
seems to work with it. strip
crashes in coff_swap_filehdr_out
. I think it's because the output filehdr isn't fully allocated.
from djgpp-cvs.
Let's move this discussion to jwt27/binutils-gdb#1 where the patches are.
from djgpp-cvs.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djgpp-cvs.