Your gas changes caused weakref failures for cris-elf, supposedly others too

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Your gas changes caused weakref failures for cris-elf, supposedly others too

Hans-Peter Nilsson
After this change:

2005-10-27  Jan Beulich  <[hidden email]>

        * read.c (assign_symbol): Also consider equates already defined.
        * symbols.c (symbol_clone): Also clone the underlying BFD symbol.
        * config/obj-coff.h (obj_symbol_clone_hook): New.
        (coff_obj_symbol_clone_hook): Declare.
        * config/obj-coff.c (coff_obj_symbol_clone_hook): New.

My autotester, building for "--target=cris-axis-elf" caught
these failures:

Running /h/hp/binutils/cvs_latest/src/gas/testsuite/gas/all/gas.exp ...
FAIL: weakref tests, relocations
FAIL: weakref tests, global syms
FAIL: weakref tests, local syms
FAIL: weakref tests, strong undefined syms
FAIL: weakref tests, weak undefined syms

with this in gas.log:
/h/hp/binutils/cvs_latest/src/gas/testsuite/lib/run ../as-new   -o dump.o /h/hp/binutils/cvs_latest/src/gas/testsuite/gas/all/weakref1.s
/h/hp/binutils/cvs_latest/src/gas/testsuite/gas/all/weakref1.s: Assembler messages:
/h/hp/binutils/cvs_latest/src/gas/testsuite/gas/all/weakref1.s:203: Error: symbol `lr1' is already defined
/h/hp/binutils/cvs_latest/src/gas/testsuite/gas/all/weakref1.s:208: Error: symbol `lr2' is already defined
/h/hp/binutils/cvs_latest/src/gas/testsuite/gas/all/weakref1.s:226: Error: symbol `lr6' is already defined
/n/asic_slask/hp/autobinutest/gas/testsuite/../../binutils/objdump  -r dump.o > dump.out
/n/asic_slask/hp/autobinutest/gas/testsuite/../../binutils/objdump: 'dump.o': No such file
FAIL: weakref tests, relocations

same for the rest of the failures.

brgds, H-P
Reply | Threaded
Open this post in threaded view
|

Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Jan Beulich
Hmm, interesting. Which way to fix this actually depends on the
intentions with weak references - if they're supposed to be
re-definable, then assign_symbol() or s_weakref() would need to take
care of this. If not, the test is broken. Alexandre, can you clarify the
intentions?

Thanks, Jan

>>> Hans-Peter Nilsson <[hidden email]> 27.10.05 12:40:49
>>>
After this change:

2005-10-27  Jan Beulich  <[hidden email]>

        * read.c (assign_symbol): Also consider equates already
defined.
        * symbols.c (symbol_clone): Also clone the underlying BFD
symbol.
        * config/obj-coff.h (obj_symbol_clone_hook): New.
        (coff_obj_symbol_clone_hook): Declare.
        * config/obj-coff.c (coff_obj_symbol_clone_hook): New.

My autotester, building for "--target=cris-axis-elf" caught
these failures:

Running /h/hp/binutils/cvs_latest/src/gas/testsuite/gas/all/gas.exp
...
FAIL: weakref tests, relocations
FAIL: weakref tests, global syms
FAIL: weakref tests, local syms
FAIL: weakref tests, strong undefined syms
FAIL: weakref tests, weak undefined syms

with this in gas.log:
/h/hp/binutils/cvs_latest/src/gas/testsuite/lib/run ../as-new   -o
dump.o /h/hp/binutils/cvs_latest/src/gas/testsuite/gas/all/weakref1.s
/h/hp/binutils/cvs_latest/src/gas/testsuite/gas/all/weakref1.s:
Assembler messages:
/h/hp/binutils/cvs_latest/src/gas/testsuite/gas/all/weakref1.s:203:
Error: symbol `lr1' is already defined
/h/hp/binutils/cvs_latest/src/gas/testsuite/gas/all/weakref1.s:208:
Error: symbol `lr2' is already defined
/h/hp/binutils/cvs_latest/src/gas/testsuite/gas/all/weakref1.s:226:
Error: symbol `lr6' is already defined
/n/asic_slask/hp/autobinutest/gas/testsuite/../../binutils/objdump  -r
dump.o > dump.out
/n/asic_slask/hp/autobinutest/gas/testsuite/../../binutils/objdump:
'dump.o': No such file
FAIL: weakref tests, relocations

same for the rest of the failures.

brgds, H-P
Reply | Threaded
Open this post in threaded view
|

Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Alexandre Oliva-2
On Oct 27, 2005, "Jan Beulich" <[hidden email]> wrote:

> Hmm, interesting. Which way to fix this actually depends on the
> intentions with weak references - if they're supposed to be
> re-definable, then assign_symbol() or s_weakref() would need to take
> care of this. If not, the test is broken. Alexandre, can you clarify the
> intentions?

Either way is fine.  I wouldn't mind if they were not redefinable, but
I wanted to play along with .set et al, that allowed redefinitions.
As long as it's consistent (i.e., .weakref can be a redefinition *and*
can be redefined, or neither of these), I'm open to change.  GCC, the
prime user of this feature, will never issue redefinitions for correct
programs anyway.

--
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
Reply | Threaded
Open this post in threaded view
|

Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Jan Beulich
>>> Alexandre Oliva <[hidden email]> 27.10.05 16:08:09 >>>
>On Oct 27, 2005, "Jan Beulich" <[hidden email]> wrote:
>
>> Hmm, interesting. Which way to fix this actually depends on the
>> intentions with weak references - if they're supposed to be
>> re-definable, then assign_symbol() or s_weakref() would need to
take
>> care of this. If not, the test is broken. Alexandre, can you clarify
the
>> intentions?
>
>Either way is fine.  I wouldn't mind if they were not redefinable,
but
>I wanted to play along with .set et al, that allowed redefinitions.
>As long as it's consistent (i.e., .weakref can be a redefinition
*and*
>can be redefined, or neither of these), I'm open to change.  GCC, the
>prime user of this feature, will never issue redefinitions for
correct
>programs anyway.

I'd rather go for the not re-definable option. I'll soon submit an
adjustment to the test case, but changing s_weakref to actually filter
out already defined symbols probably is better done by you, as you wrote
the original code.

Jan
Reply | Threaded
Open this post in threaded view
|

Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Jan Beulich
In reply to this post by Alexandre Oliva-2
>>> Alexandre Oliva <[hidden email]> 27.10.05 16:08:09 >>>
>On Oct 27, 2005, "Jan Beulich" <[hidden email]> wrote:
>
>> Hmm, interesting. Which way to fix this actually depends on the
>> intentions with weak references - if they're supposed to be
>> re-definable, then assign_symbol() or s_weakref() would need to
take
>> care of this. If not, the test is broken. Alexandre, can you clarify
the
>> intentions?
>
>Either way is fine.  I wouldn't mind if they were not redefinable,
but
>I wanted to play along with .set et al, that allowed redefinitions.
>As long as it's consistent (i.e., .weakref can be a redefinition
*and*
>can be redefined, or neither of these), I'm open to change.  GCC, the
>prime user of this feature, will never issue redefinitions for
correct
>programs anyway.

Actually, looking a little closer at these tests I'm not certain I'm
ready to change them. For example, in the section where re-definitions
are tested, I don't really understand why nr7 doesn't appear in any of
the *.d files even though I would think it should. So maybe it'd be
better if you adjusted it...

Thanks, Jan
Reply | Threaded
Open this post in threaded view
|

Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Alexandre Oliva-2
In reply to this post by Jan Beulich
On Oct 27, 2005, "Jan Beulich" <[hidden email]> wrote:

> I'd rather go for the not re-definable option. I'll soon submit an
> adjustment to the test case, but changing s_weakref to actually filter
> out already defined symbols probably is better done by you, as you wrote
> the original code.

I actually copied that portion of the code from the code that handled
.set, so I'd leave it for you to apply the same fix, if you don't mind
:-)

--
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
Reply | Threaded
Open this post in threaded view
|

Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Hans-Peter Nilsson
> From: Alexandre Oliva <[hidden email]>
> Date: Thu, 27 Oct 2005 14:18:00 -0200

> On Oct 27, 2005, "Jan Beulich" <[hidden email]> wrote:
>
> > I'd rather go for the not re-definable option. I'll soon submit an
> > adjustment to the test case, but changing s_weakref to actually filter
> > out already defined symbols probably is better done by you, as you wrote
> > the original code.
>
> I actually copied that portion of the code from the code that handled
> .set, so I'd leave it for you to apply the same fix, if you don't mind
> :-)

While you two discuss where and how to fix this, I've entered
gas/1630 for this issue with you both CC:ed.  I've also xfailed
the test for cris-*-* to avoid having to check the autotester
log for other FAILs every time someone commits something, and
mmix-*-* as well since I see the FAILs there too.  I guess the
relevant pattern is *-*-* (for one, I see it for native
x86_64-unknown-linux-gnu) but maybe not, as one of you should've
seen the failures when testing.

gas/testsuite:
        PR gas/1630
        * gas/all/gas.exp <weakref1, weakref1g, weakref1l, weakref1u,
        weakref1w>: Xfail for cris-*-* and mmix-*-*.

