This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] New --pe-dll-characteristcs switch for PE ld.


On Mon, Mar 09, 2009 at 11:58:00AM -0400, Charles Wilson wrote:
>> The ld option would not represent a mask.  It is just an arbitrary collection
>> of keyworeds.  You are grouping suboptions together only because Microsoft 
>> decided to have disparate behavior controlled by one unsigned short field
>> in the PE header.
>
>Ah. I see what the problem is.
>
>Dave and I are thinking: "There is an important field in the EXE/DLL
>header.  We need a way to conveniently set the value of this field. 
>Since the field is composed of various flags, one obvious convenient
>mechanism is to allow setting those flags in the field symbolically.  Or
>also numerically, all at once.  But, the operation is one atomic
>transaction: set the field."
>
>This naturally leads to a single command line option (for the field),
>with parseable suboptions (for each flag).
>
>You're thinking: "There are a number of flags that are important in the
>EXE/DLL header.  We should be able to set those flags.  These flags are
>each independent logical entities -- regardless of how Microsoft
>implemented them in the PE header itself, as bit-members of a single
>field, multiple fields, whatever.  The ld user doesn't care -- he just
>needs to be able to set each flag."
>
>This naturally leads to multiple command line options -- one for each
>flag. 
>
>I can see the argument for both.  Can't we have both?

Given the code complexity of implementing "your" way, I don't see any
reason to add two ways to binutils.  It's hard for me to imagine that
anyone who needed to use one of these options would find
"--pe-dll-characteristics tsaware" easier to use or remember than
"--tsaware".  Especially since you are assuming that someone who wanted
to use this option would know that they come from DllCharacteristics.  I
know with great certainty that I would have to look this up the next
time I wanted to use it.  I would possibly remember --tsaware but
"--dll-characteristics tsaware" is not something that would naturally
stick.

And, perhaps I'm wrong, but I don't think any other ld (or ultimately
objcopy) option takes a list of arbitrary keywords like this.  The
result of doing things this way means that (in Dave's original patch at
least) you can't figure out how to turn on the tsaware flag without
reading the texinfo documentation.  I don't see any reason for that.

I know that these options would show up if you implemented them both
ways but, like I said, I really don't see the need to do it two ways.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]