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: cleanup PT_GNU_STACK size handling


On 10/22/12 03:04, Alan Modra wrote:
On Tue, Oct 16, 2012 at 03:45:37PM +0100, Nathan Sidwell wrote:
+ 		  /* For default_execstack to trigger without an explicit
+ 		     stack size, there must be an input note section.  */
Nope.  The default triggers on the *absence* of a note section.  Also,
why scan object files when given an explicit -z execstack?  I find
your "clean up" here quite the opposite.  The rest of the patch looks

Ah, I see I'd got confused by default_execstack's semantics. For it to apply there has to be one input bfd with a note and one section without a note. I've fixed that up, using the existing algorithm. As for the scanning with an explicit execstack, I can't recall what I was thinking there, so I've changed that part to not scan.


OK, except for this copied code in bfd_elf_stack_segment_size which
probably ought to also check for bfd_link_hash_defweak
+   if (h && h->root.type == bfd_link_hash_defined && h->def_regular
+       && (h->type == STT_NOTYPE || h->type == STT_OBJECT))
and bfd_link_hash_undefweak here too
+   /* Provide the legacy symbol, if it is referenced.  */
+   if (h && h->root.type == bfd_link_hash_undefined)

done.


On 10/22/12 05:01, Mike Frysinger wrote:

>> Actually,
>> it doesn't work, because such a defsym gets a type NOTYPE and the check in
>> always_size_sections for  'h->type == STT_OBJECT' fails.  One ends up with
>> a duplicate symbol error. I have no idea how long that's been broken.
>
> hmm, it works on Blackfin:

Well ld-sh/fdpic-stack-size.d didn't. Clearly some kind of divergence -- cut-n-paste, bad.


> style wise, there's a bunch of places that have trailing whitespace. might > want to double check & clean that up. elf-bfd.h and bfd/elf.c pop out wrt > that.

Fixed, along with your other nits.

>> +        (const char *) NULL, FALSE,
>
> do you really need to cast that ?

Hey, I just cut and pasted that from the bfin backend. <ducks>.

Retested as before, ok?

nathan

--
Nathan Sidwell

Attachment: all.diff
Description: Text document


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