Index: gas/all/gas.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/all/gas.exp,v
retrieving revision 1.33
diff -p -u -r1.33 gas.exp
--- gas/all/gas.exp 27 Oct 2005 07:40:07 -0000 1.33
+++ gas/all/gas.exp 29 Oct 2005 10:49:32 -0000
@@ -256,10 +256,15 @@ if { ![istarget "i960-*-*"] } {
 case $target_triplet in {
     { z80-*-* } { }
     default {
+ setup_xfail cris-*-* mmix-*-*
  run_dump_test weakref1
+ setup_xfail cris-*-* mmix-*-*
  run_dump_test weakref1g
+ setup_xfail cris-*-* mmix-*-*
  run_dump_test weakref1l
+ setup_xfail cris-*-* mmix-*-*
  run_dump_test weakref1u
+ setup_xfail cris-*-* mmix-*-*
  run_dump_test weakref1w
     }
 }

brgds, H-P
Reply | Threaded
Open this post in threaded view
|

Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Alan Modra
On Mon, Oct 31, 2005 at 10:15:49AM +0100, Jan Beulich wrote:
> >While you two discuss where and how to fix this, I've entered
[snip]
>
> Thanks. And yes, I suppose the failure exists everywhere. And no,
> neither of the two of use could really see the problem while testing
> since the submissions and check-ins were too close to one another in
> time.

gas/read.c

revision 1.111
date: 2005/10/27 07:40:07;  author: jbeulich;  state: Exp;  lines: +1 -1

revision 1.110
date: 2005/10/24 17:51:41;  author: aoliva;  state: Exp;  lines: +119 -0

62 hours is hardly "too close".  There seems to be no progress on
resolving these annoying testsuite failures on all targets, even though
the fix is fairly simple.  I will revert your last patch if something is
not done soon.

--
Alan Modra
IBM OzLabs - Linux Technology Centre
Reply | Threaded
Open this post in threaded view
|

Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Jan Beulich
>>> Alan Modra <[hidden email]> 04.11.05 02:57:47 >>>
>On Mon, Oct 31, 2005 at 10:15:49AM +0100, Jan Beulich wrote:
>> >While you two discuss where and how to fix this, I've entered
>[snip]
>>
>> Thanks. And yes, I suppose the failure exists everywhere. And no,
>> neither of the two of use could really see the problem while
testing
>> since the submissions and check-ins were too close to one another
in
>> time.
>
>gas/read.c
>
>revision 1.111
>date: 2005/10/27 07:40:07;  author: jbeulich;  state: Exp;  lines: +1
-1
>
>revision 1.110
>date: 2005/10/24 17:51:41;  author: aoliva;  state: Exp;  lines: +119
-0
>
>62 hours is hardly "too close".  There seems to be no progress on
>resolving these annoying testsuite failures on all targets, even
though
>the fix is fairly simple.  I will revert your last patch if something
is
>not done soon.

This you just look at the commit time, not the submission time. If I
hadn't checked in that patch, another (x86) test would have failed as
was realized and reported
(http://sourceware.org/ml/binutils/2005-10/msg00393.html), since the
OK for a dependent x86 patch was given before the OK for the general
patch (and I'm sorry for having forgotten about the dependency). Also,
from my perspective, the weakref patch was already broken when it got
checked in, the broken-ness was just hidden (it silently assumed symbols
can be redefined without making sure that really worked, much like other
parts of the assembler before the adjustment
[http://sourceware.org/ml/binutils/2005-09/msg00377.html]). Finally,
Alexandre promised to address the problems (attached, unfortunately not
copied to the list), which is why I didn't spend any time on addressing
these (not to mention that I didn't really have time to do so).
Meanwhile I suggest the following (probably I could even consider this
obvious and don't wait for approval...):

gas/testsuite/
2005-11-04  Jan Beulich  <[hidden email]>

        * gas/all/gas.exp: xfail weakref dump tests for all targets.

---
/home/jbeulich/src/binutils/mainline/2005-11-04/gas/testsuite/gas/all/gas.exp 2005-11-04
08:29:48.000000000 +0100
+++ 2005-11-04/gas/testsuite/gas/all/gas.exp 2005-11-04
08:49:50.000000000 +0100
@@ -256,15 +256,15 @@ if { ![istarget "i960-*-*"] } {
 case $target_triplet in {
     { z80-*-* } { }
     default {
- setup_xfail cris-*-* mmix-*-*
+ setup_xfail *-*-*
  run_dump_test weakref1
- setup_xfail cris-*-* mmix-*-*
+ setup_xfail *-*-*
  run_dump_test weakref1g
- setup_xfail cris-*-* mmix-*-*
+ setup_xfail *-*-*
  run_dump_test weakref1l
- setup_xfail cris-*-* mmix-*-*
+ setup_xfail *-*-*
  run_dump_test weakref1u
- setup_xfail cris-*-* mmix-*-*
+ setup_xfail *-*-*
  run_dump_test weakref1w
     }
 }



On Oct 28, 2005, "Jan Beulich" <[hidden email]> wrote:

> Looking at the code it doesn't seem so.

Maybe it diverted a lot, or I changed my mind during the
implementation, or I just misremember :-( Sorry.  I'll get to it ASAP.

> If I was to
> do anything with it, I'd just remove the entire r# section.

If redefinitions are not going to be supported (which is exactly what
r# was testing), that sounds like a plan :-)

> But as said
> before, following the description in as.texinfo I can't see why none of
> the nr* symbols appear in the symbol table.

If the weakref isn't ultimately referenced, or if it was redirected to
something else or redefined, then the symbol is not necessary.

> And in addition to that I also wonder how the test completes on some
> targets that have special .set semantics

No idea, I didn't know about that.

--
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

binutils-mainline-weakref-xfail.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Alan Modra
On Fri, Nov 04, 2005 at 09:06:52AM +0100, Jan Beulich wrote:
> >>> Alan Modra <[hidden email]> 04.11.05 02:57:47 >>>
> >62 hours is hardly "too close".  There seems to be no progress on
>
> This you just look at the commit time, not the submission time. If I

Perhaps you should get used to rechecking your patches before
committing.  Binutils "make all check" doesn't takes that long.

> 2005-11-04  Jan Beulich  <[hidden email]>
>
> * gas/all/gas.exp: xfail weakref dump tests for all targets.

OK.

--
Alan Modra
IBM OzLabs - Linux Technology Centre
Reply | Threaded
Open this post in threaded view
|

Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Alexandre Oliva-2
In reply to this post by Jan Beulich
On Nov  4, 2005, "Jan Beulich" <[hidden email]> wrote:

> Finally, Alexandre promised to address the problems (attached,
> unfortunately not copied to the list), which is why I didn't spend
> any time on addressing these (not to mention that I didn't really
> have time to do so).  Meanwhile I suggest the following (probably I
> could even consider this obvious and don't wait for approval...):

Yeah, sorry that it took me so long to get back to this.  Funny that
I'd start working on the patch before even seeing this exchange of
yours.  I had to update my source tree and re-create my patch such
that it would apply after your check in :-)

There's one bit I'm confused about.  It seems to be that, after your
patch to flag redefinitions, we'd still accept:

.set a, b
a:

although I'd think this should be rejected, just like other
redefinitions, no?  I've included the change to reject this (and
similar redefinitions of weakrefs) in my patch, which I'm checking in
as obvious, although I'm a bit concerned that this one change is not
entirely obvious, so if anyone disagrees with it, feel free to revert
the bit in symbols.c to get it back in shape.

Jan, I couldn't quite figure out the meaning of volatile and
forward_ref, that I believe were introduced in your patch (I don't
recall having seen them before).  Would you please document them in
gas/doc, like the other fields and accessor functions?

Tested on amd64-linux-gnu.  Checking in...


Index: gas/ChangeLog
from  Alexandre Oliva  <[hidden email]>

        * read.c (s_weakref): Do not permit redefinitions.
        * symbols.c (colon): Do not permit redefinitions of equated
        symbols.

Index: gas/read.c
===================================================================
RCS file: /cvs/src/src/gas/read.c,v
retrieving revision 1.111
diff -u -p -r1.111 read.c
--- gas/read.c 27 Oct 2005 07:40:07 -0000 1.111
+++ gas/read.c 4 Nov 2005 19:36:10 -0000
@@ -3178,6 +3178,14 @@ s_weakref (int ignore ATTRIBUTE_UNUSED)
 
   symbolP = symbol_find_or_make (name);
 
+  if (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
+    {
+      as_bad (_("symbol `%s' is already defined"), name);
+      *end_name = delim;
+      ignore_rest_of_line ();
+      return;
+    }
+
   *end_name = delim;
 
   SKIP_WHITESPACE ();
Index: gas/symbols.c
===================================================================
RCS file: /cvs/src/src/gas/symbols.c,v
retrieving revision 1.68
diff -u -p -r1.68 symbols.c
--- gas/symbols.c 27 Oct 2005 07:40:07 -0000 1.68
+++ gas/symbols.c 4 Nov 2005 19:36:12 -0000
@@ -332,7 +332,8 @@ colon (/* Just seen "x:" - rattle symbol
   local_symbol_set_frag (locsym, frag_now);
   locsym->lsy_value = frag_now_fix ();
  }
-      else if (!S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP))
+      else if (!(S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
+       || S_IS_COMMON (symbolP))
  {
   if (S_GET_VALUE (symbolP) == 0)
     {
Index: gas/testsuite/ChangeLog
from  Alexandre Oliva  <[hidden email]>

        * gas/all/gas.exp: Remove weakref xfail.  Run weakref4.s.
        * gas/all/weakref1.s: Move redefinition bits to...
        * gas/all/weakref4.s: ... new file.
        * gas/all/weakref1.d: Remove command moved to weakref1u.  Adjust
        remaining command for leading tabs.  Regenerate.
        * gas/all/weakref1l.d: Regenerate.
        * gas/all/weakref1u.d: Likewise.
        * gas/all/wealref1w.d: Likewise.

Index: gas/testsuite/gas/all/gas.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/all/gas.exp,v
retrieving revision 1.35
diff -u -p -r1.35 gas.exp
--- gas/testsuite/gas/all/gas.exp 4 Nov 2005 13:25:59 -0000 1.35
+++ gas/testsuite/gas/all/gas.exp 4 Nov 2005 19:36:19 -0000
@@ -256,20 +256,16 @@ if { ![istarget "i960-*-*"] } {
 case $target_triplet in {
     { z80-*-* } { }
     default {
- setup_xfail *-*-*
  run_dump_test weakref1
- setup_xfail *-*-*
  run_dump_test weakref1g
- setup_xfail *-*-*
  run_dump_test weakref1l
- setup_xfail *-*-*
  run_dump_test weakref1u
- setup_xfail *-*-*
  run_dump_test weakref1w
     }
 }
 gas_test_error "weakref2.s" "" "e: would close weakref loop: e => a => b => c => d => e"
 gas_test_error "weakref3.s" "" "a: would close weakref loop: a => b => c => d => e => a"
+gas_test_error "weakref4.s" "" "is already defined"
 
 load_lib gas-dg.exp
 dg-init
Index: gas/testsuite/gas/all/weakref1.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1.d,v
retrieving revision 1.1
diff -u -p -r1.1 weakref1.d
--- gas/testsuite/gas/all/weakref1.d 24 Oct 2005 17:51:42 -0000 1.1
+++ gas/testsuite/gas/all/weakref1.d 4 Nov 2005 19:36:19 -0000
@@ -11,9 +11,7 @@ OFFSET +TYPE +VALUE *
 # the rest of this file is generated with the following script:
 # # script begin
 # echo \#...
-# sed -n 's:^\.weakref .*, \(\(u\|\(w\)\).*\)$:.*( \3 |\(sec  0\)).* \1:p' weakref1.s | uniq | while read line; do echo "$line"; echo "#..."; done
-
-# sed -n 's:^\.long \(W\|\)\(.*[^a-z]\)[a-z]*\(\| - .*\)$:\2:p' weakref1.s | sed -e 's,^[lg].*,(&|\\.text)(\\+0x[0-9a-f]+)?,' | sed 's,^,[0-9a-f]+ [^ ]*  +,'
+# sed -n 's:^[ ]*\.long \(W\|\)\(.*[^a-z]\)[a-z]*\(\| - .*\)$:\2:p' weakref1.s | sed -e 's,^[lg].*,(&|\\.text)(\\+0x[0-9a-f]+)?,' | sed 's,^,[0-9a-f]+ [^ ]*  +,'
 # # script output:
 #...
 [0-9a-f]+ [^ ]*  +wa1
@@ -71,8 +69,6 @@ OFFSET +TYPE +VALUE *
 [0-9a-f]+ [^ ]*  +ww9
 [0-9a-f]+ [^ ]*  +ww10
 [0-9a-f]+ [^ ]*  +ww10
-[0-9a-f]+ [^ ]*  +um2
-[0-9a-f]+ [^ ]*  +wm3
 [0-9a-f]+ [^ ]*  +um5
 [0-9a-f]+ [^ ]*  +wm6
 [0-9a-f]+ [^ ]*  +wm7
@@ -87,18 +83,6 @@ OFFSET +TYPE +VALUE *
 [0-9a-f]+ [^ ]*  +uh8
 [0-9a-f]+ [^ ]*  +uh9
 [0-9a-f]+ [^ ]*  +uh9
-[0-9a-f]+ [^ ]*  +(lr1|\.text)(\+0x[0-9a-f]+)?
-[0-9a-f]+ [^ ]*  +(lr1|\.text)(\+0x[0-9a-f]+)?
-[0-9a-f]+ [^ ]*  +(lr2|\.text)(\+0x[0-9a-f]+)?
-[0-9a-f]+ [^ ]*  +(lr2|\.text)(\+0x[0-9a-f]+)?
-[0-9a-f]+ [^ ]*  +wr3
-[0-9a-f]+ [^ ]*  +wr3
-[0-9a-f]+ [^ ]*  +wr4
-[0-9a-f]+ [^ ]*  +wr5
-[0-9a-f]+ [^ ]*  +(lr6|\.text)(\+0x[0-9a-f]+)?
-[0-9a-f]+ [^ ]*  +ur6
-[0-9a-f]+ [^ ]*  +(lr7|\.text)(\+0x[0-9a-f]+)?
-[0-9a-f]+ [^ ]*  +(lr7|\.text)(\+0x[0-9a-f]+)?
 [0-9a-f]+ [^ ]*  +(ld1|\.text)(\+0x[0-9a-f]+)?
 [0-9a-f]+ [^ ]*  +(ld2|\.text)(\+0x[0-9a-f]+)?
 [0-9a-f]+ [^ ]*  +(ld3|\.text)(\+0x[0-9a-f]+)?
Index: gas/testsuite/gas/all/weakref1.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1.s,v
retrieving revision 1.1
diff -u -p -r1.1 weakref1.s
--- gas/testsuite/gas/all/weakref1.s 24 Oct 2005 17:51:42 -0000 1.1
+++ gas/testsuite/gas/all/weakref1.s 4 Nov 2005 19:36:19 -0000
@@ -126,17 +126,6 @@ l:
  .weak ww10
 
 /* m# test multiple weakrefs */
- .weakref Wnm1, nm1
- .weakref Wnm1, nm1
-
- .weakref Wum2, um2
- .weakref Wum2, um2
- .long um2
-
- .weakref Wwm3, wm3
- .weakref Wwm3, wm3
- .long Wwm3
-
  .weakref Wnm4a, nm4
  .weakref Wnm4b, nm4
 
@@ -197,40 +186,6 @@ l:
  .weakref Wuh9a, uh9
  .long uh9
 
-/* r# weakref redefinitions, to and from */
- .weakref lr1, nr1
- .long lr1
- .set lr1, l
- .long lr1
-
- .long lr2
- .weakref lr2, nr2
- .set lr2, l
- .long lr2
-
- .set Wwr3, l
- .long Wwr3
- .weakref Wwr3, wr3
- .long Wwr3
-
- .set Wwr4, l
- .weakref Wwr4, wr4
- .long Wwr4
-
- .set Wwr5, l
- .long Wwr5
- .weakref Wwr5, wr5
-
- .weakref lr6, ur6
- .long lr6
- .set lr6, l
- .long ur6
-
- .weakref lr7, nr7
- .long lr7
-lr7:
- .long lr7
-
 /* d# target symbol definitions */
  .weakref Wld1, ld1
  .long Wld1
Index: gas/testsuite/gas/all/weakref1l.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1l.d,v
retrieving revision 1.1
diff -u -p -r1.1 weakref1l.d
--- gas/testsuite/gas/all/weakref1l.d 24 Oct 2005 17:51:42 -0000 1.1
+++ gas/testsuite/gas/all/weakref1l.d 4 Nov 2005 19:36:19 -0000
@@ -13,14 +13,6 @@
 #...
 .* t l
 #...
-.* t lr1
-#...
-.* t lr2
-#...
-.* t lr6
-#...
-.* t lr7
-#...
 .* t ld1
 #...
 .* t ld2
Index: gas/testsuite/gas/all/weakref1u.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1u.d,v
retrieving revision 1.1
diff -u -p -r1.1 weakref1u.d
--- gas/testsuite/gas/all/weakref1u.d 24 Oct 2005 17:51:42 -0000 1.1
+++ gas/testsuite/gas/all/weakref1u.d 4 Nov 2005 19:36:19 -0000
@@ -39,15 +39,11 @@
 #...
 .* U uc9
 #...
-.* U um2
-#...
 .* U um5
 #...
 .* U uh8
 #...
 .* U uh9
 #...
-.* U ur6
-#...
 .* U ud5
 #pass
Index: gas/testsuite/gas/all/weakref1w.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1w.d,v
retrieving revision 1.1
diff -u -p -r1.1 weakref1w.d
--- gas/testsuite/gas/all/weakref1w.d 24 Oct 2005 17:51:42 -0000 1.1
+++ gas/testsuite/gas/all/weakref1w.d 4 Nov 2005 19:36:19 -0000
@@ -36,8 +36,6 @@
 #...
 .* w ww10
 #...
-.* w wm3
-#...
 .* w wm6
 #...
 .* w wm7
@@ -55,10 +53,4 @@
 .* w wh6
 #...
 .* w wh7
-#...
-.* w wr3
-#...
-.* w wr4
-#...
-.* w wr5
 #pass
Index: gas/testsuite/gas/all/weakref4.s
===================================================================
RCS file: gas/testsuite/gas/all/weakref4.s
diff -N gas/testsuite/gas/all/weakref4.s
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/all/weakref4.s 4 Nov 2005 19:36:19 -0000
@@ -0,0 +1,45 @@
+/* m# test multiple weakrefs */
+ .weakref Wnm1, nm1
+ .weakref Wnm1, nm1
+
+ .weakref Wum2, um2
+ .weakref Wum2, um2
+ .long um2
+
+ .weakref Wwm3, wm3
+ .weakref Wwm3, wm3
+ .long Wwm3
+
+/* r# weakref redefinitions, to and from */
+ .weakref lr1, nr1
+ .long lr1
+ .set lr1, l
+ .long lr1
+
+ .long lr2
+ .weakref lr2, nr2
+ .set lr2, l
+ .long lr2
+
+ .set Wwr3, l
+ .long Wwr3
+ .weakref Wwr3, wr3
+ .long Wwr3
+
+ .set Wwr4, l
+ .weakref Wwr4, wr4
+ .long Wwr4
+
+ .set Wwr5, l
+ .long Wwr5
+ .weakref Wwr5, wr5
+
+ .weakref lr6, ur6
+ .long lr6
+ .set lr6, l
+ .long ur6
+
+ .weakref lr7, nr7
+ .long lr7
+lr7:
+ .long lr7


--
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
Reply | Threaded
Open this post in threaded view
|

Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Khem Raj
Hi Alexandre

This will cause glibc build failure. I am attaching the preprocessed
sourcefile from glibc which
shows this problem. It comes from some equates defined in glibc
sysdeps/wordsize-32/symbol-hacks.c

Thanks

Khem


Alexandre Oliva wrote:

>On Nov  4, 2005, "Jan Beulich" <[hidden email]> wrote:
>
>  
>
>>Finally, Alexandre promised to address the problems (attached,
>>unfortunately not copied to the list), which is why I didn't spend
>>any time on addressing these (not to mention that I didn't really
>>have time to do so).  Meanwhile I suggest the following (probably I
>>could even consider this obvious and don't wait for approval...):
>>    
>>
>
>Yeah, sorry that it took me so long to get back to this.  Funny that
>I'd start working on the patch before even seeing this exchange of
>yours.  I had to update my source tree and re-create my patch such
>that it would apply after your check in :-)
>
>There's one bit I'm confused about.  It seems to be that, after your
>patch to flag redefinitions, we'd still accept:
>
>.set a, b
>a:
>
>although I'd think this should be rejected, just like other
>redefinitions, no?  I've included the change to reject this (and
>similar redefinitions of weakrefs) in my patch, which I'm checking in
>as obvious, although I'm a bit concerned that this one change is not
>entirely obvious, so if anyone disagrees with it, feel free to revert
>the bit in symbols.c to get it back in shape.
>
>Jan, I couldn't quite figure out the meaning of volatile and
>forward_ref, that I believe were introduced in your patch (I don't
>recall having seen them before).  Would you please document them in
>gas/doc, like the other fields and accessor functions?
>
>Tested on amd64-linux-gnu.  Checking in...
>
>  
>
>------------------------------------------------------------------------
>
>Index: gas/ChangeLog
>from  Alexandre Oliva  <[hidden email]>
>
> * read.c (s_weakref): Do not permit redefinitions.
> * symbols.c (colon): Do not permit redefinitions of equated
> symbols.
>
>Index: gas/read.c
>===================================================================
>RCS file: /cvs/src/src/gas/read.c,v
>retrieving revision 1.111
>diff -u -p -r1.111 read.c
>--- gas/read.c 27 Oct 2005 07:40:07 -0000 1.111
>+++ gas/read.c 4 Nov 2005 19:36:10 -0000
>@@ -3178,6 +3178,14 @@ s_weakref (int ignore ATTRIBUTE_UNUSED)
>
>   symbolP = symbol_find_or_make (name);
>
>+  if (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
>+    {
>+      as_bad (_("symbol `%s' is already defined"), name);
>+      *end_name = delim;
>+      ignore_rest_of_line ();
>+      return;
>+    }
>+
>   *end_name = delim;
>
>   SKIP_WHITESPACE ();
>Index: gas/symbols.c
>===================================================================
>RCS file: /cvs/src/src/gas/symbols.c,v
>retrieving revision 1.68
>diff -u -p -r1.68 symbols.c
>--- gas/symbols.c 27 Oct 2005 07:40:07 -0000 1.68
>+++ gas/symbols.c 4 Nov 2005 19:36:12 -0000
>@@ -332,7 +332,8 @@ colon (/* Just seen "x:" - rattle symbol
>  local_symbol_set_frag (locsym, frag_now);
>  locsym->lsy_value = frag_now_fix ();
> }
>-      else if (!S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP))
>+      else if (!(S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
>+       || S_IS_COMMON (symbolP))
> {
>  if (S_GET_VALUE (symbolP) == 0)
>    {
>Index: gas/testsuite/ChangeLog
>from  Alexandre Oliva  <[hidden email]>
>
> * gas/all/gas.exp: Remove weakref xfail.  Run weakref4.s.
> * gas/all/weakref1.s: Move redefinition bits to...
> * gas/all/weakref4.s: ... new file.
> * gas/all/weakref1.d: Remove command moved to weakref1u.  Adjust
> remaining command for leading tabs.  Regenerate.
> * gas/all/weakref1l.d: Regenerate.
> * gas/all/weakref1u.d: Likewise.
> * gas/all/wealref1w.d: Likewise.
>
>Index: gas/testsuite/gas/all/gas.exp
>===================================================================
>RCS file: /cvs/src/src/gas/testsuite/gas/all/gas.exp,v
>retrieving revision 1.35
>diff -u -p -r1.35 gas.exp
>--- gas/testsuite/gas/all/gas.exp 4 Nov 2005 13:25:59 -0000 1.35
>+++ gas/testsuite/gas/all/gas.exp 4 Nov 2005 19:36:19 -0000
>@@ -256,20 +256,16 @@ if { ![istarget "i960-*-*"] } {
> case $target_triplet in {
>     { z80-*-* } { }
>     default {
>- setup_xfail *-*-*
> run_dump_test weakref1
>- setup_xfail *-*-*
> run_dump_test weakref1g
>- setup_xfail *-*-*
> run_dump_test weakref1l
>- setup_xfail *-*-*
> run_dump_test weakref1u
>- setup_xfail *-*-*
> run_dump_test weakref1w
>     }
> }
> gas_test_error "weakref2.s" "" "e: would close weakref loop: e => a => b => c => d => e"
> gas_test_error "weakref3.s" "" "a: would close weakref loop: a => b => c => d => e => a"
>+gas_test_error "weakref4.s" "" "is already defined"
>
> load_lib gas-dg.exp
> dg-init
>Index: gas/testsuite/gas/all/weakref1.d
>===================================================================
>RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1.d,v
>retrieving revision 1.1
>diff -u -p -r1.1 weakref1.d
>--- gas/testsuite/gas/all/weakref1.d 24 Oct 2005 17:51:42 -0000 1.1
>+++ gas/testsuite/gas/all/weakref1.d 4 Nov 2005 19:36:19 -0000
>@@ -11,9 +11,7 @@ OFFSET +TYPE +VALUE *
> # the rest of this file is generated with the following script:
> # # script begin
> # echo \#...
>-# sed -n 's:^\.weakref .*, \(\(u\|\(w\)\).*\)$:.*( \3 |\(sec  0\)).* \1:p' weakref1.s | uniq | while read line; do echo "$line"; echo "#..."; done
>-
>-# sed -n 's:^\.long \(W\|\)\(.*[^a-z]\)[a-z]*\(\| - .*\)$:\2:p' weakref1.s | sed -e 's,^[lg].*,(&|\\.text)(\\+0x[0-9a-f]+)?,' | sed 's,^,[0-9a-f]+ [^ ]*  +,'
>+# sed -n 's:^[ ]*\.long \(W\|\)\(.*[^a-z]\)[a-z]*\(\| - .*\)$:\2:p' weakref1.s | sed -e 's,^[lg].*,(&|\\.text)(\\+0x[0-9a-f]+)?,' | sed 's,^,[0-9a-f]+ [^ ]*  +,'
> # # script output:
> #...
> [0-9a-f]+ [^ ]*  +wa1
>@@ -71,8 +69,6 @@ OFFSET +TYPE +VALUE *
> [0-9a-f]+ [^ ]*  +ww9
> [0-9a-f]+ [^ ]*  +ww10
> [0-9a-f]+ [^ ]*  +ww10
>-[0-9a-f]+ [^ ]*  +um2
>-[0-9a-f]+ [^ ]*  +wm3
> [0-9a-f]+ [^ ]*  +um5
> [0-9a-f]+ [^ ]*  +wm6
> [0-9a-f]+ [^ ]*  +wm7
>@@ -87,18 +83,6 @@ OFFSET +TYPE +VALUE *
> [0-9a-f]+ [^ ]*  +uh8
> [0-9a-f]+ [^ ]*  +uh9
> [0-9a-f]+ [^ ]*  +uh9
>-[0-9a-f]+ [^ ]*  +(lr1|\.text)(\+0x[0-9a-f]+)?
>-[0-9a-f]+ [^ ]*  +(lr1|\.text)(\+0x[0-9a-f]+)?
>-[0-9a-f]+ [^ ]*  +(lr2|\.text)(\+0x[0-9a-f]+)?
>-[0-9a-f]+ [^ ]*  +(lr2|\.text)(\+0x[0-9a-f]+)?
>-[0-9a-f]+ [^ ]*  +wr3
>-[0-9a-f]+ [^ ]*  +wr3
>-[0-9a-f]+ [^ ]*  +wr4
>-[0-9a-f]+ [^ ]*  +wr5
>-[0-9a-f]+ [^ ]*  +(lr6|\.text)(\+0x[0-9a-f]+)?
>-[0-9a-f]+ [^ ]*  +ur6
>-[0-9a-f]+ [^ ]*  +(lr7|\.text)(\+0x[0-9a-f]+)?
>-[0-9a-f]+ [^ ]*  +(lr7|\.text)(\+0x[0-9a-f]+)?
> [0-9a-f]+ [^ ]*  +(ld1|\.text)(\+0x[0-9a-f]+)?
> [0-9a-f]+ [^ ]*  +(ld2|\.text)(\+0x[0-9a-f]+)?
> [0-9a-f]+ [^ ]*  +(ld3|\.text)(\+0x[0-9a-f]+)?
>Index: gas/testsuite/gas/all/weakref1.s
>===================================================================
>RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1.s,v
>retrieving revision 1.1
>diff -u -p -r1.1 weakref1.s
>--- gas/testsuite/gas/all/weakref1.s 24 Oct 2005 17:51:42 -0000 1.1
>+++ gas/testsuite/gas/all/weakref1.s 4 Nov 2005 19:36:19 -0000
>@@ -126,17 +126,6 @@ l:
> .weak ww10
>
> /* m# test multiple weakrefs */
>- .weakref Wnm1, nm1
>- .weakref Wnm1, nm1
>-
>- .weakref Wum2, um2
>- .weakref Wum2, um2
>- .long um2
>-
>- .weakref Wwm3, wm3
>- .weakref Wwm3, wm3
>- .long Wwm3
>-
> .weakref Wnm4a, nm4
> .weakref Wnm4b, nm4
>
>@@ -197,40 +186,6 @@ l:
> .weakref Wuh9a, uh9
> .long uh9
>
>-/* r# weakref redefinitions, to and from */
>- .weakref lr1, nr1
>- .long lr1
>- .set lr1, l
>- .long lr1
>-
>- .long lr2
>- .weakref lr2, nr2
>- .set lr2, l
>- .long lr2
>-
>- .set Wwr3, l
>- .long Wwr3
>- .weakref Wwr3, wr3
>- .long Wwr3
>-
>- .set Wwr4, l
>- .weakref Wwr4, wr4
>- .long Wwr4
>-
>- .set Wwr5, l
>- .long Wwr5
>- .weakref Wwr5, wr5
>-
>- .weakref lr6, ur6
>- .long lr6
>- .set lr6, l
>- .long ur6
>-
>- .weakref lr7, nr7
>- .long lr7
>-lr7:
>- .long lr7
>-
> /* d# target symbol definitions */
> .weakref Wld1, ld1
> .long Wld1
>Index: gas/testsuite/gas/all/weakref1l.d
>===================================================================
>RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1l.d,v
>retrieving revision 1.1
>diff -u -p -r1.1 weakref1l.d
>--- gas/testsuite/gas/all/weakref1l.d 24 Oct 2005 17:51:42 -0000 1.1
>+++ gas/testsuite/gas/all/weakref1l.d 4 Nov 2005 19:36:19 -0000
>@@ -13,14 +13,6 @@
> #...
> .* t l
> #...
>-.* t lr1
>-#...
>-.* t lr2
>-#...
>-.* t lr6
>-#...
>-.* t lr7
>-#...
> .* t ld1
> #...
> .* t ld2
>Index: gas/testsuite/gas/all/weakref1u.d
>===================================================================
>RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1u.d,v
>retrieving revision 1.1
>diff -u -p -r1.1 weakref1u.d
>--- gas/testsuite/gas/all/weakref1u.d 24 Oct 2005 17:51:42 -0000 1.1
>+++ gas/testsuite/gas/all/weakref1u.d 4 Nov 2005 19:36:19 -0000
>@@ -39,15 +39,11 @@
> #...
> .* U uc9
> #...
>-.* U um2
>-#...
> .* U um5
> #...
> .* U uh8
> #...
> .* U uh9
> #...
>-.* U ur6
>-#...
> .* U ud5
> #pass
>Index: gas/testsuite/gas/all/weakref1w.d
>===================================================================
>RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1w.d,v
>retrieving revision 1.1
>diff -u -p -r1.1 weakref1w.d
>--- gas/testsuite/gas/all/weakref1w.d 24 Oct 2005 17:51:42 -0000 1.1
>+++ gas/testsuite/gas/all/weakref1w.d 4 Nov 2005 19:36:19 -0000
>@@ -36,8 +36,6 @@
> #...
> .* w ww10
> #...
>-.* w wm3
>-#...
> .* w wm6
> #...
> .* w wm7
>@@ -55,10 +53,4 @@
> .* w wh6
> #...
> .* w wh7
>-#...
>-.* w wr3
>-#...
>-.* w wr4
>-#...
>-.* w wr5
> #pass
>Index: gas/testsuite/gas/all/weakref4.s
>===================================================================
>RCS file: gas/testsuite/gas/all/weakref4.s
>diff -N gas/testsuite/gas/all/weakref4.s
>--- /dev/null 1 Jan 1970 00:00:00 -0000
>+++ gas/testsuite/gas/all/weakref4.s 4 Nov 2005 19:36:19 -0000
>@@ -0,0 +1,45 @@
>+/* m# test multiple weakrefs */
>+ .weakref Wnm1, nm1
>+ .weakref Wnm1, nm1
>+
>+ .weakref Wum2, um2
>+ .weakref Wum2, um2
>+ .long um2
>+
>+ .weakref Wwm3, wm3
>+ .weakref Wwm3, wm3
>+ .long Wwm3
>+
>+/* r# weakref redefinitions, to and from */
>+ .weakref lr1, nr1
>+ .long lr1
>+ .set lr1, l
>+ .long lr1
>+
>+ .long lr2
>+ .weakref lr2, nr2
>+ .set lr2, l
>+ .long lr2
>+
>+ .set Wwr3, l
>+ .long Wwr3
>+ .weakref Wwr3, wr3
>+ .long Wwr3
>+
>+ .set Wwr4, l
>+ .weakref Wwr4, wr4
>+ .long Wwr4
>+
>+ .set Wwr5, l
>+ .long Wwr5
>+ .weakref Wwr5, wr5
>+
>+ .weakref lr6, ur6
>+ .long lr6
>+ .set lr6, l
>+ .long ur6
>+
>+ .weakref lr7, nr7
>+ .long lr7
>+lr7:
>+ .long lr7
>  
>
>------------------------------------------------------------------------
>
>
>  
>
--
Khem Raj <[hidden email]>
MontaVista Software, Inc.
www.mvista.com


# 1 "../sysdeps/wordsize-32/divdi3.c"
# 1 "/local/work/rpmdir/BUILD/glibc-2.3.6/csu//"
# 1 "<built-in>"
# 1 "<command line>"






# 1 "./../include/libc-symbols.h" 1
# 56 "./../include/libc-symbols.h"
# 1 "/local/work/rpmdir/BUILD/glibc-2.3.6/objdir/config.h" 1
# 57 "./../include/libc-symbols.h" 2
# 819 "./../include/libc-symbols.h"
# 1 "../sysdeps/wordsize-32/symbol-hacks.h" 1
# 26 "../sysdeps/wordsize-32/symbol-hacks.h"
asm ("__divdi3 = __divdi3_internal");
asm ("__udivdi3 = __udivdi3_internal");
asm ("__moddi3 = __moddi3_internal");
asm ("__umoddi3 = __umoddi3_internal");
# 820 "./../include/libc-symbols.h" 2
# 8 "<command line>" 2
# 1 "../sysdeps/wordsize-32/divdi3.c"
# 21 "../sysdeps/wordsize-32/divdi3.c"
# 1 "../include/endian.h" 1
# 1 "../string/endian.h" 1
# 22 "../string/endian.h"
# 1 "../include/features.h" 1
# 308 "../include/features.h"
# 1 "../include/sys/cdefs.h" 1


# 1 "../misc/sys/cdefs.h" 1
# 4 "../include/sys/cdefs.h" 2

extern void __chk_fail (void) __attribute__ ((__noreturn__));
extern __typeof (__chk_fail) __chk_fail __asm__ ("" "__GI___chk_fail") __attribute__ ((visibility ("hidden")));

# 309 "../include/features.h" 2
# 331 "../include/features.h"
# 1 "../include/gnu/stubs.h" 1
# 332 "../include/features.h" 2
# 23 "../string/endian.h" 2
# 37 "../string/endian.h"
# 1 "../sysdeps/arm/bits/endian.h" 1
# 38 "../string/endian.h" 2
# 2 "../include/endian.h" 2
# 22 "../sysdeps/wordsize-32/divdi3.c" 2
# 1 "../include/stdlib.h" 1






# 1 "/opt/montavista/foundation/devkit/arm/v5t_le/lib/gcc/armv5tl-montavista-linuxeabi/3.4.5/include/stddef.h" 1 3 4
# 151 "/opt/montavista/foundation/devkit/arm/v5t_le/lib/gcc/armv5tl-montavista-linuxeabi/3.4.5/include/stddef.h" 3 4
typedef int ptrdiff_t;
# 213 "/opt/montavista/foundation/devkit/arm/v5t_le/lib/gcc/armv5tl-montavista-linuxeabi/3.4.5/include/stddef.h" 3 4
typedef unsigned int size_t;
# 325 "/opt/montavista/foundation/devkit/arm/v5t_le/lib/gcc/armv5tl-montavista-linuxeabi/3.4.5/include/stddef.h" 3 4
typedef unsigned int wchar_t;
# 8 "../include/stdlib.h" 2
# 1 "../stdlib/stdlib.h" 1
# 33 "../stdlib/stdlib.h"
# 1 "/opt/montavista/foundation/devkit/arm/v5t_le/lib/gcc/armv5tl-montavista-linuxeabi/3.4.5/include/stddef.h" 1 3 4
# 34 "../stdlib/stdlib.h" 2








# 1 "../sysdeps/unix/sysv/linux/bits/waitflags.h" 1
# 43 "../stdlib/stdlib.h" 2
# 1 "../sysdeps/generic/bits/waitstatus.h" 1
# 65 "../sysdeps/generic/bits/waitstatus.h"
# 1 "../include/endian.h" 1
# 66 "../sysdeps/generic/bits/waitstatus.h" 2

union wait
  {
    int w_status;
    struct
      {

 unsigned int __w_termsig:7;
 unsigned int __w_coredump:1;
 unsigned int __w_retcode:8;
 unsigned int:16;







      } __wait_terminated;
    struct
      {

 unsigned int __w_stopval:8;
 unsigned int __w_stopsig:8;
 unsigned int:16;






      } __wait_stopped;
  };
# 44 "../stdlib/stdlib.h" 2
# 68 "../stdlib/stdlib.h"
typedef union
  {
    union wait *__uptr;
    int *__iptr;
  } __WAIT_STATUS __attribute__ ((__transparent_union__));
# 96 "../stdlib/stdlib.h"


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;







__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;


# 140 "../stdlib/stdlib.h"
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__));




extern double atof (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

extern int atoi (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

extern long int atol (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





__extension__ extern long long int atoll (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern double strtod (__const char *__restrict __nptr,
        char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





extern float strtof (__const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (__const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





extern long int strtol (__const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (__const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoq (__const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (__const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





__extension__
extern long long int strtoll (__const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (__const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));

# 235 "../stdlib/stdlib.h"
# 1 "../include/xlocale.h" 1
# 1 "../locale/xlocale.h" 1
# 28 "../locale/xlocale.h"
typedef struct __locale_struct
{

  struct locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
} *__locale_t;
# 2 "../include/xlocale.h" 2
# 236 "../stdlib/stdlib.h" 2



extern long int strtol_l (__const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (__const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, __locale_t __loc)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (__const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    __locale_t __loc)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (__const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, __locale_t __loc)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (__const char *__restrict __nptr,
   char **__restrict __endptr, __locale_t __loc)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (__const char *__restrict __nptr,
         char **__restrict __endptr, __locale_t __loc)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (__const char *__restrict __nptr,
         char **__restrict __endptr,
         __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));






extern double __strtod_internal (__const char *__restrict __nptr,
     char **__restrict __endptr, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
extern float __strtof_internal (__const char *__restrict __nptr,
    char **__restrict __endptr, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
extern long double __strtold_internal (__const char *__restrict __nptr,
           char **__restrict __endptr,
           int __group) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));

extern long int __strtol_internal (__const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));



extern unsigned long int __strtoul_internal (__const char *__restrict __nptr,
          char **__restrict __endptr,
          int __base, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int __strtoll_internal (__const char *__restrict __nptr,
      char **__restrict __endptr,
      int __base, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern unsigned long long int __strtoull_internal (__const char *
         __restrict __nptr,
         char **__restrict __endptr,
         int __base, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));








extern __inline double
__attribute__ ((__nothrow__)) strtod (__const char *__restrict __nptr, char **__restrict __endptr)
{
  return __strtod_internal (__nptr, __endptr, 0);
}
extern __inline long int
__attribute__ ((__nothrow__)) strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtol_internal (__nptr, __endptr, __base, 0);
}
extern __inline unsigned long int
__attribute__ ((__nothrow__)) strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtoul_internal (__nptr, __endptr, __base, 0);
}




extern __inline float
__attribute__ ((__nothrow__)) strtof (__const char *__restrict __nptr, char **__restrict __endptr)
{
  return __strtof_internal (__nptr, __endptr, 0);
}
extern __inline long double
__attribute__ ((__nothrow__)) strtold (__const char *__restrict __nptr, char **__restrict __endptr)
{
  return __strtold_internal (__nptr, __endptr, 0);
}




__extension__ extern __inline long long int
__attribute__ ((__nothrow__)) strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtoll_internal (__nptr, __endptr, __base, 0);
}
__extension__ extern __inline unsigned long long int
__attribute__ ((__nothrow__)) strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtoull_internal (__nptr, __endptr, __base, 0);
}




__extension__ extern __inline long long int
__attribute__ ((__nothrow__)) strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtoll_internal (__nptr, __endptr, __base, 0);
}
__extension__ extern __inline unsigned long long int
__attribute__ ((__nothrow__)) strtoull (__const char * __restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtoull_internal (__nptr, __endptr, __base, 0);
}




extern __inline double
__attribute__ ((__nothrow__)) atof (__const char *__nptr)
{
  return strtod (__nptr, (char **) ((void *)0));
}
extern __inline int
__attribute__ ((__nothrow__)) atoi (__const char *__nptr)
{
  return (int) strtol (__nptr, (char **) ((void *)0), 10);
}
extern __inline long int
__attribute__ ((__nothrow__)) atol (__const char *__nptr)
{
  return strtol (__nptr, (char **) ((void *)0), 10);
}




__extension__ extern __inline long long int
__attribute__ ((__nothrow__)) atoll (__const char *__nptr)
{
  return strtoll (__nptr, (char **) ((void *)0), 10);
}

# 424 "../stdlib/stdlib.h"
extern char *l64a (long int __n) __attribute__ ((__nothrow__));


extern long int a64l (__const char *__s)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




# 1 "../include/sys/types.h" 1
# 1 "../posix/sys/types.h" 1
# 29 "../posix/sys/types.h"


# 1 "../sysdeps/generic/stdint.h" 1
# 27 "../sysdeps/generic/stdint.h"
# 1 "../sysdeps/generic/bits/wchar.h" 1
# 28 "../sysdeps/generic/stdint.h" 2
# 1 "../sysdeps/wordsize-32/bits/wordsize.h" 1
# 29 "../sysdeps/generic/stdint.h" 2
# 37 "../sysdeps/generic/stdint.h"
typedef signed char int8_t;
typedef short int int16_t;
typedef int int32_t;



__extension__
typedef long long int int64_t;




typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;

typedef unsigned int uint32_t;





__extension__
typedef unsigned long long int uint64_t;






typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef int int_least32_t;



__extension__
typedef long long int int_least64_t;



typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned int uint_least32_t;



__extension__
typedef unsigned long long int uint_least64_t;






typedef signed char int_fast8_t;





typedef int int_fast16_t;
typedef int int_fast32_t;
__extension__
typedef long long int int_fast64_t;



typedef unsigned char uint_fast8_t;





typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
__extension__
typedef unsigned long long int uint_fast64_t;
# 126 "../sysdeps/generic/stdint.h"
typedef int intptr_t;


typedef unsigned int uintptr_t;
# 138 "../sysdeps/generic/stdint.h"
__extension__
typedef long long int intmax_t;
__extension__
typedef unsigned long long int uintmax_t;
# 32 "../posix/sys/types.h" 2
# 1 "../sysdeps/generic/bits/types.h" 1
# 28 "../sysdeps/generic/bits/types.h"
# 1 "../sysdeps/wordsize-32/bits/wordsize.h" 1
# 29 "../sysdeps/generic/bits/types.h" 2


# 1 "/opt/montavista/foundation/devkit/arm/v5t_le/lib/gcc/armv5tl-montavista-linuxeabi/3.4.5/include/stddef.h" 1 3 4
# 32 "../sysdeps/generic/bits/types.h" 2


typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;


typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;




__extension__ typedef signed long long int __int64_t;
__extension__ typedef unsigned long long int __uint64_t;







__extension__ typedef long long int __quad_t;
__extension__ typedef unsigned long long int __u_quad_t;
# 129 "../sysdeps/generic/bits/types.h"
# 1 "../linuxthreads/sysdeps/pthread/bits/typesizes.h" 1
# 130 "../sysdeps/generic/bits/types.h" 2






__extension__ typedef __u_quad_t __dev_t;
__extension__ typedef unsigned int __uid_t;
__extension__ typedef unsigned int __gid_t;
__extension__ typedef unsigned long int __ino_t;
__extension__ typedef __u_quad_t __ino64_t;
__extension__ typedef unsigned int __mode_t;
__extension__ typedef unsigned int __nlink_t;
__extension__ typedef long int __off_t;
__extension__ typedef __quad_t __off64_t;
__extension__ typedef int __pid_t;
__extension__ typedef struct { int __val[2]; } __fsid_t;
__extension__ typedef long int __clock_t;
__extension__ typedef unsigned long int __rlim_t;
__extension__ typedef __u_quad_t __rlim64_t;
__extension__ typedef unsigned int __id_t;
__extension__ typedef long int __time_t;
__extension__ typedef unsigned int __useconds_t;
__extension__ typedef long int __suseconds_t;

__extension__ typedef int __daddr_t;
__extension__ typedef long int __swblk_t;
__extension__ typedef int __key_t;


__extension__ typedef int __clockid_t;


__extension__ typedef int __timer_t;


__extension__ typedef long int __blksize_t;




__extension__ typedef long int __blkcnt_t;
__extension__ typedef __quad_t __blkcnt64_t;


__extension__ typedef unsigned long int __fsblkcnt_t;
__extension__ typedef __u_quad_t __fsblkcnt64_t;


__extension__ typedef unsigned long int __fsfilcnt_t;
__extension__ typedef __u_quad_t __fsfilcnt64_t;

__extension__ typedef int __ssize_t;



typedef __off64_t __loff_t;
typedef __quad_t *__qaddr_t;
typedef char *__caddr_t;


__extension__ typedef int __intptr_t;


__extension__ typedef unsigned int __socklen_t;
# 33 "../posix/sys/types.h" 2



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;




typedef __loff_t loff_t;



typedef __ino_t ino_t;






typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;





typedef __off_t off_t;






typedef __off64_t off64_t;




typedef __pid_t pid_t;




typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;
# 134 "../posix/sys/types.h"
# 1 "../include/time.h" 1


# 1 "../time/time.h" 1
# 58 "../time/time.h"


typedef __clock_t clock_t;



# 74 "../time/time.h"


typedef __time_t time_t;



# 92 "../time/time.h"
typedef __clockid_t clockid_t;
# 104 "../time/time.h"
typedef __timer_t timer_t;
# 4 "../include/time.h" 2
# 135 "../posix/sys/types.h" 2



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/opt/montavista/foundation/devkit/arm/v5t_le/lib/gcc/armv5tl-montavista-linuxeabi/3.4.5/include/stddef.h" 1 3 4
# 149 "../posix/sys/types.h" 2



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
# 198 "../posix/sys/types.h"
typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));

typedef int register_t __attribute__ ((__mode__ (__word__)));
# 214 "../posix/sys/types.h"
# 1 "../include/endian.h" 1
# 215 "../posix/sys/types.h" 2


# 1 "../include/sys/select.h" 1

# 1 "../misc/sys/select.h" 1
# 31 "../misc/sys/select.h"
# 1 "../sysdeps/generic/bits/select.h" 1
# 32 "../misc/sys/select.h" 2


# 1 "../sysdeps/unix/sysv/linux/bits/sigset.h" 1
# 23 "../sysdeps/unix/sysv/linux/bits/sigset.h"
typedef int __sig_atomic_t;




typedef struct
  {
    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
  } __sigset_t;
# 35 "../misc/sys/select.h" 2



typedef __sigset_t sigset_t;





# 1 "../include/time.h" 1


# 1 "../time/time.h" 1
# 118 "../time/time.h"
struct timespec
  {
    __time_t tv_sec;
    long int tv_nsec;
  };
# 4 "../include/time.h" 2
# 45 "../misc/sys/select.h" 2

# 1 "../sysdeps/generic/bits/time.h" 1
# 69 "../sysdeps/generic/bits/time.h"
struct timeval
  {
    __time_t tv_sec;
    __suseconds_t tv_usec;
  };
# 47 "../misc/sys/select.h" 2
# 55 "../misc/sys/select.h"
typedef long int __fd_mask;
# 67 "../misc/sys/select.h"
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 99 "../misc/sys/select.h"

# 109 "../misc/sys/select.h"
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 121 "../misc/sys/select.h"
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);



# 3 "../include/sys/select.h" 2


extern int __pselect (int __nfds, fd_set *__readfds,
        fd_set *__writefds, fd_set *__exceptfds,
        const struct timespec *__timeout,
        const __sigset_t *__sigmask);

extern int __select (int __nfds, fd_set *__restrict __readfds,
       fd_set *__restrict __writefds,
       fd_set *__restrict __exceptfds,
       struct timeval *__restrict __timeout);
extern __typeof (__select) __select __asm__ ("" "__GI___select") __attribute__ ((visibility ("hidden")));
# 218 "../posix/sys/types.h" 2


# 1 "../sysdeps/unix/sysv/linux/sys/sysmacros.h" 1
# 29 "../sysdeps/unix/sysv/linux/sys/sysmacros.h"
__extension__
extern __inline unsigned int gnu_dev_major (unsigned long long int __dev)
     __attribute__ ((__nothrow__));
__extension__
extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
     __attribute__ ((__nothrow__));
__extension__
extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
       unsigned int __minor)
     __attribute__ ((__nothrow__));


__extension__ extern __inline unsigned int
__attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev)
{
  return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
}

__extension__ extern __inline unsigned int
__attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev)
{
  return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
}

__extension__ extern __inline unsigned long long int
__attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor)
{
  return ((__minor & 0xff) | ((__major & 0xfff) << 8)
   | (((unsigned long long int) (__minor & ~0xff)) << 12)
   | (((unsigned long long int) (__major & ~0xfff)) << 32));
}
# 221 "../posix/sys/types.h" 2




typedef __blksize_t blksize_t;






typedef __blkcnt_t blkcnt_t;



typedef __fsblkcnt_t fsblkcnt_t;



typedef __fsfilcnt_t fsfilcnt_t;
# 259 "../posix/sys/types.h"
typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "../linuxthreads/sysdeps/pthread/bits/pthreadtypes.h" 1
# 23 "../linuxthreads/sysdeps/pthread/bits/pthreadtypes.h"
# 1 "../sysdeps/unix/sysv/linux/bits/sched.h" 1
# 83 "../sysdeps/unix/sysv/linux/bits/sched.h"
struct __sched_param
  {
    int __sched_priority;
  };
# 24 "../linuxthreads/sysdeps/pthread/bits/pthreadtypes.h" 2


struct _pthread_fastlock
{
  long int __status;
  int __spinlock;

};



typedef struct _pthread_descr_struct *_pthread_descr;





typedef struct __pthread_attr_s
{
  int __detachstate;
  int __schedpolicy;
  struct __sched_param __schedparam;
  int __inheritsched;
  int __scope;
  size_t __guardsize;
  int __stackaddr_set;
  void *__stackaddr;
  size_t __stacksize;
} pthread_attr_t;





__extension__ typedef long long __pthread_cond_align_t;




typedef struct
{
  struct _pthread_fastlock __c_lock;
  _pthread_descr __c_waiting;
  char __padding[48 - sizeof (struct _pthread_fastlock)
   - sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)];
  __pthread_cond_align_t __align;
} pthread_cond_t;



typedef struct
{
  int __dummy;
} pthread_condattr_t;


typedef unsigned int pthread_key_t;





typedef struct
{
  int __m_reserved;
  int __m_count;
  _pthread_descr __m_owner;
  int __m_kind;
  struct _pthread_fastlock __m_lock;
} pthread_mutex_t;



typedef struct
{
  int __mutexkind;
} pthread_mutexattr_t;



typedef int pthread_once_t;




typedef struct _pthread_rwlock_t
{
  struct _pthread_fastlock __rw_lock;
  int __rw_readers;
  _pthread_descr __rw_writer;
  _pthread_descr __rw_read_waiting;
  _pthread_descr __rw_write_waiting;
  int __rw_kind;
  int __rw_pshared;
} pthread_rwlock_t;



typedef struct
{
  int __lockkind;
  int __pshared;
} pthread_rwlockattr_t;




typedef volatile int pthread_spinlock_t;


typedef struct {
  struct _pthread_fastlock __ba_lock;
  int __ba_required;
  int __ba_present;
  _pthread_descr __ba_waiting;
} pthread_barrier_t;


typedef struct {
  int __pshared;
} pthread_barrierattr_t;





typedef unsigned long int pthread_t;
# 268 "../posix/sys/types.h" 2



# 2 "../include/sys/types.h" 2
# 434 "../stdlib/stdlib.h" 2






extern long int random (void) __attribute__ ((__nothrow__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));






extern int rand (void) __attribute__ ((__nothrow__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__));




extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__));







extern double drand48 (void) __attribute__ ((__nothrow__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    unsigned long long int __a;
  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));









extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));







extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));

extern void free (void *__ptr) __attribute__ ((__nothrow__));




extern void cfree (void *__ptr) __attribute__ ((__nothrow__));



# 1 "../include/alloca.h" 1


# 1 "../stdlib/alloca.h" 1
# 25 "../stdlib/alloca.h"
# 1 "/opt/montavista/foundation/devkit/arm/v5t_le/lib/gcc/armv5tl-montavista-linuxeabi/3.4.5/include/stddef.h" 1 3 4
# 26 "../stdlib/alloca.h" 2







extern void *alloca (size_t __size) __attribute__ ((__nothrow__));






# 4 "../include/alloca.h" 2
# 1 "../sysdeps/arm/stackinfo.h" 1
# 5 "../include/alloca.h" 2




extern void *__alloca (size_t __size);





extern int __libc_use_alloca (size_t size) __attribute__ ((const));
extern int __libc_alloca_cutoff (size_t size) __attribute__ ((const));



# 1 "../linuxthreads/sysdeps/unix/sysv/linux/allocalim.h" 1
# 20 "../linuxthreads/sysdeps/unix/sysv/linux/allocalim.h"
# 1 "../include/limits.h" 1
# 124 "../include/limits.h"
# 1 "/opt/montavista/foundation/devkit/arm/v5t_le/lib/gcc/armv5tl-montavista-linuxeabi/3.4.5/include/limits.h" 1 3 4
# 125 "../include/limits.h" 2
# 144 "../include/limits.h"
# 1 "../include/bits/posix1_lim.h" 1
# 1 "../posix/bits/posix1_lim.h" 1
# 153 "../posix/bits/posix1_lim.h"
# 1 "../linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h" 1
# 36 "../linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h"
# 1 "/opt/montavista/foundation/devkit/arm/v5t_le/target/usr/include/linux/limits.h" 1 3 4
# 37 "../linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h" 2
# 154 "../posix/bits/posix1_lim.h" 2
# 2 "../include/bits/posix1_lim.h" 2
# 145 "../include/limits.h" 2



# 1 "../include/bits/posix2_lim.h" 1
# 1 "../posix/bits/posix2_lim.h" 1
# 2 "../include/bits/posix2_lim.h" 2
# 149 "../include/limits.h" 2



# 1 "../include/bits/xopen_lim.h" 1
# 34 "../include/bits/xopen_lim.h"
# 1 "/local/work/rpmdir/BUILD/glibc-2.3.6/objdir/bits/stdio_lim.h" 1
# 35 "../include/bits/xopen_lim.h" 2
# 153 "../include/limits.h" 2
# 21 "../linuxthreads/sysdeps/unix/sysv/linux/allocalim.h" 2

extern inline int __libc_use_alloca (size_t size)
{
  return (__builtin_expect (size <= 16384 / 4, 1)
   || __libc_alloca_cutoff (size));
}
# 21 "../include/alloca.h" 2
# 607 "../stdlib/stdlib.h" 2




extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));




extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));






extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));






extern void _Exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));






extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));




extern char *__secure_getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (__const char *__name, __const char *__value, int __replace)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__));






extern int clearenv (void) __attribute__ ((__nothrow__));
# 691 "../stdlib/stdlib.h"
extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
# 702 "../stdlib/stdlib.h"
extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1)));
# 711 "../stdlib/stdlib.h"
extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1)));
# 721 "../stdlib/stdlib.h"
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));








extern int system (__const char *__command);







extern char *canonicalize_file_name (__const char *__name)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
# 749 "../stdlib/stdlib.h"
extern char *realpath (__const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__));






typedef int (*__compar_fn_t) (__const void *, __const void *);


typedef __compar_fn_t comparison_fn_t;






extern void *bsearch (__const void *__key, __const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5)));



extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));



extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__));



__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__));







extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__));
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__));




__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__));

# 814 "../stdlib/stdlib.h"
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4)));




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4)));




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3)));




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4)));
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4)));
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3)));




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));







extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__));


extern int mbtowc (wchar_t *__restrict __pwc,
     __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__));

extern size_t wcstombs (char *__restrict __s,
   __const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__));








extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
# 902 "../stdlib/stdlib.h"
extern int getsubopt (char **__restrict __optionp,
        char *__const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3)));





