[PATCH] New --pe-dll-characteristcs switch for PE ld.
Fri Mar 6 16:24:00 GMT 2009
On Fri, Mar 06, 2009 at 09:17:03PM +1300, Danny Smith wrote:
>On Fri, Mar 6, 2009 at 7:48 PM, Dave Korn wrote:
>>Christopher Faylor wrote:
>>>On Thu, Mar 05, 2009 at 12:58:39PM +0000, Dave Korn wrote:
>>>>The PE header in executables contains a field called
>>>>"DllCharacteristics", which contains various flags that inform the OS
>>>>dynamic loader about the status of the executable w.r.t. ?runtime
>>>>factors such as NX/DEP, ASLR, dynamic rebasing, etc. ?(Despite the
>>>>name, it applies to executables of all kinds, not just DLLs, but that's
>>>>what MS calls it so that's what I call it).
>I agree with Dave on the naming of the options.
>The PE Coff spec defines the meaning of these flags in a section called
>"DLL Characteristics". dumpbin / header foo.exe | grep "DLL
>characteristics" tells us value of the field.
>It makes perfect sense to me to name the option after the the header
>field that it sets.
Not all of the other options used by ld reflect the "published name" that
you see from "dumpbin".
If you are going to quote Microsoft sources as definitive then we should
be unrolling each of the settings into a separate option, like editbin.
However, dumpbin does illustrate one thing that I forgot:
"characteristics" would be an overloaded term for PE's.
I suspect that the "DLL" part of the "DLL Characteristics" reflects the
history of the field in the PE header rather than its current
functionality. I don't see any reason to promulgate it.
More information about the Binutils