bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/27666] ar doesn't create indices on Solaris/sparcv9


From: ro at CeBiTec dot Uni-Bielefeld.DE
Subject: [Bug binutils/27666] ar doesn't create indices on Solaris/sparcv9
Date: Thu, 17 Jun 2021 07:52:44 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=27666

--- Comment #7 from Rainer Orth <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #5 from Joel Brobecker <brobecker at gnat dot com> ---
> (Thanks Nick for the patch)

Indeed, thanks a lot.

However, I think we can do better than disabling the ld sparc*tests on
Solaris.  Even if we omit support for the elf32_sparc and and
elf64_sparc emulations, it should be possible to handle that with a
snippet like the following in sparc.exp (tested a very long time ago,
not sure if it still works as is):

# Solaris/SPARC ld uses elf??-sparc_sol2 emulations.
if { [istarget "*-*-solaris*"] } {
    set options_regsub(ld) {-m(\\S+) -m\\1_sol2}
    verbose "solaris: options_regsub(ld)"
}

Alan has also done some of the work by making the dump files accept both
elf32-sparc and elf32-sparc-sol2.  The ugliest part (or one which really
requires a general solution) is that the Solaris ABI couple of
additional symbols into the output files, like

/var/gcc/binutils/sparcv9/obj/binutils/ld/../binutils/readelf -WSsrl
tmpdir/libtlssunpic32.so
regexp_diff match failure
regexp "^.* TLS +GLOBAL +DEFAULT +7 sg8$"
line   "     4: 00012188     0 OBJECT  LOCAL  DEFAULT   11 _END_"
regexp_diff match failure
regexp "^.* TLS +GLOBAL +DEFAULT +7 sg3$"
line   "     5: 00001000     0 OBJECT  LOCAL  DEFAULT    6 _START_"
[...]

One possible solution to that is to have separate copies for Solaris (as
done in gas in a few cases for x86), but that quickly becomes
unmaintainable with master dump and Solaris copy beginning to drift
apart.

What I think would be a general solution is having support for
conditionals in the dump files, something like

  #cond <cond>: GLOB|PROC

  set condition cond to true if GLOB matches or PROC returns true, false
  otherwise, e.g.

  #cond SOLARIS: *-*-solaris2* 

  run_dump_test calls to regexp_diff for comparisons

  #if:<cond>    <rest of line>

  e.g.

  #if:SOLARIS   <rest of line>

  need more:

  #if:SOLARIS
  #else

  for individual lines, maybe also for blocks?

  then we need

  #if:SOLARIS
  <lines>
  #else
  <lines>
  #endif

  no nesting for simplicity's sake

Just a general idea because this issue seems to come up on other
targets, too.  I haven't even started thinking about implemented this
and probably won't for quite some time.

        Rainer

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]