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 2/2] LD/testsuite: Expand STB_GNU_UNIQUE test coverage


On 05/04/2016 03:20 PM, Maciej W. Rozycki wrote:

> though, or maybe even make another De Morgan transformation and have a 
> single negation at the then outermost level.  Keeping the `*-*-elf*' 
> exceptions on a single line might improve readability, although it'll be 
> lost with the first addition of another exception.

Or add a proc, which then allows early returns, making it
more readable, IMO:

proc supports_gnu_unique {} {
   # Only ELF.
   if {!([istarget "*-*-elf*"]
       || [istarget *-*-nacl*]
       || [istarget *-*-linux*]
       || [istarget *-*-gnu*]) } {
     return 0
   }

   # These targets set the ELF header's OSABI field to
   # ELFOSABI_STANDALONE and cannot support STB_GNU_UNIQUE.
   if {[istarget "msp430-*-*"]
       || [istarget "visium-*-*"]} {
     return 0
   }

   # Default to yes.
   return 1
}

...
  if { ![supports_gnu_unique] } {
      verbose "UNIQUE tests not run - target does not support UNIQUE"
      return
  }
...

Thanks,
Pedro Alves


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