extern void setkey (__const char *__key) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));







extern int posix_openpt (int __oflag);







extern int grantpt (int __fd) __attribute__ ((__nothrow__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__));






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));






# 9 "../include/stdlib.h" 2




extern __typeof (strtol_l) __strtol_l __attribute__ ((__nothrow__));
extern __typeof (strtoul_l) __strtoul_l __attribute__ ((__nothrow__));
extern __typeof (strtoll_l) __strtoll_l __attribute__ ((__nothrow__));
extern __typeof (strtoull_l) __strtoull_l __attribute__ ((__nothrow__));
extern __typeof (strtod_l) __strtod_l __attribute__ ((__nothrow__));
extern __typeof (strtof_l) __strtof_l __attribute__ ((__nothrow__));
extern __typeof (strtold_l) __strtold_l __attribute__ ((__nothrow__));

extern __typeof (exit) exit __asm__ ("" "__GI_exit") __attribute__ ((visibility ("hidden")));
extern __typeof (abort) abort __asm__ ("" "__GI_abort") __attribute__ ((visibility ("hidden")));
extern __typeof (getenv) getenv __asm__ ("" "__GI_getenv") __attribute__ ((visibility ("hidden")));
extern __typeof (bsearch) bsearch __asm__ ("" "__GI_bsearch") __attribute__ ((visibility ("hidden")));
extern __typeof (qsort) qsort __asm__ ("" "__GI_qsort") __attribute__ ((visibility ("hidden")));
extern __typeof (ecvt_r) ecvt_r __asm__ ("" "__GI_ecvt_r") __attribute__ ((visibility ("hidden")));
extern __typeof (fcvt_r) fcvt_r __asm__ ("" "__GI_fcvt_r") __attribute__ ((visibility ("hidden")));
extern __typeof (qecvt_r) qecvt_r __asm__ ("" "__GI_qecvt_r") __attribute__ ((visibility ("hidden")));
extern __typeof (qfcvt_r) qfcvt_r __asm__ ("" "__GI_qfcvt_r") __attribute__ ((visibility ("hidden")));
extern __typeof (lrand48_r) lrand48_r __asm__ ("" "__GI_lrand48_r") __attribute__ ((visibility ("hidden")));
extern __typeof (wctomb) wctomb __asm__ ("" "__GI_wctomb") __attribute__ ((visibility ("hidden")));
extern __typeof (__secure_getenv) __secure_getenv __asm__ ("" "__GI___secure_getenv") __attribute__ ((visibility ("hidden")));
extern __typeof (__strtof_internal) __strtof_internal __asm__ ("" "__GI___strtof_internal") __attribute__ ((visibility ("hidden")));
extern __typeof (__strtod_internal) __strtod_internal __asm__ ("" "__GI___strtod_internal") __attribute__ ((visibility ("hidden")));
extern __typeof (__strtold_internal) __strtold_internal __asm__ ("" "__GI___strtold_internal") __attribute__ ((visibility ("hidden")));
extern __typeof (__strtol_internal) __strtol_internal __asm__ ("" "__GI___strtol_internal") __attribute__ ((visibility ("hidden")));
extern __typeof (__strtoll_internal) __strtoll_internal __asm__ ("" "__GI___strtoll_internal") __attribute__ ((visibility ("hidden")));
extern __typeof (__strtoul_internal) __strtoul_internal __asm__ ("" "__GI___strtoul_internal") __attribute__ ((visibility ("hidden")));
extern __typeof (__strtoull_internal) __strtoull_internal __asm__ ("" "__GI___strtoull_internal") __attribute__ ((visibility ("hidden")));

