|
From: | Nick Clifton |
Subject: | Re: [Bug ld/4844] auto-import and const data import problem |
Date: | Tue, 02 Oct 2007 15:32:03 +0100 |
User-agent: | Thunderbird 1.5.0.12 (X11/20070718) |
Hi Eric,
Eric - I am not sure that making the .rdata section writeable is as simple as it is for the .text section and I am not at all sure that this is something that we want to do.Note that this is effectively what the patch does.
Point taken.
Wouldn't it be easier to have pe_find_data_imports() issue a warning message if it has to auto import when the --enable-auto-import has not been provided on the command line ?Easier sure, but you still end up with a broken binary. :-)
But only if you are using constant data structures. (That need to be auto-imported ?) And only if the user did not put --enable-auto-import on their command line.
The point is, I worry about the bugs that will be caused by putting read only data into the read/write data section. (Or maybe the bugs that will not be caught by so doing). This fix for auto-import is a hack and I would really prefer it if it was not the linker's default behaviour. So to me, providing a warning message and telling the user of the command line option that they ought to be using is an acceptable compromise. If a programmer's app starts to seg fault, then one thing they ought to do is go back over the build logs and look for any messages from the compiler and linker telling them of potential problems.
Cheers Nick
[Prev in Thread] | Current Thread | [Next in Thread] |