extern long int __random (void);
extern void __srandom (unsigned int __seed);
extern char *__initstate (unsigned int __seed, char *__statebuf,
     size_t __statelen);
extern char *__setstate (char *__statebuf);
extern int __random_r (struct random_data *__buf, int32_t *__result);
extern int __srandom_r (unsigned int __seed, struct random_data *__buf);
extern int __initstate_r (unsigned int __seed, char *__statebuf,
     size_t __statelen, struct random_data *__buf);
extern int __setstate_r (char *__statebuf, struct random_data *__buf);
extern int __rand_r (unsigned int *__seed);
extern int __erand48_r (unsigned short int __xsubi[3],
   struct drand48_data *__buffer, double *__result);
extern int __nrand48_r (unsigned short int __xsubi[3],
   struct drand48_data *__buffer,
   long int *__result);
extern int __jrand48_r (unsigned short int __xsubi[3],
   struct drand48_data *__buffer,
   long int *__result);
extern int __srand48_r (long int __seedval,
   struct drand48_data *__buffer);
extern int __seed48_r (unsigned short int __seed16v[3],
         struct drand48_data *__buffer);
extern int __lcong48_r (unsigned short int __param[7],
   struct drand48_data *__buffer);


extern int __drand48_iterate (unsigned short int __xsubi[3],
         struct drand48_data *__buffer);


extern struct drand48_data __libc_drand48_data __attribute__ ((visibility ("hidden")));

extern int __setenv (__const char *__name, __const char *__value,
       int __replace);
extern int __unsetenv (__const char *__name);
extern int __clearenv (void);
extern char *__canonicalize_file_name (__const char *__name);
extern char *__realpath (__const char *__name, char *__resolved);
extern int __ptsname_r (int __fd, char *__buf, size_t __buflen);
extern int __getpt (void);
extern int __posix_openpt (int __oflag);

extern int __add_to_environ (const char *name, const char *value,
        const char *combines, int replace);

extern void _quicksort (void *const pbase, size_t total_elems,
   size_t size, __compar_fn_t cmp);

extern int __on_exit (void (*__func) (int __status, void *__arg), void *__arg);

extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
extern int __cxa_atexit_internal (void (*func) (void *), void *arg, void *d)
     __attribute__ ((visibility ("hidden")));

extern void __cxa_finalize (void *d);

extern int __posix_memalign (void **memptr, size_t alignment, size_t size);

extern void *__libc_memalign (size_t alignment, size_t size)
     __attribute__ ((__malloc__));

extern int __libc_system (const char *line);

extern double ____strtod_l_internal (__const char *__restrict __nptr,
         char **__restrict __endptr, int __group,
         __locale_t __loc) __attribute__ ((__nothrow__));
extern float ____strtof_l_internal (__const char *__restrict __nptr,
        char **__restrict __endptr, int __group,
        __locale_t __loc) __attribute__ ((__nothrow__));
extern long double ____strtold_l_internal (__const char *__restrict __nptr,
        char **__restrict __endptr,
        int __group, __locale_t __loc)
      __attribute__ ((__nothrow__));
extern long int ____strtol_l_internal (__const char *__restrict __nptr,
           char **__restrict __endptr,
           int __base, int __group,
           __locale_t __loc) __attribute__ ((__nothrow__));
extern unsigned long int ____strtoul_l_internal (__const char *
       __restrict __nptr,
       char **__restrict __endptr,
       int __base, int __group,
       __locale_t __loc) __attribute__ ((__nothrow__));
__extension__
extern long long int ____strtoll_l_internal (__const char *__restrict __nptr,
          char **__restrict __endptr,
          int __base, int __group,
          __locale_t __loc) __attribute__ ((__nothrow__));
__extension__
extern unsigned long long int ____strtoull_l_internal (__const char *
             __restrict __nptr,
             char **
             __restrict __endptr,
             int __base, int __group,
             __locale_t __loc)
     __attribute__ ((__nothrow__));

extern __typeof (____strtof_l_internal) ____strtof_l_internal __asm__ ("" "__GI_____strtof_l_internal") __attribute__ ((visibility ("hidden")));
extern __typeof (____strtod_l_internal) ____strtod_l_internal __asm__ ("" "__GI_____strtod_l_internal") __attribute__ ((visibility ("hidden")));
extern __typeof (____strtold_l_internal) ____strtold_l_internal __asm__ ("" "__GI_____strtold_l_internal") __attribute__ ((visibility ("hidden")));
extern __typeof (____strtol_l_internal) ____strtol_l_internal __asm__ ("" "__GI_____strtol_l_internal") __attribute__ ((visibility ("hidden")));
extern __typeof (____strtoll_l_internal) ____strtoll_l_internal __asm__ ("" "__GI_____strtoll_l_internal") __attribute__ ((visibility ("hidden")));
extern __typeof (____strtoul_l_internal) ____strtoul_l_internal __asm__ ("" "__GI_____strtoul_l_internal") __attribute__ ((visibility ("hidden")));
extern __typeof (____strtoull_l_internal) ____strtoull_l_internal __asm__ ("" "__GI_____strtoull_l_internal") __attribute__ ((visibility ("hidden")));

extern __inline double
__attribute__ ((__nothrow__)) __strtod_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc)

{
  return ____strtod_l_internal (__nptr, __endptr, 0, __loc);
}
extern __inline long int
__attribute__ ((__nothrow__)) __strtol_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc)

{
  return ____strtol_l_internal (__nptr, __endptr, __base, 0, __loc);
}
extern __inline unsigned long int
__attribute__ ((__nothrow__)) __strtoul_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc)

{
  return ____strtoul_l_internal (__nptr, __endptr, __base, 0, __loc);
}
extern __inline float
__attribute__ ((__nothrow__)) __strtof_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc)

{
  return ____strtof_l_internal (__nptr, __endptr, 0, __loc);
}
extern __inline long double
__attribute__ ((__nothrow__)) __strtold_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc)

{
  return ____strtold_l_internal (__nptr, __endptr, 0, __loc);
}
__extension__ extern __inline long long int
__attribute__ ((__nothrow__)) __strtoll_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc)

{
  return ____strtoll_l_internal (__nptr, __endptr, __base, 0, __loc);
}
__extension__ extern __inline unsigned long long int
__attribute__ ((__nothrow__)) __strtoull_l (__const char * __restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc)

{
  return ____strtoull_l_internal (__nptr, __endptr, __base, 0, __loc);
}
# 199 "../include/stdlib.h"
extern void * __default_morecore (ptrdiff_t);
extern __typeof (__default_morecore) __default_morecore __asm__ ("" "__GI___default_morecore") __attribute__ ((visibility ("hidden")));
# 23 "../sysdeps/wordsize-32/divdi3.c" 2
# 1 "../sysdeps/wordsize-32/bits/wordsize.h" 1
# 24 "../sysdeps/wordsize-32/divdi3.c" 2





typedef unsigned int UQItype __attribute__ ((mode (QI)));
typedef int SItype __attribute__ ((mode (SI)));
typedef unsigned int USItype __attribute__ ((mode (SI)));
typedef int DItype __attribute__ ((mode (DI)));
typedef unsigned int UDItype __attribute__ ((mode (DI)));
# 42 "../sysdeps/wordsize-32/divdi3.c"
# 1 "../stdlib/longlong.h" 1
# 1295 "../stdlib/longlong.h"
extern const UQItype __clz_tab[];
# 43 "../sysdeps/wordsize-32/divdi3.c" 2




struct DWstruct { SItype low, high;};



typedef union { struct DWstruct s; DItype ll; } DWunion;


extern DItype __divdi3 (DItype u, DItype v);
extern DItype __moddi3 (DItype u, DItype v);
extern UDItype __udivdi3 (UDItype u, UDItype v);
extern UDItype __umoddi3 (UDItype u, UDItype v);

static UDItype
__udivmoddi4 (UDItype n, UDItype d, UDItype *rp)
{
  DWunion ww;
  DWunion nn, dd;
  DWunion rr;
  USItype d0, d1, n0, n1, n2;
  USItype q0, q1;
  USItype b, bm;

  nn.ll = n;
  dd.ll = d;

  d0 = dd.s.low;
  d1 = dd.s.high;
  n0 = nn.s.low;
  n1 = nn.s.high;
# 112 "../sysdeps/wordsize-32/divdi3.c"
  if (d1 == 0)
    {
      if (d0 > n1)
 {


   do { USItype __xr = (d0); USItype __a; if (32 <= 32) { __a = __xr < ((USItype)1<<2*(32 / 4)) ? (__xr < ((USItype)1<<(32 / 4)) ? 0 : (32 / 4)) : (__xr < ((USItype)1<<3*(32 / 4)) ? 2*(32 / 4) : 3*(32 / 4)); } else { for (__a = 32 - 8; __a > 0; __a -= 8) if (((__xr >> __a) & 0xff) != 0) break; } (bm) = 32 - (__clz_tab[__xr >> __a] + __a); } while (0);

   if (bm != 0)
     {



       d0 = d0 << bm;
       n1 = (n1 << bm) | (n0 >> (32 - bm));
       n0 = n0 << bm;
     }

   do { USItype __d1, __d0, __q1, __q0; USItype __r1, __r0, __m; __d1 = ((USItype) (d0) >> (32 / 2)); __d0 = ((USItype) (d0) & (((USItype) 1 << (32 / 2)) - 1)); __r1 = (n1) % __d1; __q1 = (n1) / __d1; __m = (USItype) __q1 * __d0; __r1 = __r1 * ((USItype) 1 << (32 / 2)) | ((USItype) (n0) >> (32 / 2)); if (__r1 < __m) { __q1--, __r1 += (d0); if (__r1 >= (d0)) if (__r1 < __m) __q1--, __r1 += (d0); } __r1 -= __m; __r0 = __r1 % __d1; __q0 = __r1 / __d1; __m = (USItype) __q0 * __d0; __r0 = __r0 * ((USItype) 1 << (32 / 2)) | ((USItype) (n0) & (((USItype) 1 << (32 / 2)) - 1)); if (__r0 < __m) { __q0--, __r0 += (d0); if (__r0 >= (d0)) if (__r0 < __m) __q0--, __r0 += (d0); } __r0 -= __m; (q0) = (USItype) __q1 * ((USItype) 1 << (32 / 2)) | __q0; (n0) = __r0; } while (0);
   q1 = 0;


 }
      else
 {


   if (d0 == 0)
     d0 = 1 / d0;

   do { USItype __xr = (d0); USItype __a; if (32 <= 32) { __a = __xr < ((USItype)1<<2*(32 / 4)) ? (__xr < ((USItype)1<<(32 / 4)) ? 0 : (32 / 4)) : (__xr < ((USItype)1<<3*(32 / 4)) ? 2*(32 / 4) : 3*(32 / 4)); } else { for (__a = 32 - 8; __a > 0; __a -= 8) if (((__xr >> __a) & 0xff) != 0) break; } (bm) = 32 - (__clz_tab[__xr >> __a] + __a); } while (0);

   if (bm == 0)
     {







       n1 -= d0;
       q1 = 1;
     }
   else
     {


       b = 32 - bm;

       d0 = d0 << bm;
       n2 = n1 >> b;
       n1 = (n1 << bm) | (n0 >> b);
       n0 = n0 << bm;

       do { USItype __d1, __d0, __q1, __q0; USItype __r1, __r0, __m; __d1 = ((USItype) (d0) >> (32 / 2)); __d0 = ((USItype) (d0) & (((USItype) 1 << (32 / 2)) - 1)); __r1 = (n2) % __d1; __q1 = (n2) / __d1; __m = (USItype) __q1 * __d0; __r1 = __r1 * ((USItype) 1 << (32 / 2)) | ((USItype) (n1) >> (32 / 2)); if (__r1 < __m) { __q1--, __
Reply | Threaded
Open this post in threaded view
|

PATCH: Fix sysdeps/wordsize-32/symbol-hacks.h for new gas

H.J. Lu-27
On Tue, Nov 08, 2005 at 11:00:47AM -0800, Khem Raj wrote:
> Hi Alexandre
>
> This will cause glibc build failure. I am attaching the preprocessed
> sourcefile from glibc which
> shows this problem. It comes from some equates defined in glibc
> sysdeps/wordsize-32/symbol-hacks.c
>

I think it is a glibc bug. It has

        __divdi3 = __divdi3_internal
        ...
__divdi3:

The new assembler rejects it.


H.J.
----
2005-11-08  H.J. Lu  <[hidden email]>

        * sysdeps/wordsize-32/Makefile (CPPFLAGS-divdi3.c): Set to
        -Din_divdi3_c

        * sysdeps/wordsize-32/symbol-hacks.h: Skip if in_divdi3_c is
        defined.

--- sysdeps/wordsize-32/Makefile.as 2002-09-18 23:47:56.000000000 -0700
+++ sysdeps/wordsize-32/Makefile 2005-11-07 15:13:38.000000000 -0800
@@ -2,5 +2,6 @@ ifeq ($(subdir),csu)
 ifeq (yes,$(build-shared))
 sysdep_routines += divdi3
 shared-only-routines += divdi3
+CPPFLAGS-divdi3.c = -Din_divdi3_c
 endif
 endif
--- sysdeps/wordsize-32/symbol-hacks.h.as 2004-03-08 12:59:34.000000000 -0800
+++ sysdeps/wordsize-32/symbol-hacks.h 2005-11-07 14:57:49.000000000 -0800
@@ -22,7 +22,7 @@
    therefore we get PLTs.  Unnecessarily so.  Changing gcc is a big
    task which might not be worth it so we play tricks with the
    assembler.  */
-#if !defined __ASSEMBLER__ && !defined NOT_IN_libc && defined SHARED
+#if !defined __ASSEMBLER__ && !defined in_divdi3_c && !defined NOT_IN_libc && defined SHARED
 asm ("__divdi3 = __divdi3_internal");
 asm ("__udivdi3 = __udivdi3_internal");
 asm ("__moddi3 = __moddi3_internal");
Reply | Threaded
Open this post in threaded view
|

Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Jan Beulich
In reply to this post by Alexandre Oliva-2
Indeed, the tests added are too simple. Equates produced by .equ/.set/=
are re-definable, only those produced by .equiv/.eqv aren't. I would
hope to get to try to fix this today or tomorrow. Jan

>>> Khem Raj <[hidden email]> 08.11.05 20:00:47 >>>
Hi Alexandre

This will cause glibc build failure. I am attaching the preprocessed
sourcefile from glibc which
shows this problem. It comes from some equates defined in glibc
sysdeps/wordsize-32/symbol-hacks.c

Thanks

Khem


Alexandre Oliva wrote:

>On Nov  4, 2005, "Jan Beulich" <[hidden email]> wrote:
>
>  
>
>>Finally, Alexandre promised to address the problems (attached,
>>unfortunately not copied to the list), which is why I didn't spend
>>any time on addressing these (not to mention that I didn't really
>>have time to do so).  Meanwhile I suggest the following (probably I
>>could even consider this obvious and don't wait for approval...):
>>    
>>
>
>Yeah, sorry that it took me so long to get back to this.  Funny that
>I'd start working on the patch before even seeing this exchange of
>yours.  I had to update my source tree and re-create my patch such
>that it would apply after your check in :-)
>
>There's one bit I'm confused about.  It seems to be that, after your
>patch to flag redefinitions, we'd still accept:
>
>.set a, b
>a:
>
>although I'd think this should be rejected, just like other
>redefinitions, no?  I've included the change to reject this (and
>similar redefinitions of weakrefs) in my patch, which I'm checking in
>as obvious, although I'm a bit concerned that this one change is not
>entirely obvious, so if anyone disagrees with it, feel free to revert
>the bit in symbols.c to get it back in shape.
>
>Jan, I couldn't quite figure out the meaning of volatile and
>forward_ref, that I believe were introduced in your patch (I don't
>recall having seen them before).  Would you please document them in
>gas/doc, like the other fields and accessor functions?
>
>Tested on amd64-linux-gnu.  Checking in...
>
>  
>
>------------------------------------------------------------------------
>
>Index: gas/ChangeLog
>from  Alexandre Oliva  <[hidden email]>
>
> * read.c (s_weakref): Do not permit redefinitions.
> * symbols.c (colon): Do not permit redefinitions of equated
> symbols.
>
>Index: gas/read.c
>===================================================================
>RCS file: /cvs/src/src/gas/read.c,v
>retrieving revision 1.111
>diff -u -p -r1.111 read.c
>--- gas/read.c 27 Oct 2005 07:40:07 -0000 1.111
>+++ gas/read.c 4 Nov 2005 19:36:10 -0000
>@@ -3178,6 +3178,14 @@ s_weakref (int ignore ATTRIBUTE_UNUSED)
>
>   symbolP = symbol_find_or_make (name);
>
>+  if (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
>+    {
>+      as_bad (_("symbol `%s' is already defined"), name);
>+      *end_name = delim;
>+      ignore_rest_of_line ();
>+      return;
>+    }
>+
>   *end_name = delim;
>
>   SKIP_WHITESPACE ();
>Index: gas/symbols.c
>===================================================================
>RCS file: /cvs/src/src/gas/symbols.c,v
>retrieving revision 1.68
>diff -u -p -r1.68 symbols.c
>--- gas/symbols.c 27 Oct 2005 07:40:07 -0000 1.68
>+++ gas/symbols.c 4 Nov 2005 19:36:12 -0000
>@@ -332,7 +332,8 @@ colon (/* Just seen "x:" - rattle symbol
>  local_symbol_set_frag (locsym, frag_now);
>  locsym->lsy_value = frag_now_fix ();
> }
>-      else if (!S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP))
>+      else if (!(S_IS_DEFINED (symbolP) || symbol_equated_p
(symbolP))

>+       || S_IS_COMMON (symbolP))
> {
>  if (S_GET_VALUE (symbolP) == 0)
>    {
>Index: gas/testsuite/ChangeLog
>from  Alexandre Oliva  <[hidden email]>
>
> * gas/all/gas.exp: Remove weakref xfail.  Run weakref4.s.
> * gas/all/weakref1.s: Move redefinition bits to...
> * gas/all/weakref4.s: ... new file.
> * gas/all/weakref1.d: Remove command moved to weakref1u.
Adjust

> remaining command for leading tabs.  Regenerate.
> * gas/all/weakref1l.d: Regenerate.
> * gas/all/weakref1u.d: Likewise.
> * gas/all/wealref1w.d: Likewise.
>
>Index: gas/testsuite/gas/all/gas.exp
>===================================================================
>RCS file: /cvs/src/src/gas/testsuite/gas/all/gas.exp,v
>retrieving revision 1.35
>diff -u -p -r1.35 gas.exp
>--- gas/testsuite/gas/all/gas.exp 4 Nov 2005 13:25:59 -0000 1.35
>+++ gas/testsuite/gas/all/gas.exp 4 Nov 2005 19:36:19 -0000
>@@ -256,20 +256,16 @@ if { ![istarget "i960-*-*"] } {
> case $target_triplet in {
>     { z80-*-* } { }
>     default {
>- setup_xfail *-*-*
> run_dump_test weakref1
>- setup_xfail *-*-*
> run_dump_test weakref1g
>- setup_xfail *-*-*
> run_dump_test weakref1l
>- setup_xfail *-*-*
> run_dump_test weakref1u
>- setup_xfail *-*-*
> run_dump_test weakref1w
>     }
> }
> gas_test_error "weakref2.s" "" "e: would close weakref loop: e => a
=> b => c => d => e"
> gas_test_error "weakref3.s" "" "a: would close weakref loop: a => b
=> c => d => e => a"

>+gas_test_error "weakref4.s" "" "is already defined"
>
> load_lib gas-dg.exp
> dg-init
>Index: gas/testsuite/gas/all/weakref1.d
>===================================================================
>RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1.d,v
>retrieving revision 1.1
>diff -u -p -r1.1 weakref1.d
>--- gas/testsuite/gas/all/weakref1.d 24 Oct 2005 17:51:42 -0000 1.1
>+++ gas/testsuite/gas/all/weakref1.d 4 Nov 2005 19:36:19 -0000
>@@ -11,9 +11,7 @@ OFFSET +TYPE +VALUE *
> # the rest of this file is generated with the following script:
> # # script begin
> # echo \#...
>-# sed -n 's:^\.weakref .*, \(\(u\|\(w\)\).*\)$:.*( \3 |\(sec  0\)).*
\1:p' weakref1.s | uniq | while read line; do echo "$line"; echo "#...";
done
>-
>-# sed -n 's:^\.long \(W\|\)\(.*[^a-z]\)[a-z]*\(\| - .*\)$:\2:p'
weakref1.s | sed -e 's,^[lg].*,(&|\\.text)(\\+0x[0-9a-f]+)?,' | sed
's,^,[0-9a-f]+ [^ ]*  +,'
>+# sed -n 's:^[ ]*\.long \(W\|\)\(.*[^a-z]\)[a-z]*\(\| -
.*\)$:\2:p' weakref1.s | sed -e
's,^[lg].*,(&|\\.text)(\\+0x[0-9a-f]+)?,' | sed 's,^,[0-9a-f]+ [^ ]*
+,'

> # # script output:
> #...
> [0-9a-f]+ [^ ]*  +wa1
>@@ -71,8 +69,6 @@ OFFSET +TYPE +VALUE *
> [0-9a-f]+ [^ ]*  +ww9
> [0-9a-f]+ [^ ]*  +ww10
> [0-9a-f]+ [^ ]*  +ww10
>-[0-9a-f]+ [^ ]*  +um2
>-[0-9a-f]+ [^ ]*  +wm3
> [0-9a-f]+ [^ ]*  +um5
> [0-9a-f]+ [^ ]*  +wm6
> [0-9a-f]+ [^ ]*  +wm7
>@@ -87,18 +83,6 @@ OFFSET +TYPE +VALUE *
> [0-9a-f]+ [^ ]*  +uh8
> [0-9a-f]+ [^ ]*  +uh9
> [0-9a-f]+ [^ ]*  +uh9
>-[0-9a-f]+ [^ ]*  +(lr1|\.text)(\+0x[0-9a-f]+)?
>-[0-9a-f]+ [^ ]*  +(lr1|\.text)(\+0x[0-9a-f]+)?
>-[0-9a-f]+ [^ ]*  +(lr2|\.text)(\+0x[0-9a-f]+)?
>-[0-9a-f]+ [^ ]*  +(lr2|\.text)(\+0x[0-9a-f]+)?
>-[0-9a-f]+ [^ ]*  +wr3
>-[0-9a-f]+ [^ ]*  +wr3
>-[0-9a-f]+ [^ ]*  +wr4
>-[0-9a-f]+ [^ ]*  +wr5
>-[0-9a-f]+ [^ ]*  +(lr6|\.text)(\+0x[0-9a-f]+)?
>-[0-9a-f]+ [^ ]*  +ur6
>-[0-9a-f]+ [^ ]*  +(lr7|\.text)(\+0x[0-9a-f]+)?
>-[0-9a-f]+ [^ ]*  +(lr7|\.text)(\+0x[0-9a-f]+)?
> [0-9a-f]+ [^ ]*  +(ld1|\.text)(\+0x[0-9a-f]+)?
> [0-9a-f]+ [^ ]*  +(ld2|\.text)(\+0x[0-9a-f]+)?
> [0-9a-f]+ [^ ]*  +(ld3|\.text)(\+0x[0-9a-f]+)?
>Index: gas/testsuite/gas/all/weakref1.s
>===================================================================
>RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1.s,v
>retrieving revision 1.1
>diff -u -p -r1.1 weakref1.s
>--- gas/testsuite/gas/all/weakref1.s 24 Oct 2005 17:51:42 -0000 1.1
>+++ gas/testsuite/gas/all/weakref1.s 4 Nov 2005 19:36:19 -0000
>@@ -126,17 +126,6 @@ l:
> .weak ww10
>
> /* m# test multiple weakrefs */
>- .weakref Wnm1, nm1
>- .weakref Wnm1, nm1
>-
>- .weakref Wum2, um2
>- .weakref Wum2, um2
>- .long um2
>-
>- .weakref Wwm3, wm3
>- .weakref Wwm3, wm3
>- .long Wwm3
>-
> .weakref Wnm4a, nm4
> .weakref Wnm4b, nm4
>
>@@ -197,40 +186,6 @@ l:
> .weakref Wuh9a, uh9
> .long uh9
>
>-/* r# weakref redefinitions, to and from */
>- .weakref lr1, nr1
>- .long lr1
>- .set lr1, l
>- .long lr1
>-
>- .long lr2
>- .weakref lr2, nr2
>- .set lr2, l
>- .long lr2
>-
>- .set Wwr3, l
>- .long Wwr3
>- .weakref Wwr3, wr3
>- .long Wwr3
>-
>- .set Wwr4, l
>- .weakref Wwr4, wr4
>- .long Wwr4
>-
>- .set Wwr5, l
>- .long Wwr5
>- .weakref Wwr5, wr5
>-
>- .weakref lr6, ur6
>- .long lr6
>- .set lr6, l
>- .long ur6
>-
>- .weakref lr7, nr7
>- .long lr7
>-lr7:
>- .long lr7
>-
> /* d# target symbol definitions */
> .weakref Wld1, ld1
> .long Wld1
>Index: gas/testsuite/gas/all/weakref1l.d
>===================================================================
>RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1l.d,v
>retrieving revision 1.1
>diff -u -p -r1.1 weakref1l.d
>--- gas/testsuite/gas/all/weakref1l.d 24 Oct 2005 17:51:42 -0000 1.1
>+++ gas/testsuite/gas/all/weakref1l.d 4 Nov 2005 19:36:19 -0000
>@@ -13,14 +13,6 @@
> #...
> .* t l
> #...
>-.* t lr1
>-#...
>-.* t lr2
>-#...
>-.* t lr6
>-#...
>-.* t lr7
>-#...
> .* t ld1
> #...
> .* t ld2
>Index: gas/testsuite/gas/all/weakref1u.d
>===================================================================
>RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1u.d,v
>retrieving revision 1.1
>diff -u -p -r1.1 weakref1u.d
>--- gas/testsuite/gas/all/weakref1u.d 24 Oct 2005 17:51:42 -0000 1.1
>+++ gas/testsuite/gas/all/weakref1u.d 4 Nov 2005 19:36:19 -0000
>@@ -39,15 +39,11 @@
> #...
> .* U uc9
> #...
>-.* U um2
>-#...
> .* U um5
> #...
> .* U uh8
> #...
> .* U uh9
> #...
>-.* U ur6
>-#...
> .* U ud5
> #pass
>Index: gas/testsuite/gas/all/weakref1w.d
>===================================================================
>RCS file: /cvs/src/src/gas/testsuite/gas/all/weakref1w.d,v
>retrieving revision 1.1
>diff -u -p -r1.1 weakref1w.d
>--- gas/testsuite/gas/all/weakref1w.d 24 Oct 2005 17:51:42 -0000 1.1
>+++ gas/testsuite/gas/all/weakref1w.d 4 Nov 2005 19:36:19 -0000
>@@ -36,8 +36,6 @@
> #...
> .* w ww10
> #...
>-.* w wm3
>-#...
> .* w wm6
> #...
> .* w wm7
>@@ -55,10 +53,4 @@
> .* w wh6
> #...
> .* w wh7
>-#...
>-.* w wr3
>-#...
>-.* w wr4
>-#...
>-.* w wr5
> #pass
>Index: gas/testsuite/gas/all/weakref4.s
>===================================================================
>RCS file: gas/testsuite/gas/all/weakref4.s
>diff -N gas/testsuite/gas/all/weakref4.s
>--- /dev/null 1 Jan 1970 00:00:00 -0000
>+++ gas/testsuite/gas/all/weakref4.s 4 Nov 2005 19:36:19 -0000
>@@ -0,0 +1,45 @@
>+/* m# test multiple weakrefs */
>+ .weakref Wnm1, nm1
>+ .weakref Wnm1, nm1
>+
>+ .weakref Wum2, um2
>+ .weakref Wum2, um2
>+ .long um2
>+
>+ .weakref Wwm3, wm3
>+ .weakref Wwm3, wm3
>+ .long Wwm3
>+
>+/* r# weakref redefinitions, to and from */
>+ .weakref lr1, nr1
>+ .long lr1
>+ .set lr1, l
>+ .long lr1
>+
>+ .long lr2
>+ .weakref lr2, nr2
>+ .set lr2, l
>+ .long lr2
>+
>+ .set Wwr3, l
>+ .long Wwr3
>+ .weakref Wwr3, wr3
>+ .long Wwr3
>+
>+ .set Wwr4, l
>+ .weakref Wwr4, wr4
>+ .long Wwr4
>+
>+ .set Wwr5, l
>+ .long Wwr5
>+ .weakref Wwr5, wr5
>+
>+ .weakref lr6, ur6
>+ .long lr6
>+ .set lr6, l
>+ .long ur6
>+
>+ .weakref lr7, nr7
>+ .long lr7
>+lr7:
>+ .long lr7
>  
>
>------------------------------------------------------------------------
>
>
>  
>

--
Khem Raj <[hidden email]>
MontaVista Software, Inc.
www.mvista.com

Reply | Threaded
Open this post in threaded view
|

[PATCH] Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Jan Beulich
In reply to this post by Alexandre Oliva-2
>>> Khem Raj <[hidden email]> 08.11.05 20:00:47 >>>
>This will cause glibc build failure. I am attaching the preprocessed
>sourcefile from glibc which
>shows this problem. It comes from some equates defined in glibc
>sysdeps/wordsize-32/symbol-hacks.c

This patch eliminates the problem, and addresses several other similar
ones:
- re-defining a re-definable symbol to a persistent one now properly
  clears the re-definable state
- .ifdef now also recognizes equates to undefined symbols as well as
  common symbols
- definition of weakrefs and commons now properly check whether the
  to-be-defined symbol was already defined
- definitions of labels, commons, and weakrefs now properly clone pre-
  existing re-definable symbols
Additionally, it adds documentation for previously added fields/
functions.

Built and tested on i686-pc-linux-gnu, x86_64-unknown-linux-gnu,
ia64-unknown-linux-gnu, and for a large number of cross targets.

Jan

gas/
2005-11-14  Jan Beulich  <[hidden email]>


        * symbols.h (S_CLEAR_VOLATILE): Declare.
        * symbols.c (colon): Also accept redefinable symbols for
        redefinition. Clone them before modifying.
        (S_CLEAR_VOLATILE): Define.
        * cond.c (s_ifdef): Also test for equated and common symbols.
        * read.c (s_comm_internal): Also exclude non-redefinable
        equated symbols. Clone redefinable ones before modifying.
        (assign_symbol): Also exclude common symbols from
        redefinition.
        (s_weakref): Likewise. Clone redefinable symbols before
        modifying.
        * doc/internals.texi: Document sy_volatile, sy_forward_ref,
        S_IS_VOLATILE, S_SET_VOLATILE, S_CLEAR_VOLATILE,
        S_IS_FORWARD_REF, and S_SET_FORWARD_REF.

gas/testsuite/
2005-11-14  Jan Beulich  <[hidden email]>

        * gas/all/cond.s: Also check ifdef works on equates and
        commons.
        * gas/all/cond.l: Adjust.
        * gas/all/redef2.s: Also test redefining equate to label.
        * gas/all/redef2.d: Adjust.
        * gas/all/redef3.[sd]: New.
        * gas/all/redef4.s: New.
        * gas/all/redef5.s: New.
        * gas/elf/redef.s: New, copied from original gas/all/redef2.s.
        * gas/elf/redef.d: Remove #source.
        * gas/all/gas.exp: Remove exclusion of iq2000-*-* from and
        adjust xfails for redefinition tests. Run new tests. Exclude
        alpha*-*-*, mips*-*-*, *c54x*-*-* from weakref tests.

---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/cond.c 2005-10-11
14:31:18.000000000 +0200
+++ 2005-11-09/gas/cond.c 2005-11-11 13:48:42.000000000 +0100
@@ -102,7 +102,9 @@ s_ifdef (int test_defined)
  considered to be undefined.  */
       is_defined =
  symbolP != NULL
- && S_IS_DEFINED (symbolP)
+ && (S_IS_DEFINED (symbolP)
+    || symbol_equated_p (symbolP)
+    || S_GET_VALUE (symbolP))
  && S_GET_SEGMENT (symbolP) != reg_section;
 
       cframe.ignoring = ! (test_defined ^ is_defined);
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/doc/internals.texi 2005-10-26
14:26:28.000000000 +0200
+++ 2005-11-09/gas/doc/internals.texi 2005-11-10 11:20:47.000000000
+0100
@@ -93,6 +93,12 @@ responsible for setting it when a symbol
 Whether the symbol is an MRI common symbol created by the
@code{COMMON}
 pseudo-op when assembling in MRI mode.
 
+@item sy_volatile
+Whether the symbol can be re-defined.
+
+@item sy_forward_ref
+Whether the symbol's value must only be evaluated upon use.
+
 @item sy_weakrefr
 Whether the symbol is a @code{weakref} alias to another symbol.
 
@@ -165,6 +171,16 @@ Return non-zero if the symbol is a @code
 Return non-zero if the symbol was aliased by a @code{weakref} alias
and has not
 had any strong references.
 
+@item S_IS_VOLATILE
+@cindex S_IS_VOLATILE
+Return non-zero if the symbol may be re-defined. Such symbols get
created by
+the @code{=} operator, @code{equ}, or @code{set}.
+
+@item S_IS_FORWARD_REF
+@cindex S_IS_FORWARD_REF
+Return non-zero if the symbol is a forward reference, that is its
value must
+only be determined upon use.
+
 @item S_IS_COMMON
 @cindex S_IS_COMMON
 Return non-zero if this is a common symbol.  Common symbols are
sometimes
@@ -222,6 +238,19 @@ Clear the @code{weakref} aliased status
 whenever the symbol is looked up, as part of a direct reference or a
 definition, but not as part of a @code{weakref} directive.
 
+@item S_SET_VOLATILE
+@cindex S_SET_VOLATILE
+Indicate that the symbol may be re-defined.
+
+@item S_CLEAR_VOLATILE
+@cindex S_CLEAR_VOLATILE
+Indicate that the symbol may no longer be re-defined.
+
+@item S_SET_FORWARD_REF
+@cindex S_SET_FORWARD_REF
+Indicate that the symbol is a forward reference, that is its value
must only
+be determined upon use.
+
 @item S_GET_TYPE
 @item S_GET_DESC
 @item S_GET_OTHER
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/read.c 2005-11-07
08:48:26.000000000 +0100
+++ 2005-11-09/gas/read.c 2005-11-11 16:32:52.000000000 +0100
@@ -1467,13 +1467,25 @@ s_comm_internal (int param,
 
   *p = 0;
   symbolP = symbol_find_or_make (name);
-  if (S_IS_DEFINED (symbolP) && !S_IS_COMMON (symbolP))
+  if ((S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
+      && !S_IS_COMMON (symbolP))
     {
-      symbolP = NULL;
-      as_bad (_("symbol `%s' is already defined"), name);
-      *p = c;
-      ignore_rest_of_line ();
-      goto out;
+      if (!S_IS_VOLATILE (symbolP))
+ {
+  symbolP = NULL;
+  as_bad (_("symbol `%s' is already defined"), name);
+  *p = c;
+  ignore_rest_of_line ();
+  goto out;
+ }
+      /* This could be avoided when the symbol wasn't used so far,
but
+ the comment in struc-symbol.h says this flag isn't reliable.
*/
+      if (1 || !symbol_used_p (symbolP))
+ symbolP = symbol_clone (symbolP, 1);
+      S_SET_SEGMENT (symbolP, undefined_section);
+      S_SET_VALUE (symbolP, 0);
+      symbol_set_frag (symbolP, &zero_address_frag);
+      S_CLEAR_VOLATILE (symbolP);
     }
 
   size = S_GET_VALUE (symbolP);
@@ -2794,7 +2806,11 @@ assign_symbol (char *name, int mode)
 #endif
     }
 
-  if (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
+  if (S_IS_DEFINED (symbolP)
+      || symbol_equated_p (symbolP)
+      /* This detects common symbols not put in bfd_com_section,
which
+ S_IS_COMMON doesn't recognize.  */
+      || S_GET_VALUE (symbolP))
     {
       /* Permit register names to be redefined.  */
       if ((mode != 0 || !S_IS_VOLATILE (symbolP))
@@ -3178,12 +3194,22 @@ s_weakref (int ignore ATTRIBUTE_UNUSED)
 
   symbolP = symbol_find_or_make (name);
 
-  if (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
+  if (S_IS_DEFINED (symbolP)
+      || symbol_equated_p (symbolP)
+      || S_GET_VALUE (symbolP))
     {
-      as_bad (_("symbol `%s' is already defined"), name);
-      *end_name = delim;
-      ignore_rest_of_line ();
-      return;
+      if(!S_IS_VOLATILE (symbolP))
+ {
+  as_bad (_("symbol `%s' is already defined"), name);
+  *end_name = delim;
+  ignore_rest_of_line ();
+  return;
+ }
+      /* This could be avoided when the symbol wasn't used so far,
but
+ the comment in struc-symbol.h says this flag isn't reliable.
*/
+      if (1 || !symbol_used_p (symbolP))
+ symbolP = symbol_clone (symbolP, 1);
+      S_CLEAR_VOLATILE (symbolP);
     }
 
   *end_name = delim;
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/symbols.c 2005-11-07
08:48:26.000000000 +0100
+++ 2005-11-09/gas/symbols.c 2005-11-10 12:18:53.000000000 +0100
@@ -333,8 +333,18 @@ colon (/* Just seen "x:" - rattle symbol
   locsym->lsy_value = frag_now_fix ();
  }
       else if (!(S_IS_DEFINED (symbolP) || symbol_equated_p
(symbolP))
-       || S_IS_COMMON (symbolP))
+       || S_IS_COMMON (symbolP)
+       || S_IS_VOLATILE (symbolP))
  {
+  if (S_IS_VOLATILE (symbolP)
+      /* This could be avoided when the symbol wasn't used so
far, but
+ the comment in struc-symbol.h says this flag isn't
reliable.  */
+      && (1 || !symbol_used_p (symbolP)))
+    {
+      symbolP = symbol_clone (symbolP, 1);
+      S_SET_VALUE (symbolP, 0);
+      S_CLEAR_VOLATILE (symbolP);
+    }
   if (S_GET_VALUE (symbolP) == 0)
     {
       symbolP->sy_frag = frag_now;
@@ -421,7 +431,10 @@ colon (/* Just seen "x:" - rattle symbol
   if (!(frag_now == symbolP->sy_frag
  && S_GET_VALUE (symbolP) == frag_now_fix ()
  && S_GET_SEGMENT (symbolP) == now_seg))
-    as_bad (_("symbol `%s' is already defined"), sym_name);
+    {
+      as_bad (_("symbol `%s' is already defined"), sym_name);
+      symbolP = symbol_clone (symbolP, 0);
+    }
  }
 
     }
@@ -2196,6 +2209,13 @@ S_SET_VOLATILE (symbolS *s)
 }
 
 void
+S_CLEAR_VOLATILE (symbolS *s)
+{
+  if (!LOCAL_SYMBOL_CHECK (s))
+    s->sy_volatile = 0;
+}
+
+void
 S_SET_FORWARD_REF (symbolS *s)
 {
   if (LOCAL_SYMBOL_CHECK (s))
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/symbols.h 2005-10-26
14:26:28.000000000 +0200
+++ 2005-11-09/gas/symbols.h 2005-11-10 10:53:51.000000000 +0100
@@ -108,6 +108,7 @@ extern void S_SET_WEAKREFD (symbolS *);
 extern void S_CLEAR_WEAKREFD (symbolS *);
 extern void S_SET_THREAD_LOCAL (symbolS *);
 extern void S_SET_VOLATILE (symbolS *);
+extern void S_CLEAR_VOLATILE (symbolS *);
 extern void S_SET_FORWARD_REF (symbolS *);
 
 #ifndef WORKING_DOT_WORD
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/all/cond.l 2005-10-11
13:16:17.000000000 +0200
+++ 2005-11-09/gas/testsuite/gas/all/cond.l 2005-11-11
13:44:02.000000000 +0100
@@ -24,7 +24,13 @@
   29[ ]+.else
   31[ ]+.endif
 [ ]*[1-9][0-9]*[ ]+
+[ ]*[1-9][0-9]*[ ]+\.comm[ ]+c,[ ]*1[ ]*
+[ ]*[1-9][0-9]*[ ]+\.ifndef[ ]+c[ ]*
+[ ]*[1-9][0-9]*[ ]+\.endif[ ]*
+[ ]*[1-9][0-9]*[ ]+
 [ ]*[1-9][0-9]*[ ]+\.equiv[ ]+x,[ ]*y[ ]*
+[ ]*[1-9][0-9]*[ ]+\.ifndef[ ]+x[ ]*
+[ ]*[1-9][0-9]*[ ]+\.endif[ ]*
 [ ]*[1-9][0-9]*[ ]+\.equiv[ ]+y,[ ]*0[ ]*
 [ ]*[1-9][0-9]*[ ]+\.if[ ]+x[ ]*
 [ ]*[1-9][0-9]*[ ]+\.elseif[ ]+x[ ]*
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/all/cond.s 2005-10-11
14:31:18.000000000 +0200
+++ 2005-11-09/gas/testsuite/gas/all/cond.s 2005-11-11
13:40:54.000000000 +0100
@@ -30,7 +30,15 @@
  .long 9
  .endif
 
+ .comm c, 1
+ .ifndef c
+ .err
+ .endif
+
  .equiv x, y
+ .ifndef x
+ .err
+ .endif
  .equiv y, 0
  .if x
  .err
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/all/gas.exp 2005-11-09
15:40:05.000000000 +0100
+++ 2005-11-09/gas/testsuite/gas/all/gas.exp 2005-11-11
16:22:14.000000000 +0100
@@ -74,16 +74,24 @@ case $target_triplet in {
 # .set works differently on some targets.
 case $target_triplet in {
     { alpha*-*-* } { }
-    { iq2000*-*-* } { }
     { mips*-*-* } { }
     { *c54x*-*-* } { }
     { z80-*-* } { }
     default {
  setup_xfail "*c30*-*-*" "*c4x*-*-*" "pdp11-*-*"
  run_dump_test redef
- setup_xfail "*c30*-*-*" "*c4x*-*-*" "*arm*-*-coff" "arm*-*-pe*"
"crx*-*-*"
- setup_xfail "h8300*-*-*" "m68hc*-*-*" "maxq-*-*" "pdp11-*-*"
"vax*-*-*" "z8k-*-*"
+ setup_xfail "*c30*-*-*" "*c4x*-*-*" "*arm*-*-*aout*"
"*arm*-*-*coff" \
+    "*arm*-*-pe" "crx*-*-*" "h8300*-*-*" "m68hc*-*-*" "maxq-*-*"
\
+    "pdp11-*-*" "vax*-*-*" "z8k-*-*"
  run_dump_test redef2
+ setup_xfail "*-*-aix*" "*-*-coff" "*-*-cygwin" "*-*-mingw*"
"*-*-pe*" \
+    "bfin-*-*" "*c4x*-*-*" "crx*-*-*" "h8300*-*-*" "m68hc*-*-*"
\
+    "maxq-*-*" "or32-*-*" "pdp11-*-*" "vax*-*-*" "z8k-*-*"
+ run_dump_test redef3
+ setup_xfail "*c4x*-*-*"
+ gas_test_error "redef4.s" "" ".set for symbol already used as
label"
+ setup_xfail "*c4x*-*-*"
+ gas_test_error "redef5.s" "" ".set for symbol already defined
through .comm"
     }
 }
 
@@ -256,6 +264,9 @@ if { ![istarget "i960-*-*"] } {
 
 # .set works differently on some targets.
 case $target_triplet in {
+    { alpha*-*-* } { }
+    { mips*-*-* } { }
+    { *c54x*-*-* } { }
     { z80-*-* } { }
     default {
  run_dump_test weakref1
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/all/redef2.d 2005-10-20
17:29:25.000000000 +0200
+++ 2005-11-09/gas/testsuite/gas/all/redef2.d 2005-11-10
17:27:22.000000000 +0100
@@ -5,9 +5,11 @@
 
 RELOCATION RECORDS FOR .*
 .*
-0+0.*(here|\.data)
-0+8.*xtrn
+0+00.*(here|\.data)
+0+08.*xtrn
+0+10.*(sym|\.data(\+0x0+10)?)
 #...
 Contents of section \.data:
  0000 00000000 11111111 00000000 22222222[ ]+................[
        ]*
+ 0010 [01]00000[01]0 .*
 #pass
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/all/redef2.s 2005-10-20
16:22:58.000000000 +0200
+++ 2005-11-09/gas/testsuite/gas/all/redef2.s 2005-11-10
10:43:48.000000000 +0100
@@ -8,3 +8,5 @@ here:
  .long sym
  .set sym, 0x22222222
  .long sym
+sym:
+ .long sym
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/all/redef3.d 1970-01-01
01:00:00.000000000 +0100
+++ 2005-11-09/gas/testsuite/gas/all/redef3.d 2005-11-11
09:48:35.000000000 +0100
@@ -0,0 +1,15 @@
+#objdump: -rsj .data
+#name: .equ redefinitions (3)
+
+.*: .*
+
+RELOCATION RECORDS FOR .*
+.*
+0+00.*(here|\.data)
+0+08.*xtrn
+0+10.*sym
+#...
+Contents of section \.data:
+ 0000 00000000 11111111 00000000 22222222[ ]+................[
        ]*
+ 0010 00000000 .*
+#pass
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/all/redef3.s 1970-01-01
01:00:00.000000000 +0100
+++ 2005-11-09/gas/testsuite/gas/all/redef3.s 2005-11-10
11:55:40.000000000 +0100
@@ -0,0 +1,12 @@
+ .data
+here:
+ .set sym, here
+ .long sym
+ .set sym, 0x11111111
+ .long sym
+ .set sym, xtrn
+ .long sym
+ .set sym, 0x22222222
+ .long sym
+ .comm sym, 1
+ .long sym
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/all/redef4.s 1970-01-01
01:00:00.000000000 +0100
+++ 2005-11-09/gas/testsuite/gas/all/redef4.s 2005-11-10
10:44:51.000000000 +0100
@@ -0,0 +1,3 @@
+ .data
+sym:
+ .set sym, 0
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/all/redef5.s 1970-01-01
01:00:00.000000000 +0100
+++ 2005-11-09/gas/testsuite/gas/all/redef5.s 2005-11-10
11:53:00.000000000 +0100
@@ -0,0 +1,2 @@
+ .comm sym, 1
+ .set sym, 0
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/elf/redef.d 2005-10-27
11:41:28.000000000 +0200
+++ 2005-11-09/gas/testsuite/gas/elf/redef.d 2005-11-10
11:08:19.000000000 +0100
@@ -1,6 +1,5 @@
 #objdump: -t
 #name: .equ redefinitions (ELF)
-#source: ../all/redef2.s
 
 .*: .*
 
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/elf/redef.s 1970-01-01
01:00:00.000000000 +0100
+++ 2005-11-09/gas/testsuite/gas/elf/redef.s 2005-11-10
11:07:10.000000000 +0100
@@ -0,0 +1,10 @@
+ .data
+here:
+ .set sym, here
+ .long sym
+ .set sym, 0x11111111
+ .long sym
+ .set sym, xtrn
+ .long sym
+ .set sym, 0x22222222
+ .long sym


binutils-mainline-equate-4.patch (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Alan Modra
On Mon, Nov 14, 2005 at 09:06:42AM +0100, Jan Beulich wrote:

> gas/
> 2005-11-14  Jan Beulich  <[hidden email]>
>
> * symbols.h (S_CLEAR_VOLATILE): Declare.
> * symbols.c (colon): Also accept redefinable symbols for
> redefinition. Clone them before modifying.
> (S_CLEAR_VOLATILE): Define.
> * cond.c (s_ifdef): Also test for equated and common symbols.
> * read.c (s_comm_internal): Also exclude non-redefinable
> equated symbols. Clone redefinable ones before modifying.
> (assign_symbol): Also exclude common symbols from
> redefinition.
> (s_weakref): Likewise. Clone redefinable symbols before
> modifying.
> * doc/internals.texi: Document sy_volatile, sy_forward_ref,
> S_IS_VOLATILE, S_SET_VOLATILE, S_CLEAR_VOLATILE,
> S_IS_FORWARD_REF, and S_SET_FORWARD_REF.
>
> gas/testsuite/
> 2005-11-14  Jan Beulich  <[hidden email]>
>
> * gas/all/cond.s: Also check ifdef works on equates and
> commons.
> * gas/all/cond.l: Adjust.
> * gas/all/redef2.s: Also test redefining equate to label.
> * gas/all/redef2.d: Adjust.
> * gas/all/redef3.[sd]: New.
> * gas/all/redef4.s: New.
> * gas/all/redef5.s: New.
> * gas/elf/redef.s: New, copied from original gas/all/redef2.s.
> * gas/elf/redef.d: Remove #source.
> * gas/all/gas.exp: Remove exclusion of iq2000-*-* from and
> adjust xfails for redefinition tests. Run new tests. Exclude
> alpha*-*-*, mips*-*-*, *c54x*-*-* from weakref tests.

OK, but

> - && S_IS_DEFINED (symbolP)
> + && (S_IS_DEFINED (symbolP)
> +    || symbol_equated_p (symbolP)
> +    || S_GET_VALUE (symbolP))

Please use S_IS_COMMON here rather than S_GET_VALUE,

> @@ -2794,7 +2806,11 @@ assign_symbol (char *name, int mode)
>  #endif
>      }
>  
> -  if (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
> +  if (S_IS_DEFINED (symbolP)
> +      || symbol_equated_p (symbolP)
> +      /* This detects common symbols not put in bfd_com_section, which
> + S_IS_COMMON doesn't recognize.  */
> +      || S_GET_VALUE (symbolP))

Same here.  If S_IS_COMMON doesn't work, we need to fix it.  I'll be
happy to review a followup patch.

> @@ -3178,12 +3194,22 @@ s_weakref (int ignore ATTRIBUTE_UNUSED)
>  
>    symbolP = symbol_find_or_make (name);
>  
> -  if (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
> +  if (S_IS_DEFINED (symbolP)
> +      || symbol_equated_p (symbolP)
> +      || S_GET_VALUE (symbolP))

Again.

--
Alan Modra
IBM OzLabs - Linux Technology Centre
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Jan Beulich
>Same here.  If S_IS_COMMON doesn't work, we need to fix it.  I'll be
>happy to review a followup patch.

So for a quick solution I'd prefer changing S_IS_COMMON then in the way
you outlined in the response to the '.comm symbol, 0' question - is that
OK for you? I don't think I feel certain to fix the other object formats
to properly set the section on common symbols (my main fear is they may
have hidden dependencies on that).

Also this means I'll hold back applying this patch to avoid introducing
testsuite failures.

Jan
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Re: Your gas changes caused weakref failures for cris-elf, supposedly others too

Alan Modra
On Tue, Nov 15, 2005 at 08:54:57AM +0100, Jan Beulich wrote:
> >Same here.  If S_IS_COMMON doesn't work, we need to fix it.  I'll be
> >happy to review a followup patch.
>
> So for a quick solution I'd prefer changing S_IS_COMMON then in the way
> you outlined in the response to the '.comm symbol, 0' question - is that
> OK for you? I don't think I feel certain to fix the other object formats

No, I much prefer to fix this properly.

> to properly set the section on common symbols (my main fear is they may
> have hidden dependencies on that).
>
> Also this means I'll hold back applying this patch to avoid introducing
> testsuite failures.

I think this is all we need.  Testing..

        * read.c (s_comm_internal): Set bfd_com_section segment.
        (s_mri_common): Likewise.

Index: gas/read.c
===================================================================
RCS file: /cvs/src/src/gas/read.c,v
retrieving revision 1.112
diff -u -p -r1.112 read.c
--- gas/read.c 4 Nov 2005 19:45:24 -0000 1.112
+++ gas/read.c 15 Nov 2005 08:50:07 -0000
@@ -1490,6 +1490,7 @@ s_comm_internal (int param,
     {
       S_SET_VALUE (symbolP, (valueT) size);
       S_SET_EXTERNAL (symbolP);
+      S_SET_SEGMENT (symbolP, bfd_com_section_ptr);
 #ifdef OBJ_VMS
       {
  extern int flag_one;
@@ -1583,6 +1584,7 @@ s_mri_common (int small ATTRIBUTE_UNUSED
     }
 
   S_SET_EXTERNAL (sym);
+  S_SET_SEGMENT (sym, bfd_com_section_ptr);
   mri_common_symbol = sym;
 
 #ifdef S_SET_ALIGN


--
Alan Modra
IBM OzLabs - Linux Technology Centre
Reply | Threaded
Open this post in threaded view
|

Set bfd_com_section on all common syms.

Alan Modra
On Tue, Nov 15, 2005 at 07:34:41PM +1030, Alan Modra wrote:
> * read.c (s_comm_internal): Set bfd_com_section segment.
> (s_mri_common): Likewise.

Committing, along with the following.

        * write.c (write_object_file): Remove non-BFD assembler common
        sym handling.

Index: gas/write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.97
diff -u -p -r1.97 write.c
--- gas/write.c 25 Oct 2005 14:07:44 -0000 1.97
+++ gas/write.c 15 Nov 2005 22:53:58 -0000
@@ -1493,12 +1493,6 @@ write_object_file (void)
       continue;
     }
 
-  /* So far, common symbols have been treated like undefined symbols.
-     Put them in the common section now.  */
-  if (S_IS_DEFINED (symp) == 0
-      && S_GET_VALUE (symp) != 0)
-    S_SET_SEGMENT (symp, bfd_com_section_ptr);
-
 #ifdef obj_frob_symbol
   obj_frob_symbol (symp, punt);
 #endif

--
Alan Modra
IBM OzLabs - Linux Technology Centre
Reply | Threaded
Open this post in threaded view
|

Re: Set bfd_com_section on all common syms.

Alan Modra
I missed some places that deal with common syms and need a segment
to be set.

        * config/tc-ppc.c (ppc_pe_comm): Set bfd_com_section segment.
        * config/tc-alpha.c (s_alpha_comm): Likewise.  Also, remove
        redundant check.
        * read.c (s_lsym): Remove non-BFD assembler sym handling.

Index: gas/config/tc-alpha.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-alpha.c,v
retrieving revision 1.70
diff -u -p -r1.70 tc-alpha.c
--- gas/config/tc-alpha.c 20 Sep 2005 18:24:45 -0000 1.70
+++ gas/config/tc-alpha.c 16 Nov 2005 01:37:55 -0000
@@ -3331,10 +3331,10 @@ s_alpha_comm (int ignore ATTRIBUTE_UNUSE
       subseg_set (new_seg, 0);
       p = frag_more (temp);
       new_seg->flags |= SEC_IS_COMMON;
-      if (! S_IS_DEFINED (symbolP))
- S_SET_SEGMENT (symbolP, new_seg);
+      S_SET_SEGMENT (symbolP, new_seg);
 #else
       S_SET_VALUE (symbolP, (valueT) temp);
+      S_SET_SEGMENT (symbolP, bfd_com_section_ptr);
 #endif
       S_SET_EXTERNAL (symbolP);
     }
Index: gas/config/tc-ppc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.c,v
retrieving revision 1.107
diff -u -p -r1.107 tc-ppc.c
--- gas/config/tc-ppc.c 20 Sep 2005 18:24:47 -0000 1.107
+++ gas/config/tc-ppc.c 16 Nov 2005 01:38:01 -0000
@@ -4416,6 +4416,7 @@ ppc_pe_comm (lcomm)
     {
       S_SET_VALUE (symbolP, (valueT) temp);
       S_SET_EXTERNAL (symbolP);
+      S_SET_SEGMENT (symbolP, bfd_com_section_ptr);
     }
 
   demand_empty_rest_of_line ();
Index: gas/read.c
===================================================================
RCS file: /cvs/src/src/gas/read.c,v
retrieving revision 1.113
diff -u -p -r1.113 read.c
--- gas/read.c 15 Nov 2005 22:58:38 -0000 1.113
+++ gas/read.c 16 Nov 2005 01:37:51 -0000
@@ -2235,15 +2235,7 @@ s_lsym (int ignore ATTRIBUTE_UNUSED)
   *p = 0;
   symbolP = symbol_find_or_make (name);
 
-  /* FIXME-SOON I pulled a (&& symbolP->sy_other == 0 &&
-     symbolP->sy_desc == 0) out of this test because coff doesn't have
-     those fields, and I can't see when they'd ever be tripped.  I
-     don't think I understand why they were here so I may have
-     introduced a bug. As recently as 1.37 didn't have this test
-     anyway.  xoxorich.  */
-
-  if (S_GET_SEGMENT (symbolP) == undefined_section
-      && S_GET_VALUE (symbolP) == 0)
+  if (S_GET_SEGMENT (symbolP) == undefined_section)
     {
       /* The name might be an undefined .global symbol; be sure to
  keep the "external" bit.  */

--
Alan Modra
IBM OzLabs - Linux Technology Centre
12