Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
To: msnyder@cygnus.com
Cc: gdb-patches@sourceware.cygnus.com, taylor@cygnus.com
Subject: Re: [PATCH]: Make Sparc Target Multi-Arch
Date: Tue, 02 May 2000 13:46:00 -0000	[thread overview]
Message-ID: <200005022046.WAA14084@reisser.regent.e-technik.tu-muenchen.de> (raw)
In-Reply-To: <390F0C46.451B@cygnus.com>

> > Using AT_ENTRY_POINT will return bad results when calling a Sun cc compiled
> > function that returns a struct from within GDB.
> > 
> > Sun cc generates code which checks the expected structure size against
> > the passed structure size (in the extra word after the call) and does not
> > copy to the result structure if the sizes don't match.
> > Below is the disassembly of a function returning a structure with size 16.
> 
> Yuck!  Well, I can't use ON_STACK, because (a) the stack section
> is protected against execution in Solaris/Sparc64, and (b) it's
> too far from the text section for an ordinary jump/call.

And if C2 security is enabled on Sparc32 ON_STACK will fail as well, as stack
execution is protected too.
So using AT_ENTRY is definitely preferable.

> What if I write the return struct size to the entry point address, 
> following the trap instruction, and remove it when finished
> (like the trap instruction)?

This will not work with nested user calls (breakpoint at called function,
stop there, call another user function [returning a struct :-)]).
It might be dangerous as well, as the entry point might just contain
a jump, and you might clobber code which will be called during the user
function (unlikely, but possible).

As the problematic calls are rare (Sun cc compiled 32 bit ABI functions,
returning structs), I think that we could live with a warning and returning
garbage in the return value. Personally I'd prefer that over AT_ENTRY
hacking.

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de
From msnyder@cygnus.com Tue May 02 14:59:00 2000
From: Michael Snyder <msnyder@cygnus.com>
To: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
Cc: gdb-patches@sourceware.cygnus.com, taylor@cygnus.com
Subject: Re: [PATCH]: Make Sparc Target Multi-Arch
Date: Tue, 02 May 2000 14:59:00 -0000
Message-id: <390F4E7D.412B@cygnus.com>
References: <200005022046.WAA14084@reisser.regent.e-technik.tu-muenchen.de>
X-SW-Source: 2000-05/msg00034.html
Content-length: 2061

Peter.Schauer wrote:
> 
> > > Using AT_ENTRY_POINT will return bad results when calling a Sun cc compiled
> > > function that returns a struct from within GDB.
> > >
> > > Sun cc generates code which checks the expected structure size against
> > > the passed structure size (in the extra word after the call) and does not
> > > copy to the result structure if the sizes don't match.
> > > Below is the disassembly of a function returning a structure with size 16.
> >
> > Yuck!  Well, I can't use ON_STACK, because (a) the stack section
> > is protected against execution in Solaris/Sparc64, and (b) it's
> > too far from the text section for an ordinary jump/call.
> 
> And if C2 security is enabled on Sparc32 ON_STACK will fail as well, as stack
> execution is protected too.
> So using AT_ENTRY is definitely preferable.
> 
> > What if I write the return struct size to the entry point address,
> > following the trap instruction, and remove it when finished
> > (like the trap instruction)?
> 
> This will not work with nested user calls (breakpoint at called function,
> stop there, call another user function [returning a struct :-)]).

Oops, right you are.  But if a target call that returns a struct is 
a rarity, then nested target calls that return structs must be 
doubly rare.

> It might be dangerous as well, as the entry point might just contain
> a jump, and you might clobber code which will be called during the user
> function (unlikely, but possible).

I agree -- possible, but unlikely.
 
> As the problematic calls are rare (Sun cc compiled 32 bit ABI functions,
> returning structs), I think that we could live with a warning and returning
> garbage in the return value. Personally I'd prefer that over AT_ENTRY
> hacking.

Ah!  So you're saying this is a concern for Sparc32, but not for
Sparc64?
Then I have a solution.  I can easily use ON_STACK for Sparc32, and
AT_ENTRY_POINT for Sparc64.  That's the beauty of multi-arch!  ;-)

Then the only losers will be people who activate C2 security on Sparc32.

What do you think?

Michael
From kevinb@cygnus.com Tue May 02 15:39:00 2000
From: Kevin Buettner <kevinb@cygnus.com>
To: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>, msnyder@cygnus.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH]: Make Sparc Target Multi-Arch
Date: Tue, 02 May 2000 15:39:00 -0000
Message-id: <1000502223918.ZM27823@ocotillo.lan>
References: <200005022046.WAA14084@reisser.regent.e-technik.tu-muenchen.de> <390F4E7D.412B@cygnus.com> <msnyder@cygnus.com>
X-SW-Source: 2000-05/msg00035.html
Content-length: 765

On May 2,  2:54pm, Michael Snyder wrote:

> > As the problematic calls are rare (Sun cc compiled 32 bit ABI functions,
> > returning structs), I think that we could live with a warning and returning
> > garbage in the return value. Personally I'd prefer that over AT_ENTRY
> > hacking.
> 
> Ah!  So you're saying this is a concern for Sparc32, but not for
> Sparc64?
> Then I have a solution.  I can easily use ON_STACK for Sparc32, and
> AT_ENTRY_POINT for Sparc64.  That's the beauty of multi-arch!  ;-)
> 
> Then the only losers will be people who activate C2 security on Sparc32.
> 
> What do you think?

I think it would be best to figure out how to use AT_ENTRY_POINT for
both.

Kevin
(who still doesn't understand the problem with AT_ENTRY_POINT on
Sparc32)
From jimb@zwingli.cygnus.com Tue May 02 23:17:00 2000
From: Jim Blandy <jimb@zwingli.cygnus.com>
To: Elena Zannoni <ezannoni@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] in_prologue() fix #2
Date: Tue, 02 May 2000 23:17:00 -0000
Message-id: <npya5sf98z.fsf@zwingli.cygnus.com>
References: <14607.14500.451080.510575@kwikemart.cygnus.com>
X-SW-Source: 2000-05/msg00036.html
Content-length: 687

> This patch supercedes the one in:
> http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00456.html
> 
> This is a rewrite of in_prologue(). Jim is the real author of this
> patch, I have tested it on d10v (solves the original problem),
> solaris/sparc, linux/i386 w/ no regressions in the testsuite.
> 
> I'll check this in tomorrow, if there are no objections.
> Elena
> 
> Tue May  2 13:17:21 2000  Elena Zannoni  (ezannoni@makita.cygnus.com)
> 
>         * symtab.c (in_prologue): From Jim Blandy. Rewrite, more
>         intelligently, making sure we use the information from the 
>         symbol tables fully.

This patch sucks!  What kind of bozo coding is this?

(approved)
From jimb@zwingli.cygnus.com Tue May 02 23:31:00 2000
From: Jim Blandy <jimb@zwingli.cygnus.com>
To: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
Cc: msnyder@cygnus.com, gdb-patches@sourceware.cygnus.com, taylor@cygnus.com
Subject: Re: [PATCH]: Make Sparc Target Multi-Arch
Date: Tue, 02 May 2000 23:31:00 -0000
Message-id: <npvh0wf8m3.fsf@zwingli.cygnus.com>
References: <200005022046.WAA14084@reisser.regent.e-technik.tu-muenchen.de>
X-SW-Source: 2000-05/msg00037.html
Content-length: 1087

> > What if I write the return struct size to the entry point address, 
> > following the trap instruction, and remove it when finished
> > (like the trap instruction)?
> 
> This will not work with nested user calls (breakpoint at called function,
> stop there, call another user function [returning a struct :-)]).
> It might be dangerous as well, as the entry point might just contain
> a jump, and you might clobber code which will be called during the user
> function (unlikely, but possible).

When we push a dummy frame, we could save the contents of the return
size word.  Then, we could restore that when we pop the dummy frame.

This would still lose if we:
- call a function from GDB
- hit a breakpoint while that call is active
- call another function from GDB, which longjmps over the
  dummy frame and causes the first invocation to return

Alternatively, if we're using generic dummy frames, we could put each
breakpoint / return size at a new address.  A synthetic call nested N
deep would store its return breakpoint at ENTRY_POINT + K*N, for the
appropriate value of K.
From jimb@zwingli.cygnus.com Tue May 02 23:34:00 2000
From: Jim Blandy <jimb@zwingli.cygnus.com>
To: Daniel Berlin <dan@cgsoftware.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: Using typeinfo functions to determine RTTI
Date: Tue, 02 May 2000 23:34:00 -0000
Message-id: <npu2ggf8g3.fsf@zwingli.cygnus.com>
References: <Pine.LNX.4.10.10005020923450.14281-100000@propylaea.anduin.com>
X-SW-Source: 2000-05/msg00038.html
Content-length: 644

> Sorry i've been inactive, i've been bogged down by finals the past two
> weeks. I've got a boat load of patches for C++ to commit to the trunk.

Sheesh.  Get your priorities straight.

> Does anyone mind if i use the typeinfo functio name, rather than the
> virtual table name, to figure out th real type of an object? It only
> matters if someone does -fno-rtti, i believe. But I have no idea how many
> people actually use that flag to save time/space in debugging
> executables.

Almost all of Cygnus's customers use GDB to debug embedded apps, and
space is often an issue there.  But I don't actually know how many of
them use -fno-rtti.
From Peter.Schauer@regent.e-technik.tu-muenchen.de Wed May 03 01:43:00 2000
From: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
To: msnyder@cygnus.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH]: Make Sparc Target Multi-Arch
Date: Wed, 03 May 2000 01:43:00 -0000
Message-id: <200005030843.KAA15198@reisser.regent.e-technik.tu-muenchen.de>
References: <390F4E7D.412B@cygnus.com>
X-SW-Source: 2000-05/msg00039.html
Content-length: 842

> > As the problematic calls are rare (Sun cc compiled 32 bit ABI functions,
> > returning structs), I think that we could live with a warning and returning
> > garbage in the return value. Personally I'd prefer that over AT_ENTRY
> > hacking.
> 
> Ah!  So you're saying this is a concern for Sparc32, but not for
> Sparc64?
> Then I have a solution.  I can easily use ON_STACK for Sparc32, and
> AT_ENTRY_POINT for Sparc64.  That's the beauty of multi-arch!  ;-)
> 
> Then the only losers will be people who activate C2 security on Sparc32.
> 
> What do you think?

I don't have access to a v9 ABI, but looking at the generated v9 code this
seems to be a problem with Sparc32 only.

How hard would it be to default to AT_ENTRY for Sparc32 and make ON_STACK
a user selectable option ?

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de
From Peter.Schauer@regent.e-technik.tu-muenchen.de Wed May 03 01:47:00 2000
From: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
To: jimb@zwingli.cygnus.com (Jim Blandy)
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH]: Make Sparc Target Multi-Arch
Date: Wed, 03 May 2000 01:47:00 -0000
Message-id: <200005030847.KAA15226@reisser.regent.e-technik.tu-muenchen.de>
References: <npvh0wf8m3.fsf@zwingli.cygnus.com>
X-SW-Source: 2000-05/msg00040.html
Content-length: 1209

> > This will not work with nested user calls (breakpoint at called function,
> > stop there, call another user function [returning a struct :-)]).
> > It might be dangerous as well, as the entry point might just contain
> > a jump, and you might clobber code which will be called during the user
> > function (unlikely, but possible).
> 
> When we push a dummy frame, we could save the contents of the return
> size word.  Then, we could restore that when we pop the dummy frame.
> 
> This would still lose if we:
> - call a function from GDB
> - hit a breakpoint while that call is active
> - call another function from GDB, which longjmps over the
>   dummy frame and causes the first invocation to return
> 
> Alternatively, if we're using generic dummy frames, we could put each
> breakpoint / return size at a new address.  A synthetic call nested N
> deep would store its return breakpoint at ENTRY_POINT + K*N, for the
> appropriate value of K.

Which just increases the chance that we clobber code which is actually
called by the user function.
I really vote against putting anything else than a breakpoint at the
ENTRY_POINT in the inferior.

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de
From Peter.Schauer@regent.e-technik.tu-muenchen.de Wed May 03 02:14:00 2000
From: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
To: kevinb@cygnus.com (Kevin Buettner)
Cc: msnyder@cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH]: Make Sparc Target Multi-Arch
Date: Wed, 03 May 2000 02:14:00 -0000
Message-id: <200005030914.LAA15340@reisser.regent.e-technik.tu-muenchen.de>
References: <1000502223918.ZM27823@ocotillo.lan>
X-SW-Source: 2000-05/msg00041.html
Content-length: 2480

> Kevin
> (who still doesn't understand the problem with AT_ENTRY_POINT on
> Sparc32)

For details of the ABI see the Sparc Architecture Manual.
I have Version 8 (Prentice Hall ISBN 0-13-825001-4) and the calling
conventions for functions returning aggregate values are explained
in Appendix D.3.

Here is a short summary:

Given

struct x
{
  int a[4];
};

struct x gx;

struct x
sret ()
{
  return gx;
}

main ()
{
  int i;
  for (i = 0; i < 4; i++)
    gx.a[i] = i + 1;
  gx = sret ();
}

Sun Sparc32 cc generates the following code:

sret:
        save    %sp,-104,%sp
        sethi   %hi(gx),%l0
        or      %l0,%lo(gx),%l0
        st      %l0,[%fp-4]
        ba      .L14
        nop

        ! block 2
.L14:
        ld      [%fp-4],%l0
        mov     %l0,%o0
        or      %g0,16,%o1
        call    .stret4
        nop
	.
	.
	.
!   19    gx = sret ();

        add     %fp,-24,%l2
        call    sret
        st      %l2,[%sp+64]
        unimp   16

where .stret4 is a library function, which contains

0xef716a88 <.stret4>:   ld  [ %i7 + 8 ], %o3
0xef716a8c <.stret4+4>: and  %o1, 0xfff, %o4
0xef716a90 <.stret4+8>: sethi  %hi(0), %o5
0xef716a94 <.stret4+12>:        or  %o4, %o5, %o5
0xef716a98 <.stret4+16>:        cmp  %o5, %o3
0xef716a9c <.stret4+20>:        bne  0xef716ab8 <.stret4+48>
0xef716aa0 <.stret4+24>:        ld  [ %fp + 0x40 ], %i0
0xef716aa4 <.stret4+28>:        subcc  %o1, 4, %o1
0xef716aa8 <.stret4+32>:        ld  [ %o0 + %o1 ], %o4
0xef716aac <.stret4+36>:        bg  0xef716aa4 <.stret4+28>
0xef716ab0 <.stret4+40>:        st  %o4, [ %i0 + %o1 ]
0xef716ab4 <.stret4+44>:        add  %i7, 4, %i7
0xef716ab8 <.stret4+48>:        ret
0xef716abc <.stret4+52>:        restore

The extra unimp word after the `call sret' contains the size of the
struct return value expected by the caller, which is checked in .stret4,
so that the callee does not clobber memory in the caller (if the caller
does for some reason not expect a struct return value or expects a structure
with a different size).

If we are using ON_STACK, sparc_fix_call_dummy patches the unimp instruction
in the call dummy code to contain the right value.

If we are using AT_ENTRY, we would have to put the extra unimp instruction
after the entry point, but I consider that dangerous.

gcc generated code for sret does not check the unimp word, so there is
no problem with gcc compiled code.

Hope that explains the issue,

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de
From ac131313@cygnus.com Wed May 03 02:27:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: [sim/d10v] Fix address map for d10v/ts3
Date: Wed, 03 May 2000 02:27:00 -0000
Message-id: <390FF0DF.CDBE1FB@cygnus.com>
X-SW-Source: 2000-05/msg00042.html
Content-length: 1056

FYI,

I've committed the attached.

	Andrew
Tue Jan 18 16:07:42 MST 2000	Diego Novillo <dnovillo@cygnus.com>

	* interp.c (sim_create_inferior): Change internal initial value for
 	DMAP2 to 0x2000.

Index: interp.c
===================================================================
RCS file: /cvs/src/src/sim/d10v/interp.c,v
retrieving revision 1.4
diff -p -r1.4 interp.c
*** interp.c	2000/04/18 07:55:35	1.4
--- interp.c	2000/05/03 09:17:03
*************** sim_create_inferior (sd, abfd, argv, env
*** 1252,1258 ****
        set_imap_register (1, 0x1000);
        set_dmap_register (0, 0x2000);
        set_dmap_register (1, 0x2000);
!       set_dmap_register (2, 0x0000); /* Old DMAP, Value is not 0x2000 */
        set_dmap_register (3, 0x0000);
      }
  
--- 1252,1259 ----
        set_imap_register (1, 0x1000);
        set_dmap_register (0, 0x2000);
        set_dmap_register (1, 0x2000);
!       set_dmap_register (2, 0x2000); /* DMAP2 initial internal value is
! 					0x2000 on the new board. */
        set_dmap_register (3, 0x0000);
      }
  
From ezannoni@cygnus.com Wed May 03 06:46:00 2000
From: Elena Zannoni <ezannoni@cygnus.com>
To: Jim Blandy <jimb@cygnus.com>
Cc: Elena Zannoni <ezannoni@cygnus.com>, gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] in_prologue() fix #2
Date: Wed, 03 May 2000 06:46:00 -0000
Message-id: <14608.11691.84604.614409@kwikemart.cygnus.com>
References: <14607.14500.451080.510575@kwikemart.cygnus.com> <npya5sf98z.fsf@zwingli.cygnus.com>
X-SW-Source: 2000-05/msg00043.html
Content-length: 844

Jim Blandy writes:
 > 
 > > This patch supercedes the one in:
 > > http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00456.html
 > > 
 > > This is a rewrite of in_prologue(). Jim is the real author of this
 > > patch, I have tested it on d10v (solves the original problem),
 > > solaris/sparc, linux/i386 w/ no regressions in the testsuite.
 > > 
 > > I'll check this in tomorrow, if there are no objections.
 > > Elena
 > > 
 > > Tue May  2 13:17:21 2000  Elena Zannoni  (ezannoni@makita.cygnus.com)
 > > 
 > >         * symtab.c (in_prologue): From Jim Blandy. Rewrite, more
 > >         intelligently, making sure we use the information from the 
 > >         symbol tables fully.
 > 
 > This patch sucks!  What kind of bozo coding is this?
 > 
 > (approved)

Yeah, I don't know. Sometimes people have just no clue.

Checked in.

Elena
From ezannoni@cygnus.com Wed May 03 07:02:00 2000
From: Elena Zannoni <ezannoni@cygnus.com>
To: Elena Zannoni <ezannoni@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] Make SECT_OFF_* objfile specific
Date: Wed, 03 May 2000 07:02:00 -0000
Message-id: <14608.12631.310698.841003@kwikemart.cygnus.com>
References: <14604.18937.903237.581025@kwikemart.cygnus.com>
X-SW-Source: 2000-05/msg00044.html
Content-length: 83662

If I hear no objections, this is going in tomorrow morning.

Elena


Elena Zannoni writes:
 > 
 > This patch makes SECT_OFF_TEXT, SECT_OFF_DATA, SECT_OFF_BSS and
 > SECT_OFF_RODATA dependent on a given specific objfile.  This is
 > because the numbering of the sections can vary depending on each
 > objfile.
 > 
 > The corresponding indexes are initialized in the functions
 > default_symfile_offsets, som_symfile_offsets, xcoff_symfile_offsets,
 > based on the bfd indexes for sections.  The indexes are now members of
 > the objfile structure.
 > 
 > This patch supersedes the one in 
 > http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00402.html
 > 
 > I tested it on a som platform (hpux 10.20), an xcoff platform (aix)
 > and a stabs/elf platform (solaris). If somebody wants to try it on
 > some other system that would be extremely helpful.
 > 
 > Thanks
 > Elena
 > 
 > 2000-04-30  Elena Zannoni  <ezannoni@kwikemart.cygnus.com>
 > 
 > 	* objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
 > 	SECT_OFF_RODATA): Define as functions of OBJFILE.  Add
 > 	sect_index_text, sect_index_data, sect_index_rodata,
 >  	sect_index_bss to objfile structure.  
 > 	* gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
 >  	SECT_OFF_RODATA): Remove.
 > 	* objfiles.c (allocate_objfile): Initialize
 >  	sect_index_{text,data,bss,rodata} to -1, for error detection.
 > 
 > 	* symfile.c (default_symfile_offsets): Initialize
 >  	sect_index_{text,data,bss,rodata} from bfd information.
 > 	* xcoffread.c (xcoff_symfile_offsets): Ditto.
 > 	* somread.c (som_symfile_offsets): Initialize
 >  	sect_index_{text,data,bss,rodata}.
 > 
 >  	* coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c,
 >         hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c,
 >         mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h,
 >         remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c,
 >         stabsread.c, symfile.c, xcoffread.c:
 >  	Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the
 >  	current objfile.
 > 
 >         * xcoffread.c: Add new field objfile to find_targ_sec_arg.
 > 
 > Index: coffread.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/coffread.c,v
 > retrieving revision 1.3
 > diff -u -p -r1.3 coffread.c
 > --- coffread.c	2000/04/26 12:41:48	1.3
 > +++ coffread.c	2000/04/30 14:43:39
 > @@ -340,7 +340,7 @@ cs_to_section (cs, objfile)
 >  {
 >    asection *sect = NULL;
 >    struct find_targ_sec_arg args;
 > -  int off = SECT_OFF_TEXT;
 > +  int off = SECT_OFF_TEXT (objfile);
 >  
 >    args.targ_index = cs->c_secnum;
 >    args.resultp = &sect;
 > @@ -349,11 +349,11 @@ cs_to_section (cs, objfile)
 >      {
 >        /* This is the section.  Figure out what SECT_OFF_* code it is.  */
 >        if (bfd_get_section_flags (abfd, sect) & SEC_CODE)
 > -	off = SECT_OFF_TEXT;
 > +	off = SECT_OFF_TEXT (objfile);
 >        else if (bfd_get_section_flags (abfd, sect) & SEC_LOAD)
 > -	off = SECT_OFF_DATA;
 > +	off = SECT_OFF_DATA (objfile);
 >        else
 > -	off = SECT_OFF_BSS;
 > +	off = SECT_OFF_BSS (objfile);
 >      }
 >    return off;
 >  }
 > @@ -843,7 +843,7 @@ coff_symtab_read (symtab_offset, nsyms, 
 >        if (ISFCN (cs->c_type) && cs->c_sclass != C_TPDEF)
 >  	{
 >  	  /* Record all functions -- external and static -- in minsyms. */
 > -	  tmpaddr = cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	  tmpaddr = cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	  record_minimal_symbol (cs->c_name, tmpaddr, mst_text, objfile);
 >  
 >  	  fcn_line_ptr = main_aux.x_sym.x_fcnary.x_fcn.x_lnnoptr;
 > @@ -908,7 +908,7 @@ coff_symtab_read (symtab_offset, nsyms, 
 >  		     followed by a later file with no symbols.  */
 >  		  if (in_source_file)
 >  		    complete_symtab (filestring,
 > -		    cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT),
 > +		    cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)),
 >  				     main_aux.x_scn.x_scnlen);
 >  		  in_source_file = 0;
 >  		}
 > @@ -969,10 +969,8 @@ coff_symtab_read (symtab_offset, nsyms, 
 >  		    || cs->c_sclass == C_THUMBEXT)
 >  		  tmpaddr += ANOFFSET (objfile->section_offsets, sec);
 >  
 > -		switch (sec)
 > +		if (sec == SECT_OFF_TEXT (objfile) || sec == SECT_OFF_RODATA (objfile))
 >  		  {
 > -		  case SECT_OFF_TEXT:
 > -		  case SECT_OFF_RODATA:
 >  		    ms_type =
 >  		      cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC
 >  		      || cs->c_sclass == C_THUMBEXT ?
 > @@ -981,21 +979,23 @@ coff_symtab_read (symtab_offset, nsyms, 
 >  		    if (tmpaddr & 1)	/* FIXME: delete this line */
 >  		      SMASH_TEXT_ADDRESS (tmpaddr);
 >  #endif
 > -		    break;
 > -		  case SECT_OFF_DATA:
 > +		  }
 > +		else
 > +		  if  (sec == SECT_OFF_DATA (objfile))
 > +		    {
 >  		    ms_type =
 >  		      cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT ?
 >  		      mst_data : mst_file_data;
 > -		    break;
 > -		  case SECT_OFF_BSS:
 > +		    }
 > +		  else
 > +		    if (sec == SECT_OFF_BSS (objfile))
 > +		      {
 >  		    ms_type =
 >  		      cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT ?
 >  		      mst_data : mst_file_data;
 > -		    break;
 > -		  default:
 > -		    ms_type = mst_unknown;
 > -		    break;
 > -		  }
 > +		      }
 > +		    else
 > +		      ms_type = mst_unknown;
 >  	      }
 >  
 >  	    if (cs->c_name[0] != '@' /* Skip tdesc symbols */ )
 > @@ -1099,11 +1099,11 @@ coff_symtab_read (symtab_offset, nsyms, 
 >  	         of the epilogue.  */
 >  			    cs->c_value
 >  			    + FUNCTION_EPILOGUE_SIZE
 > -			    + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT),
 > +			    + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)),
 >  #else
 >  			    fcn_cs_saved.c_value
 >  			    + fcn_aux_saved.x_sym.x_misc.x_fsize
 > -			    + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT),
 > +			    + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)),
 >  #endif
 >  			    objfile
 >  		);
 > @@ -1115,7 +1115,7 @@ coff_symtab_read (symtab_offset, nsyms, 
 >  	  if (STREQ (cs->c_name, ".bb"))
 >  	    {
 >  	      tmpaddr = cs->c_value;
 > -	      tmpaddr += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	      tmpaddr += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	      push_context (++depth, tmpaddr);
 >  	    }
 >  	  else if (STREQ (cs->c_name, ".eb"))
 > @@ -1135,7 +1135,7 @@ coff_symtab_read (symtab_offset, nsyms, 
 >  	      if (local_symbols && context_stack_depth > 0)
 >  		{
 >  		  tmpaddr =
 > -		    cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +		    cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  		  /* Make a block for the local symbols within.  */
 >  		  finish_block (0, &local_symbols, new->old_blocks,
 >  				new->start_addr, tmpaddr, objfile);
 > @@ -1427,7 +1427,7 @@ enter_linenos (file_offset, first_line, 
 >        if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line)
 >  	record_line (current_subfile, first_line + L_LNNO32 (&lptr),
 >  		     lptr.l_addr.l_paddr
 > -		     + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT));
 > +		     + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)));
 >        else
 >  	break;
 >      }
 > @@ -1547,7 +1547,7 @@ process_coff_symbol (cs, aux, objfile)
 >  
 >    if (ISFCN (cs->c_type))
 >      {
 > -      SYMBOL_VALUE (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +      SYMBOL_VALUE (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >        SYMBOL_TYPE (sym) =
 >  	lookup_function_type (decode_function_type (cs, cs->c_type, aux));
 >  
 > @@ -1577,7 +1577,7 @@ process_coff_symbol (cs, aux, objfile)
 >  	case C_EXT:
 >  	  SYMBOL_CLASS (sym) = LOC_STATIC;
 >  	  SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value;
 > -	  SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	  SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	  add_symbol_to_list (sym, &global_symbols);
 >  	  break;
 >  
 > @@ -1586,7 +1586,7 @@ process_coff_symbol (cs, aux, objfile)
 >  	case C_STAT:
 >  	  SYMBOL_CLASS (sym) = LOC_STATIC;
 >  	  SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value;
 > -	  SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	  SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	  if (within_function)
 >  	    {
 >  	      /* Static symbol of local scope */
 > Index: dbxread.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/dbxread.c,v
 > retrieving revision 1.1.1.10
 > diff -u -p -r1.1.1.10 dbxread.c
 > --- dbxread.c	2000/01/06 03:06:36	1.1.1.10
 > +++ dbxread.c	2000/04/30 14:43:39
 > @@ -488,17 +488,17 @@ record_minimal_symbol (name, address, ty
 >      {
 >      case N_TEXT | N_EXT:
 >        ms_type = mst_text;
 > -      section = SECT_OFF_TEXT;
 > +      section = SECT_OFF_TEXT (objfile);
 >        bfd_section = DBX_TEXT_SECTION (objfile);
 >        break;
 >      case N_DATA | N_EXT:
 >        ms_type = mst_data;
 > -      section = SECT_OFF_DATA;
 > +      section = SECT_OFF_DATA (objfile);
 >        bfd_section = DBX_DATA_SECTION (objfile);
 >        break;
 >      case N_BSS | N_EXT:
 >        ms_type = mst_bss;
 > -      section = SECT_OFF_BSS;
 > +      section = SECT_OFF_BSS (objfile);
 >        bfd_section = DBX_BSS_SECTION (objfile);
 >        break;
 >      case N_ABS | N_EXT:
 > @@ -509,7 +509,7 @@ record_minimal_symbol (name, address, ty
 >  #ifdef N_SETV
 >      case N_SETV | N_EXT:
 >        ms_type = mst_data;
 > -      section = SECT_OFF_DATA;
 > +      section = SECT_OFF_DATA (objfile);
 >        bfd_section = DBX_DATA_SECTION (objfile);
 >        break;
 >      case N_SETV:
 > @@ -517,7 +517,7 @@ record_minimal_symbol (name, address, ty
 >           of going over many .o files, it doesn't make sense to have one
 >           file local.  */
 >        ms_type = mst_file_data;
 > -      section = SECT_OFF_DATA;
 > +      section = SECT_OFF_DATA (objfile);
 >        bfd_section = DBX_DATA_SECTION (objfile);
 >        break;
 >  #endif
 > @@ -526,7 +526,7 @@ record_minimal_symbol (name, address, ty
 >      case N_FN:
 >      case N_FN_SEQ:
 >        ms_type = mst_file_text;
 > -      section = SECT_OFF_TEXT;
 > +      section = SECT_OFF_TEXT (objfile);
 >        bfd_section = DBX_TEXT_SECTION (objfile);
 >        break;
 >      case N_DATA:
 > @@ -547,12 +547,12 @@ record_minimal_symbol (name, address, ty
 >  	if (VTBL_PREFIX_P ((tempstring)))
 >  	  ms_type = mst_data;
 >        }
 > -      section = SECT_OFF_DATA;
 > +      section = SECT_OFF_DATA (objfile);
 >        bfd_section = DBX_DATA_SECTION (objfile);
 >        break;
 >      case N_BSS:
 >        ms_type = mst_file_bss;
 > -      section = SECT_OFF_BSS;
 > +      section = SECT_OFF_BSS (objfile);
 >        bfd_section = DBX_BSS_SECTION (objfile);
 >        break;
 >      default:
 > @@ -1157,17 +1157,17 @@ read_dbx_dynamic_symtab (objfile)
 >  
 >  	  if (bfd_get_section_flags (abfd, sec) & SEC_CODE)
 >  	    {
 > -	      sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	      sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	      type = N_TEXT;
 >  	    }
 >  	  else if (bfd_get_section_flags (abfd, sec) & SEC_DATA)
 >  	    {
 > -	      sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
 > +	      sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
 >  	      type = N_DATA;
 >  	    }
 >  	  else if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
 >  	    {
 > -	      sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
 > +	      sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
 >  	      type = N_BSS;
 >  	    }
 >  	  else
 > @@ -1208,7 +1208,7 @@ read_dbx_dynamic_symtab (objfile)
 >      {
 >        arelent *rel = *relptr;
 >        CORE_ADDR address =
 > -      rel->address + ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
 > +      rel->address + ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
 >  
 >        switch (bfd_get_arch (abfd))
 >  	{
 > @@ -1382,7 +1382,7 @@ read_dbx_symtab (objfile)
 >        /* Don't set pst->texthigh lower than it already is.  */
 >        CORE_ADDR text_end =
 >        (lowest_text_address == (CORE_ADDR) -1
 > -       ? (text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT))
 > +       ? (text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)))
 >         : lowest_text_address)
 >        + text_size;
 >  
 > @@ -1558,6 +1558,7 @@ end_psymtab (pst, include_list, num_incl
 >        struct partial_symtab *subpst =
 >        allocate_psymtab (include_list[i], objfile);
 >  
 > +      /* Copy the sesction_offsets array from the main psymtab. */
 >        subpst->section_offsets = pst->section_offsets;
 >        subpst->read_symtab_private =
 >  	(char *) obstack_alloc (&objfile->psymbol_obstack,
 > @@ -1738,6 +1739,10 @@ read_ofile_symtab (pst)
 >    sym_size = LDSYMLEN (pst);
 >    text_offset = pst->textlow;
 >    text_size = pst->texthigh - pst->textlow;
 > +  /* This cannot be simply objfile->section_offsets because of
 > +     elfstab_offset_sections() which initializes the psymtab section
 > +     offsets information in a special way, and that is different from
 > +     objfile->section_offsets. */ 
 >    section_offsets = pst->section_offsets;
 >  
 >    current_objfile = objfile;
 > @@ -1880,7 +1885,7 @@ read_ofile_symtab (pst)
 >    if (last_source_start_addr > text_offset)
 >      last_source_start_addr = text_offset;
 >  
 > -  pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT);
 > +  pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile));
 >  
 >    /* Process items which we had to "process_later" due to dependancies 
 >       on other stabs.  */
 > @@ -1899,6 +1904,8 @@ read_ofile_symtab (pst)
 >     NAME is the symbol name, in our address space.
 >     SECTION_OFFSETS is a set of amounts by which the sections of this object
 >     file were relocated when it was loaded into memory.
 > +   Note that these section_offsets are not the 
 > +   objfile->section_offsets but the pst->section_offsets.
 >     All symbols that refer
 >     to memory locations need to be offset by these amounts.
 >     OBJFILE is the object file from which we are reading symbols.
 > @@ -1942,7 +1949,7 @@ process_one_symbol (type, desc, valu, na
 >    if (!block_address_function_relative)
 >      /* N_LBRAC, N_RBRAC and N_SLINE entries are not relative to the
 >         function start address, so just use the text offset.  */
 > -    function_start_offset = ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +    function_start_offset = ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >  
 >    /* Something is wrong if we see real data before
 >       seeing a source file name.  */
 > @@ -1982,7 +1989,7 @@ process_one_symbol (type, desc, valu, na
 >  	}
 >  
 >        /* Relocate for dynamic loading */
 > -      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >  #ifdef SMASH_TEXT_ADDRESS
 >        SMASH_TEXT_ADDRESS (valu);
 >  #endif
 > @@ -2090,7 +2097,7 @@ process_one_symbol (type, desc, valu, na
 >      case N_FN_SEQ:
 >        /* This kind of symbol indicates the start of an object file.  */
 >        /* Relocate for dynamic loading */
 > -      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >        break;
 >  
 >      case N_SO:
 > @@ -2099,7 +2106,7 @@ process_one_symbol (type, desc, valu, na
 >           Finish the symbol table of the previous source file
 >           (if any) and start accumulating a new symbol table.  */
 >        /* Relocate for dynamic loading */
 > -      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >  
 >        n_opt_found = 0;
 >  
 > @@ -2126,7 +2133,7 @@ process_one_symbol (type, desc, valu, na
 >  	      patch_subfile_names (current_subfile, name);
 >  	      break;		/* Ignore repeated SOs */
 >  	    }
 > -	  end_symtab (valu, objfile, SECT_OFF_TEXT);
 > +	  end_symtab (valu, objfile, SECT_OFF_TEXT (objfile));
 >  	  end_stabs ();
 >  	}
 >  
 > @@ -2149,7 +2156,7 @@ process_one_symbol (type, desc, valu, na
 >           included in the compilation of the main source file
 >           (whose name was given in the N_SO symbol.)  */
 >        /* Relocate for dynamic loading */
 > -      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >        start_subfile (name, current_subfile->dirname);
 >        break;
 >  
 > @@ -2227,7 +2234,7 @@ process_one_symbol (type, desc, valu, na
 >  		   elfstab_offset_sections ever starts dealing with the
 >  		   text offset, and we still need to do this, we need to
 >  		   invent a SECT_OFF_ADDR_KLUDGE or something.  */
 > -		valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +		valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >  		goto define_a_symbol;
 >  	      }
 >  	  }
 > @@ -2247,22 +2254,22 @@ process_one_symbol (type, desc, valu, na
 >  
 >      case_N_STSYM:		/* Static symbol in data seg */
 >      case N_DSLINE:		/* Source line number, data seg */
 > -      valu += ANOFFSET (section_offsets, SECT_OFF_DATA);
 > +      valu += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
 >        goto define_a_symbol;
 >  
 >      case_N_LCSYM:		/* Static symbol in BSS seg */
 >      case N_BSLINE:		/* Source line number, bss seg */
 >        /*   N_BROWS:       overlaps with N_BSLINE */
 > -      valu += ANOFFSET (section_offsets, SECT_OFF_BSS);
 > +      valu += ANOFFSET (section_offsets, SECT_OFF_BSS (objfile));
 >        goto define_a_symbol;
 >  
 >      case_N_ROSYM:		/* Static symbol in Read-only data seg */
 > -      valu += ANOFFSET (section_offsets, SECT_OFF_RODATA);
 > +      valu += ANOFFSET (section_offsets, SECT_OFF_RODATA (objfile));
 >        goto define_a_symbol;
 >  
 >      case N_ENTRY:		/* Alternate entry point */
 >        /* Relocate for dynamic loading */
 > -      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >        goto define_a_symbol;
 >  
 >        /* The following symbol types we don't know how to process.  Handle
 > @@ -2314,7 +2321,7 @@ process_one_symbol (type, desc, valu, na
 >  	      /* Deal with the SunPRO 3.0 compiler which omits the address
 >  	         from N_FUN symbols.  */
 >  	      if (type == N_FUN
 > -		  && valu == ANOFFSET (section_offsets, SECT_OFF_TEXT))
 > +		  && valu == ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)))
 >  		valu = 
 >  		  find_stab_function_addr (name, last_source_file, objfile);
 >  #endif
 > Index: elfread.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/elfread.c,v
 > retrieving revision 1.4
 > diff -u -p -r1.4 elfread.c
 > --- elfread.c	2000/02/15 04:48:23	1.4
 > +++ elfread.c	2000/04/30 14:43:39
 > @@ -191,18 +191,18 @@ record_minimal_symbol_and_info (name, ad
 >      {
 >      case mst_text:
 >      case mst_file_text:
 > -      section = SECT_OFF_TEXT;
 > +      section = SECT_OFF_TEXT (objfile);
 >  #ifdef SMASH_TEXT_ADDRESS
 >        SMASH_TEXT_ADDRESS (address);
 >  #endif
 >        break;
 >      case mst_data:
 >      case mst_file_data:
 > -      section = SECT_OFF_DATA;
 > +      section = SECT_OFF_DATA (objfile);
 >        break;
 >      case mst_bss:
 >      case mst_file_bss:
 > -      section = SECT_OFF_BSS;
 > +      section = SECT_OFF_BSS (objfile);
 >        break;
 >      default:
 >        section = -1;
 > @@ -294,7 +294,7 @@ elf_symtab_read (objfile, dynamic)
 >  	error ("Can't read symbols from %s: %s", bfd_get_filename (objfile->obfd),
 >  	       bfd_errmsg (bfd_get_error ()));
 >        /* FIXME: Should use section specific offset, not SECT_OFF_TEXT. */
 > -      offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +      offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >        for (i = 0; i < number_of_symbols; i++)
 >  	{
 >  	  sym = symbol_table[i];
 > @@ -460,15 +460,15 @@ elf_symtab_read (objfile, dynamic)
 >  		      index = SECT_OFF_MAX;
 >  		      if (STREQ ("Bbss.bss", sym->name))
 >  			{
 > -			  index = SECT_OFF_BSS;
 > +			  index = SECT_OFF_BSS (objfile);
 >  			}
 >  		      else if (STREQ ("Ddata.data", sym->name))
 >  			{
 > -			  index = SECT_OFF_DATA;
 > +			  index = SECT_OFF_DATA (objfile);
 >  			}
 >  		      else if (STREQ ("Drodata.rodata", sym->name))
 >  			{
 > -			  index = SECT_OFF_RODATA;
 > +			  index = SECT_OFF_RODATA (objfile);
 >  			}
 >  		      if (index != SECT_OFF_MAX)
 >  			{
 > Index: gdb-stabs.h
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/gdb-stabs.h,v
 > retrieving revision 1.2
 > diff -u -p -r1.2 gdb-stabs.h
 > --- gdb-stabs.h	2000/04/21 14:33:33	1.2
 > +++ gdb-stabs.h	2000/04/30 14:43:39
 > @@ -28,15 +28,6 @@
 >  #if !defined (GDBSTABS_H)
 >  #define GDBSTABS_H
 >  
 > -/* Offsets in the psymtab's section_offsets array for various kinds of
 > -   stabs symbols.  Every psymtab built from stabs will have these offsets
 > -   filled in by these guidelines, so that when actually reading symbols, the
 > -   proper offset can simply be selected and added to the symbol value.  */
 > -
 > -#define	SECT_OFF_TEXT	0
 > -#define	SECT_OFF_DATA	1
 > -#define	SECT_OFF_BSS	2
 > -#define	SECT_OFF_RODATA	3
 >  #define	SECT_OFF_MAX	40	/* Count of possible values */
 >  
 >  /* The stab_section_info chain remembers info from the ELF symbol table,
 > Index: hp-psymtab-read.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/hp-psymtab-read.c,v
 > retrieving revision 1.1.1.6
 > diff -u -p -r1.1.1.6 hp-psymtab-read.c
 > --- hp-psymtab-read.c	1999/12/22 21:45:06	1.1.1.6
 > +++ hp-psymtab-read.c	2000/04/30 14:43:39
 > @@ -601,7 +601,7 @@ scan_procs (curr_pd_p, qPD, max_procs, s
 >  					   LOC_BLOCK,	/* "I am a routine"        */
 >  					   &objfile->global_psymbols,
 >  					   (qPD[curr_pd].adrStart +	/* Starting address of rtn */
 > -				 ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)),
 > +				 ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))),
 >  					   0,	/* core addr?? */
 >  		      trans_lang ((enum hp_language) qPD[curr_pd].language),
 >  					   objfile);
 > @@ -614,7 +614,7 @@ scan_procs (curr_pd_p, qPD, max_procs, s
 >  					   LOC_BLOCK,	/* "I am a routine"        */
 >  					   &objfile->static_psymbols,
 >  					   (qPD[curr_pd].adrStart +	/* Starting address of rtn */
 > -				 ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)),
 > +				 ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))),
 >  					   0,	/* core addr?? */
 >  		      trans_lang ((enum hp_language) qPD[curr_pd].language),
 >  					   objfile);
 > @@ -1816,7 +1816,7 @@ hpread_build_psymtabs (objfile, mainline
 >  		  past_first_source_file = 1;
 >  
 >  		valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
 > -		valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +		valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  		pst = hpread_start_psymtab (objfile,
 >  					    namestring, valu,
 >  					    (hp_symnum
 > @@ -1850,7 +1850,7 @@ hpread_build_psymtabs (objfile, mainline
 >  	      /* Now begin a new module and a new psymtab for it */
 >  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
 >  	      valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
 > -	      valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	      valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	      if (!pst)
 >  		{
 >  		  pst = hpread_start_psymtab (objfile,
 > @@ -1869,11 +1869,11 @@ hpread_build_psymtabs (objfile, mainline
 >  	      /* The beginning of a function.  DNTT_TYPE_ENTRY may also denote
 >  	         a secondary entry point.  */
 >  	      valu = dn_bufp->dfunc.hiaddr + ANOFFSET (objfile->section_offsets,
 > -						       SECT_OFF_TEXT);
 > +						       SECT_OFF_TEXT (objfile));
 >  	      if (valu > texthigh)
 >  		texthigh = valu;
 >  	      valu = dn_bufp->dfunc.lowaddr +
 > -		ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +		ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
 >  	      if (dn_bufp->dfunc.global)
 >  		add_psymbol_to_list (namestring, strlen (namestring),
 > @@ -1890,11 +1890,11 @@ hpread_build_psymtabs (objfile, mainline
 >  
 >  	    case DNTT_TYPE_DOC_FUNCTION:
 >  	      valu = dn_bufp->ddocfunc.hiaddr + ANOFFSET (objfile->section_offsets,
 > -							  SECT_OFF_TEXT);
 > +							  SECT_OFF_TEXT (objfile));
 >  	      if (valu > texthigh)
 >  		texthigh = valu;
 >  	      valu = dn_bufp->ddocfunc.lowaddr +
 > -		ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +		ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
 >  	      if (dn_bufp->ddocfunc.global)
 >  		add_psymbol_to_list (namestring, strlen (namestring),
 > @@ -1984,7 +1984,7 @@ hpread_build_psymtabs (objfile, mainline
 >  		valu = dn_bufp->dsvar.location;
 >  		/* Relocate in case it's in a shared library */
 >  		if (storage == LOC_STATIC)
 > -		  valu += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
 > +		  valu += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
 >  
 >  		/* Luckily, dvar, svar, typedef, and tagdef all
 >  		   have their "global" bit in the same place, so it works
 > @@ -2208,7 +2208,7 @@ hpread_start_psymtab (objfile,
 >       struct partial_symbol **global_syms;
 >       struct partial_symbol **static_syms;
 >  {
 > -  int offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +  int offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >    extern void hpread_psymtab_to_symtab ();
 >    struct partial_symtab *result =
 >    start_psymtab_common (objfile, objfile->section_offsets,
 > @@ -2246,7 +2246,7 @@ hpread_end_psymtab (pst, include_list, n
 >  {
 >    int i;
 >    struct objfile *objfile = pst->objfile;
 > -  int offset = ANOFFSET (pst->section_offsets, SECT_OFF_TEXT);
 > +  int offset = ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (objfile));
 >  
 >  #ifdef DUMPING
 >    /* Turn on to see what kind of a psymtab we've built. */
 > Index: hp-symtab-read.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/hp-symtab-read.c,v
 > retrieving revision 1.1.1.3
 > diff -u -p -r1.1.1.3 hp-symtab-read.c
 > --- hp-symtab-read.c	1999/08/16 19:52:47	1.1.1.3
 > +++ hp-symtab-read.c	2000/04/30 14:43:39
 > @@ -2823,8 +2823,8 @@ hpread_process_one_debug_symbol (dn_bufp
 >    unsigned long desc;
 >    int type;
 >    CORE_ADDR valu;
 > -  int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > -  int data_offset = ANOFFSET (section_offsets, SECT_OFF_DATA);
 > +  int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 > +  int data_offset = ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
 >    union dnttentry *dn_temp;
 >    dnttpointer hp_type;
 >    struct symbol *sym;
 > Index: hpread.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/hpread.c,v
 > retrieving revision 1.1.1.3
 > diff -u -p -r1.1.1.3 hpread.c
 > --- hpread.c	1999/09/08 23:59:15	1.1.1.3
 > +++ hpread.c	2000/04/30 14:43:40
 > @@ -466,7 +466,7 @@ hpread_build_psymtabs (objfile, mainline
 >  		  past_first_source_file = 1;
 >  
 >  		valu = hpread_get_textlow (i, hp_symnum, objfile);
 > -		valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +		valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  		pst = hpread_start_psymtab (objfile,
 >  					    namestring, valu,
 >  					    (hp_symnum
 > @@ -484,7 +484,7 @@ hpread_build_psymtabs (objfile, mainline
 >  	         is supposed to be.  */
 >  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
 >  	      valu = hpread_get_textlow (i, hp_symnum, objfile);
 > -	      valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	      valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	      if (!pst)
 >  		{
 >  		  pst = hpread_start_psymtab (objfile,
 > @@ -502,11 +502,11 @@ hpread_build_psymtabs (objfile, mainline
 >  	      /* The beginning of a function.  DNTT_TYPE_ENTRY may also denote
 >  	         a secondary entry point.  */
 >  	      valu = dn_bufp->dfunc.hiaddr + ANOFFSET (objfile->section_offsets,
 > -						       SECT_OFF_TEXT);
 > +						       SECT_OFF_TEXT (objfile));
 >  	      if (valu > texthigh)
 >  		texthigh = valu;
 >  	      valu = dn_bufp->dfunc.lowaddr +
 > -		ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +		ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
 >  	      add_psymbol_to_list (namestring, strlen (namestring),
 >  				   VAR_NAMESPACE, LOC_BLOCK,
 > @@ -1775,7 +1775,7 @@ hpread_process_one_debug_symbol (dn_bufp
 >    unsigned long desc;
 >    int type;
 >    CORE_ADDR valu;
 > -  int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +  int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >    union dnttentry *dn_temp;
 >    dnttpointer hp_type;
 >    struct symbol *sym;
 > Index: mdebugread.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/mdebugread.c,v
 > retrieving revision 1.1.1.5
 > diff -u -p -r1.1.1.5 mdebugread.c
 > --- mdebugread.c	1999/09/08 23:59:21	1.1.1.5
 > +++ mdebugread.c	2000/04/30 14:43:40
 > @@ -384,7 +384,7 @@ static struct blockvector *
 >    new_bvect PARAMS ((int));
 >  
 >  static int
 > -parse_symbol PARAMS ((SYMR *, union aux_ext *, char *, int, struct section_offsets *));
 > +parse_symbol PARAMS ((SYMR *, union aux_ext *, char *, int, struct section_offsets *, struct objfile *));
 >  
 >  static struct type *
 >    parse_type PARAMS ((int, union aux_ext *, unsigned int, int *, int, char *));
 > @@ -716,12 +716,13 @@ add_pending (fh, sh, t)
 >     SYMR's handled (normally one).  */
 >  
 >  static int
 > -parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
 > +parse_symbol (sh, ax, ext_sh, bigend, section_offsets, objfile)
 >       SYMR *sh;
 >       union aux_ext *ax;
 >       char *ext_sh;
 >       int bigend;
 >       struct section_offsets *section_offsets;
 > +     struct objfile *objfile;
 >  {
 >    const bfd_size_type external_sym_size = debug_swap->external_sym_size;
 >    void (*const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *)) =
 > @@ -753,18 +754,18 @@ parse_symbol (sh, ax, ext_sh, bigend, se
 >           The value of a stBlock symbol is the displacement from the
 >           procedure address.  */
 >        if (sh->st != stEnd && sh->st != stBlock)
 > -	sh->value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +	sh->value += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >        break;
 >      case scData:
 >      case scSData:
 >      case scRData:
 >      case scPData:
 >      case scXData:
 > -      sh->value += ANOFFSET (section_offsets, SECT_OFF_DATA);
 > +      sh->value += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
 >        break;
 >      case scBss:
 >      case scSBss:
 > -      sh->value += ANOFFSET (section_offsets, SECT_OFF_BSS);
 > +      sh->value += ANOFFSET (section_offsets, SECT_OFF_BSS (objfile));
 >        break;
 >      }
 >  
 > @@ -2042,7 +2043,7 @@ parse_procedure (pr, search_symtab, pst)
 >           procedure descriptor in e->pdr.adr.
 >           As the address in the procedure descriptor is usually relative,
 >           we would have to relocate e->pdr.adr with cur_fdr->adr and
 > -         ANOFFSET (pst->section_offsets, SECT_OFF_TEXT).
 > +         ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (pst->objfile)).
 >           Unfortunately cur_fdr->adr and e->pdr.adr are both absolute
 >           in shared libraries on some systems, and on other systems
 >           e->pdr.adr is sometimes offset by a bogus value.
 > @@ -2102,13 +2103,14 @@ ecoff_relocate_efi (sym, delta)
 >  
 >     This routine clobbers top_stack->cur_block and ->cur_st. */
 >  
 > -static void parse_external PARAMS ((EXTR *, int, struct section_offsets *));
 > +static void parse_external PARAMS ((EXTR *, int, struct section_offsets *, struct objfile *));
 >  
 >  static void
 > -parse_external (es, bigend, section_offsets)
 > +parse_external (es, bigend, section_offsets, objfile)
 >       EXTR *es;
 >       int bigend;
 >       struct section_offsets *section_offsets;
 > +     struct objfile *objfile;
 >  {
 >    union aux_ext *ax;
 >  
 > @@ -2183,7 +2185,7 @@ parse_external (es, bigend, section_offs
 >  
 >        /* Note that the case of a symbol with indexNil must be handled
 >           anyways by parse_symbol().  */
 > -      parse_symbol (&es->asym, ax, (char *) NULL, bigend, section_offsets);
 > +      parse_symbol (&es->asym, ax, (char *) NULL, bigend, section_offsets, objfile);
 >        break;
 >      default:
 >        break;
 > @@ -2474,12 +2476,12 @@ parse_partial_symbols (objfile)
 >  	{
 >  	case stProc:
 >  	  /* Beginnning of Procedure */
 > -	  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	  break;
 >  	case stStaticProc:
 >  	  /* Load time only static procs */
 >  	  ms_type = mst_file_text;
 > -	  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	  break;
 >  	case stGlobal:
 >  	  /* External symbol */
 > @@ -2492,12 +2494,12 @@ parse_partial_symbols (objfile)
 >  	  else if (SC_IS_DATA (ext_in->asym.sc))
 >  	    {
 >  	      ms_type = mst_data;
 > -	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
 > +	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
 >  	    }
 >  	  else if (SC_IS_BSS (ext_in->asym.sc))
 >  	    {
 >  	      ms_type = mst_bss;
 > -	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
 > +	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
 >  	    }
 >  	  else
 >  	    ms_type = mst_abs;
 > @@ -2507,17 +2509,17 @@ parse_partial_symbols (objfile)
 >  	  if (SC_IS_TEXT (ext_in->asym.sc))
 >  	    {
 >  	      ms_type = mst_file_text;
 > -	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	    }
 >  	  else if (SC_IS_DATA (ext_in->asym.sc))
 >  	    {
 >  	      ms_type = mst_file_data;
 > -	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
 > +	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
 >  	    }
 >  	  else if (SC_IS_BSS (ext_in->asym.sc))
 >  	    {
 >  	      ms_type = mst_file_bss;
 > -	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
 > +	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
 >  	    }
 >  	  else
 >  	    ms_type = mst_abs;
 > @@ -2561,7 +2563,7 @@ parse_partial_symbols (objfile)
 >  	{
 >  	  textlow = fh->adr;
 >  	  if (relocatable || textlow != 0)
 > -	    textlow += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	    textlow += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	}
 >        else
 >  	textlow = 0;
 > @@ -2649,7 +2651,7 @@ parse_partial_symbols (objfile)
 >  		      CORE_ADDR procaddr;
 >  		      long isym;
 >  
 > -		      sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +		      sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  		      if (sh.st == stStaticProc)
 >  			{
 >  			  namestring = debug_info->ss + fh->issBase + sh.iss;
 > @@ -2657,7 +2659,7 @@ parse_partial_symbols (objfile)
 >  							       sh.value,
 >  							       mst_file_text,
 >  							       NULL,
 > -							       SECT_OFF_TEXT,
 > +							       SECT_OFF_TEXT (objfile),
 >  							       NULL,
 >  							       objfile);
 >  			}
 > @@ -2700,12 +2702,12 @@ parse_partial_symbols (objfile)
 >  			case scPData:
 >  			case scXData:
 >  			  namestring = debug_info->ss + fh->issBase + sh.iss;
 > -			  sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
 > +			  sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
 >  			  prim_record_minimal_symbol_and_info (namestring,
 >  							       sh.value,
 >  							       mst_file_data,
 >  							       NULL,
 > -							       SECT_OFF_DATA,
 > +							       SECT_OFF_DATA (objfile),
 >  							       NULL,
 >  							       objfile);
 >  			  break;
 > @@ -2714,12 +2716,12 @@ parse_partial_symbols (objfile)
 >  			  /* FIXME!  Shouldn't this use cases for bss, 
 >  			     then have the default be abs? */
 >  			  namestring = debug_info->ss + fh->issBase + sh.iss;
 > -			  sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
 > +			  sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
 >  			  prim_record_minimal_symbol_and_info (namestring,
 >  							       sh.value,
 >  							       mst_file_bss,
 >  							       NULL,
 > -							       SECT_OFF_BSS,
 > +							       SECT_OFF_BSS (objfile),
 >  							       NULL,
 >  							       objfile);
 >  			  break;
 > @@ -2818,18 +2820,18 @@ parse_partial_symbols (objfile)
 >  		  /* The value of a stEnd symbol is the displacement from the
 >  		     corresponding start symbol value, do not relocate it.  */
 >  		  if (sh.st != stEnd)
 > -		    sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +		    sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  		  break;
 >  		case scData:
 >  		case scSData:
 >  		case scRData:
 >  		case scPData:
 >  		case scXData:
 > -		  sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
 > +		  sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
 >  		  break;
 >  		case scBss:
 >  		case scSBss:
 > -		  sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
 > +		  sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
 >  		  break;
 >  		}
 >  
 > @@ -2842,7 +2844,7 @@ parse_partial_symbols (objfile)
 >  		case stStaticProc:
 >  		  prim_record_minimal_symbol_and_info (name, sh.value,
 >  						       mst_file_text, NULL,
 > -						       SECT_OFF_TEXT, NULL,
 > +						       SECT_OFF_TEXT (objfile), NULL,
 >  						       objfile);
 >  
 >  		  /* FALLTHROUGH */
 > @@ -2915,13 +2917,13 @@ parse_partial_symbols (objfile)
 >  		  if (SC_IS_DATA (sh.sc))
 >  		    prim_record_minimal_symbol_and_info (name, sh.value,
 >  							 mst_file_data, NULL,
 > -							 SECT_OFF_DATA,
 > +							 SECT_OFF_DATA (objfile),
 >  							 NULL,
 >  							 objfile);
 >  		  else
 >  		    prim_record_minimal_symbol_and_info (name, sh.value,
 >  							 mst_file_bss, NULL,
 > -							 SECT_OFF_BSS,
 > +							 SECT_OFF_BSS (objfile),
 >  							 NULL,
 >  							 objfile);
 >  		  class = LOC_STATIC;
 > @@ -3026,18 +3028,18 @@ parse_partial_symbols (objfile)
 >  		{
 >  		case scText:
 >  		case scRConst:
 > -		  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +		  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  		  break;
 >  		case scData:
 >  		case scSData:
 >  		case scRData:
 >  		case scPData:
 >  		case scXData:
 > -		  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
 > +		  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
 >  		  break;
 >  		case scBss:
 >  		case scSBss:
 > -		  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
 > +		  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
 >  		  break;
 >  		}
 >  
 > @@ -3435,7 +3437,7 @@ psymtab_to_symtab_1 (pst, filename)
 >  	      else
 >  		{
 >  		  /* Handle encoded stab line number. */
 > -		  valu += ANOFFSET (pst->section_offsets, SECT_OFF_TEXT);
 > +		  valu += ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (pst->objfile));
 >  		  record_line (current_subfile, sh.index, valu);
 >  		}
 >  	    }
 > @@ -3446,7 +3448,7 @@ psymtab_to_symtab_1 (pst, filename)
 >  	  else
 >  	    complain (&stab_unknown_complaint, name);
 >  	}
 > -      st = end_symtab (pst->texthigh, pst->objfile, SECT_OFF_TEXT);
 > +      st = end_symtab (pst->texthigh, pst->objfile, SECT_OFF_TEXT (pst->objfile));
 >        end_stabs ();
 >  
 >        /* Sort the symbol table now, we are done adding symbols to it.
 > @@ -3561,7 +3563,7 @@ psymtab_to_symtab_1 (pst, filename)
 >  	      (*swap_sym_in) (cur_bfd, sym_ptr, &sh);
 >  	      c = parse_symbol (&sh,
 >  				debug_info->external_aux + fh->iauxBase,
 > -				sym_ptr, fh->fBigendian, pst->section_offsets);
 > +				sym_ptr, fh->fBigendian, pst->section_offsets, pst->objfile);
 >  	      sym_ptr += c * external_sym_size;
 >  	    }
 >  
 > @@ -3629,7 +3631,7 @@ psymtab_to_symtab_1 (pst, filename)
 >  
 >        ext_ptr = PST_PRIVATE (pst)->extern_tab;
 >        for (i = PST_PRIVATE (pst)->extern_count; --i >= 0; ext_ptr++)
 > -	parse_external (ext_ptr, fh->fBigendian, pst->section_offsets);
 > +	parse_external (ext_ptr, fh->fBigendian, pst->section_offsets, pst->objfile);
 >  
 >        /* If there are undefined symbols, tell the user.
 >           The alpha has an undefined symbol for every symbol that is
 > Index: minsyms.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/minsyms.c,v
 > retrieving revision 1.6
 > diff -u -p -r1.6 minsyms.c
 > --- minsyms.c	2000/04/19 21:13:09	1.6
 > +++ minsyms.c	2000/04/30 14:43:40
 > @@ -609,15 +609,15 @@ prim_record_minimal_symbol (name, addres
 >      case mst_text:
 >      case mst_file_text:
 >      case mst_solib_trampoline:
 > -      section = SECT_OFF_TEXT;
 > +      section = SECT_OFF_TEXT (objfile);
 >        break;
 >      case mst_data:
 >      case mst_file_data:
 > -      section = SECT_OFF_DATA;
 > +      section = SECT_OFF_DATA (objfile);
 >        break;
 >      case mst_bss:
 >      case mst_file_bss:
 > -      section = SECT_OFF_BSS;
 > +      section = SECT_OFF_BSS (objfile);
 >        break;
 >      default:
 >        section = -1;
 > Index: mipsread.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/mipsread.c,v
 > retrieving revision 1.1.1.5
 > diff -u -p -r1.1.1.5 mipsread.c
 > --- mipsread.c	1999/09/08 23:59:22	1.1.1.5
 > +++ mipsread.c	2000/04/30 14:43:40
 > @@ -402,7 +402,7 @@ read_alphacoff_dynamic_symtab (section_o
 >  		ms_type = mst_text;
 >  	      else
 >  		ms_type = mst_file_text;
 > -	      sym_value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +	      sym_value += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >  	    }
 >  	  else if (sym_shndx == SHN_MIPS_DATA)
 >  	    {
 > @@ -410,7 +410,7 @@ read_alphacoff_dynamic_symtab (section_o
 >  		ms_type = mst_data;
 >  	      else
 >  		ms_type = mst_file_data;
 > -	      sym_value += ANOFFSET (section_offsets, SECT_OFF_DATA);
 > +	      sym_value += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
 >  	    }
 >  	  else if (sym_shndx == SHN_MIPS_ACOMMON)
 >  	    {
 > @@ -418,7 +418,7 @@ read_alphacoff_dynamic_symtab (section_o
 >  		ms_type = mst_bss;
 >  	      else
 >  		ms_type = mst_file_bss;
 > -	      sym_value += ANOFFSET (section_offsets, SECT_OFF_BSS);
 > +	      sym_value += ANOFFSET (section_offsets, SECT_OFF_BSS (objfile));
 >  	    }
 >  	  else if (sym_shndx == SHN_ABS)
 >  	    {
 > Index: objfiles.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/objfiles.c,v
 > retrieving revision 1.3
 > diff -u -p -r1.3 objfiles.c
 > --- objfiles.c	2000/03/15 16:55:07	1.3
 > +++ objfiles.c	2000/04/30 14:43:40
 > @@ -305,6 +305,14 @@ allocate_objfile (abfd, flags)
 >  	}
 >      }
 >  
 > +  /* Initialize the section indexes for this objfile, so that we can
 > +     later detect if they are used w/o being properly assigned to. */
 > +
 > +    objfile->sect_index_text = -1;
 > +    objfile->sect_index_data = -1;
 > +    objfile->sect_index_bss = -1;
 > +    objfile->sect_index_rodata = -1;
 > +
 >    /* Add this file onto the tail of the linked list of other such files. */
 >  
 >    objfile->next = NULL;
 > @@ -591,8 +599,8 @@ objfile_relocate (objfile, new_offsets)
 >  
 >      ALL_OBJFILE_PSYMTABS (objfile, p)
 >      {
 > -      p->textlow += ANOFFSET (delta, SECT_OFF_TEXT);
 > -      p->texthigh += ANOFFSET (delta, SECT_OFF_TEXT);
 > +      p->textlow += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
 > +      p->texthigh += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
 >      }
 >    }
 >  
 > @@ -643,41 +651,41 @@ objfile_relocate (objfile, new_offsets)
 >  
 >  	if (flags & SEC_CODE)
 >  	  {
 > -	    s->addr += ANOFFSET (delta, SECT_OFF_TEXT);
 > -	    s->endaddr += ANOFFSET (delta, SECT_OFF_TEXT);
 > +	    s->addr += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
 > +	    s->endaddr += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
 >  	  }
 >  	else if (flags & (SEC_DATA | SEC_LOAD))
 >  	  {
 > -	    s->addr += ANOFFSET (delta, SECT_OFF_DATA);
 > -	    s->endaddr += ANOFFSET (delta, SECT_OFF_DATA);
 > +	    s->addr += ANOFFSET (delta, SECT_OFF_DATA (objfile));
 > +	    s->endaddr += ANOFFSET (delta, SECT_OFF_DATA (objfile));
 >  	  }
 >  	else if (flags & SEC_ALLOC)
 >  	  {
 > -	    s->addr += ANOFFSET (delta, SECT_OFF_BSS);
 > -	    s->endaddr += ANOFFSET (delta, SECT_OFF_BSS);
 > +	    s->addr += ANOFFSET (delta, SECT_OFF_BSS (objfile));
 > +	    s->endaddr += ANOFFSET (delta, SECT_OFF_BSS (objfile));
 >  	  }
 >        }
 >    }
 >  
 >    if (objfile->ei.entry_point != ~(CORE_ADDR) 0)
 > -    objfile->ei.entry_point += ANOFFSET (delta, SECT_OFF_TEXT);
 > +    objfile->ei.entry_point += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
 >  
 >    if (objfile->ei.entry_func_lowpc != INVALID_ENTRY_LOWPC)
 >      {
 > -      objfile->ei.entry_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT);
 > -      objfile->ei.entry_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT);
 > +      objfile->ei.entry_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
 > +      objfile->ei.entry_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
 >      }
 >  
 >    if (objfile->ei.entry_file_lowpc != INVALID_ENTRY_LOWPC)
 >      {
 > -      objfile->ei.entry_file_lowpc += ANOFFSET (delta, SECT_OFF_TEXT);
 > -      objfile->ei.entry_file_highpc += ANOFFSET (delta, SECT_OFF_TEXT);
 > +      objfile->ei.entry_file_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
 > +      objfile->ei.entry_file_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
 >      }
 >  
 >    if (objfile->ei.main_func_lowpc != INVALID_ENTRY_LOWPC)
 >      {
 > -      objfile->ei.main_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT);
 > -      objfile->ei.main_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT);
 > +      objfile->ei.main_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
 > +      objfile->ei.main_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
 >      }
 >  
 >    /* Relocate breakpoints as necessary, after things are relocated. */
 > Index: objfiles.h
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/objfiles.h,v
 > retrieving revision 1.2
 > diff -u -p -r1.2 objfiles.h
 > --- objfiles.h	2000/03/07 04:33:52	1.2
 > +++ objfiles.h	2000/04/30 14:43:40
 > @@ -372,6 +372,18 @@ struct objfile
 >      struct section_offsets *section_offsets;
 >      int num_sections;
 >  
 > +    /* Indexes in the section_offsets array. These are initialized by the
 > +       *_symfile_offsets() family of functions (som_symfile_offsets,
 > +       xcoff_symfile_offsets, default_symfile_offsets). In theory they
 > +       should correspond to the section indexes used by bfd for the
 > +       current objfile. The exception to this for the time being is the
 > +       SOM version. */
 > +
 > +    int sect_index_text;
 > +    int sect_index_data;
 > +    int sect_index_bss;
 > +    int sect_index_rodata;
 > +
 >      /* These pointers are used to locate the section table, which
 >         among other things, is used to map pc addresses into sections.
 >         SECTIONS points to the first entry in the table, and
 > @@ -583,5 +595,21 @@ is_in_import_list PARAMS ((char *, struc
 >  #define ALL_OBJSECTIONS(objfile, osect)		\
 >    ALL_OBJFILES (objfile)			\
 >      ALL_OBJFILE_OSECTIONS (objfile, osect)
 > +
 > +#define SECT_OFF_DATA(objfile) \
 > +     ((objfile->sect_index_data == -1) ? \
 > +      (internal_error ("sect_index_data not initialized"), -1) : objfile->sect_index_data)
 > +
 > +#define SECT_OFF_RODATA(objfile) \
 > +     ((objfile->sect_index_rodata == -1) ? \
 > +      (internal_error ("sect_index_rodata not initialized"), -1) : objfile->sect_index_rodata)
 > +
 > +#define SECT_OFF_TEXT(objfile) \
 > +     ((objfile->sect_index_text == -1) ? \
 > +      (internal_error ("sect_index_text not initialized"), -1) : objfile->sect_index_text)
 > +
 > +#define SECT_OFF_BSS(objfile) \
 > +     ((objfile->sect_index_bss == -1) ? \
 > +      (internal_error ("sect_index_bss not initialized"), -1) : objfile->sect_index_bss)
 >  
 >  #endif /* !defined (OBJFILES_H) */
 > Index: os9kread.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/os9kread.c,v
 > retrieving revision 1.1.1.6
 > diff -u -p -r1.1.1.6 os9kread.c
 > --- os9kread.c	1999/09/08 23:59:23	1.1.1.6
 > +++ os9kread.c	2000/04/30 14:43:40
 > @@ -208,7 +208,7 @@ record_minimal_symbol (name, address, ty
 >      {
 >      case N_TEXT:
 >        ms_type = mst_text;
 > -      address += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +      address += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >        break;
 >      case N_DATA:
 >        ms_type = mst_data;
 > @@ -608,7 +608,7 @@ read_os9k_psymtab (objfile, text_addr, t
 >  #ifdef END_OF_TEXT_DEFAULT
 >    end_of_text_addr = END_OF_TEXT_DEFAULT;
 >  #else
 > -  end_of_text_addr = text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)
 > +  end_of_text_addr = text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))
 >      + text_size;		/* Relocate */
 >  #endif
 >  
 > @@ -655,7 +655,7 @@ read_os9k_psymtab (objfile, text_addr, t
 >  	  continue;
 >  
 >  	case N_SYM_SE:
 > -	  CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	  CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	  if (psymfile_depth == 1 && pst)
 >  	    {
 >  	      os9k_end_psymtab (pst, psymtab_include_list, includes_used,
 > @@ -692,7 +692,7 @@ read_os9k_psymtab (objfile, text_addr, t
 >  
 >  		valu = CUR_SYMBOL_VALUE;
 >  		if (valu)
 > -		  valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +		  valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  		past_first_source_file = 1;
 >  
 >  		p = strchr (namestring, ':');
 > @@ -884,7 +884,7 @@ read_os9k_psymtab (objfile, text_addr, t
 >  	      continue;
 >  
 >  	    case 'f':
 > -	      CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	      CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	      if (pst && pst->textlow == 0)
 >  		pst->textlow = CUR_SYMBOL_VALUE;
 >  
 > @@ -895,7 +895,7 @@ read_os9k_psymtab (objfile, text_addr, t
 >  	      continue;
 >  
 >  	    case 'F':
 > -	      CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	      CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  	      if (pst && pst->textlow == 0)
 >  		pst->textlow = CUR_SYMBOL_VALUE;
 >  
 > @@ -933,7 +933,7 @@ read_os9k_psymtab (objfile, text_addr, t
 >  	    }
 >  
 >  	case N_SYM_RBRAC:
 > -	  CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	  CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  #ifdef HANDLE_RBRAC
 >  	  HANDLE_RBRAC (CUR_SYMBOL_VALUE);
 >  	  continue;
 > @@ -1423,7 +1423,7 @@ os9k_read_ofile_symtab (pst)
 >       which comes from pst->textlow is correct. */
 >    if (last_source_start_addr == 0)
 >      last_source_start_addr = text_offset;
 > -  pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT);
 > +  pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile));
 >    end_stabs ();
 >  }
 >  \f
 > @@ -1473,12 +1473,12 @@ os9k_process_one_symbol (type, desc, val
 >      case N_SYM_LBRAC:
 >        /* On most machines, the block addresses are relative to the
 >           N_SO, the linker did not relocate them (sigh).  */
 > -      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >        new = push_context (desc, valu);
 >        break;
 >  
 >      case N_SYM_RBRAC:
 > -      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >        new = pop_context ();
 >  
 >  #if !defined (OS9K_VARIABLES_INSIDE_BLOCK)
 > @@ -1547,7 +1547,7 @@ os9k_process_one_symbol (type, desc, val
 >           one line-number -- core-address correspondence.
 >           Enter it in the line list for this symbol table. */
 >        /* Relocate for dynamic loading and for ELF acc fn-relative syms.  */
 > -      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >        /* FIXME: loses if sizeof (char *) > sizeof (int) */
 >        record_line (current_subfile, (int) name, valu);
 >        break;
 > @@ -1570,7 +1570,7 @@ os9k_process_one_symbol (type, desc, val
 >  	  switch (deftype)
 >  	    {
 >  	    case 'S':
 > -	      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +	      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >  	      n = strrchr (name, '/');
 >  	      if (n != NULL)
 >  		{
 > @@ -1588,7 +1588,7 @@ os9k_process_one_symbol (type, desc, val
 >  		{
 >  		  if (last_source_file)
 >  		    {
 > -		      end_symtab (valu, objfile, SECT_OFF_TEXT);
 > +		      end_symtab (valu, objfile, SECT_OFF_TEXT (objfile));
 >  		      end_stabs ();
 >  		    }
 >  		  start_stabs ();
 > @@ -1605,7 +1605,7 @@ os9k_process_one_symbol (type, desc, val
 >  
 >  	    case 'f':
 >  	    case 'F':
 > -	      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 > +	      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
 >  	      function_stab_type = type;
 >  
 >  	      within_function = 1;
 > @@ -1615,7 +1615,7 @@ os9k_process_one_symbol (type, desc, val
 >  
 >  	    case 'V':
 >  	    case 'v':
 > -	      valu += ANOFFSET (section_offsets, SECT_OFF_DATA);
 > +	      valu += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
 >  	      define_symbol (valu, name, desc, type, objfile);
 >  	      break;
 >  
 > Index: pa64solib.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/pa64solib.c,v
 > retrieving revision 1.2
 > diff -u -p -r1.2 pa64solib.c
 > --- pa64solib.c	2000/04/27 15:11:13	1.2
 > +++ pa64solib.c	2000/04/30 14:43:40
 > @@ -328,9 +328,9 @@ pa64_solib_load_symbols (so, name, from_
 >        return;
 >      }
 >  
 > -  ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT)
 > +  ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT (so->objfile))
 >      = so->pa64_solib_desc.text_base;
 > -  ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA)
 > +  ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA (so->objfile))
 >      = so->pa64_solib_desc.data_base;
 >  
 >    /* Relocate all the sections based on where they got loaded.  */
 > @@ -338,13 +338,13 @@ pa64_solib_load_symbols (so, name, from_
 >      {
 >        if (p->the_bfd_section->flags & SEC_CODE)
 >  	{
 > -	  p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT);
 > -	  p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT);
 > +	  p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT (so->objfile));
 > +	  p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT (so->objfile));
 >  	}
 >        else if (p->the_bfd_section->flags & SEC_DATA)
 >  	{
 > -	  p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA);
 > -	  p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA);
 > +	  p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA (so->objfile));
 > +	  p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA (so->objfile));
 >  	}
 >      }
 >  
 > Index: partial-stab.h
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/partial-stab.h,v
 > retrieving revision 1.2
 > diff -u -p -r1.2 partial-stab.h
 > --- partial-stab.h	2000/03/28 17:44:53	1.2
 > +++ partial-stab.h	2000/04/30 14:43:40
 > @@ -46,19 +46,19 @@ switch (CUR_SYMBOL_TYPE)
 >  
 >    case N_TEXT | N_EXT:
 >    case N_NBTEXT | N_EXT:
 > -    CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +    CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >      goto record_it;
 >  
 >    case N_DATA | N_EXT:
 >    case N_NBDATA | N_EXT:
 > -    CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
 > +    CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
 >      goto record_it;
 >  
 >    case N_BSS:
 >    case N_BSS | N_EXT:
 >    case N_NBBSS | N_EXT:
 >    case N_SETV | N_EXT:		/* FIXME, is this in BSS? */
 > -    CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
 > +    CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
 >      goto record_it;
 >  
 >    case N_ABS | N_EXT:
 > @@ -85,7 +85,7 @@ switch (CUR_SYMBOL_TYPE)
 >    case N_FN_SEQ:
 >    case N_TEXT:
 >  #ifdef DBXREAD_ONLY
 > -    CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +    CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >      SET_NAMESTRING ();
 >      if ((namestring[0] == '-' && namestring[1] == 'l')
 >  	|| (namestring[(nsl = strlen (namestring)) - 1] == 'o'
 > @@ -121,7 +121,7 @@ switch (CUR_SYMBOL_TYPE)
 >      continue;
 >  
 >    case N_DATA:
 > -    CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
 > +    CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
 >      goto record_it;
 >  
 >    case N_UNDF | N_EXT:
 > @@ -203,7 +203,7 @@ switch (CUR_SYMBOL_TYPE)
 >        char *p;
 >        int prev_textlow_not_set;
 >  
 > -      valu = CUR_SYMBOL_VALUE + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +      valu = CUR_SYMBOL_VALUE + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  
 >        prev_textlow_not_set = textlow_not_set;
 >  
 > @@ -423,7 +423,7 @@ switch (CUR_SYMBOL_TYPE)
 >      switch (p[1])
 >        {
 >        case 'S':
 > -	CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
 > +	CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
 >  #ifdef STATIC_TRANSFORM_NAME
 >  	namestring = STATIC_TRANSFORM_NAME (namestring);
 >  #endif
 > @@ -434,7 +434,7 @@ switch (CUR_SYMBOL_TYPE)
 >  			     psymtab_language, objfile);
 >  	continue;
 >        case 'G':
 > -	CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
 > +	CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
 >  	/* The addresses in these entries are reported to be
 >  	   wrong.  See the code that reads 'G's for symtabs. */
 >  	add_psymbol_to_list (namestring, p - namestring,
 > @@ -575,7 +575,7 @@ switch (CUR_SYMBOL_TYPE)
 >  	continue;
 >  
 >        case 'f':
 > -	CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  #ifdef DBXREAD_ONLY
 >  	/* Kludges for ELF/STABS with Sun ACC */
 >  	last_function_name = namestring;
 > @@ -602,7 +602,7 @@ switch (CUR_SYMBOL_TYPE)
 >  	if (textlow_not_set
 >  	    || (CUR_SYMBOL_VALUE < pst->textlow
 >  		&& CUR_SYMBOL_VALUE
 > -		!= ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)))
 > +		!= ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))))
 >  	  {
 >  	    pst->textlow = CUR_SYMBOL_VALUE;
 >  	    textlow_not_set = 0;
 > @@ -619,7 +619,7 @@ switch (CUR_SYMBOL_TYPE)
 >  	   are put into the global psymtab like one would expect.
 >  	   They're also in the minimal symbol table.  */
 >        case 'F':
 > -	CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 > +	CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 >  #ifdef DBXREAD_ONLY
 >  	/* Kludges for ELF/STABS with Sun ACC */
 >  	last_function_name = namestring;
 > @@ -627,7 +627,7 @@ switch (CUR_SYMBOL_TYPE)
 >  	/* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
 >  	   value for the bottom of the text seg in those cases. */
 >  	if (CUR_SYMBOL_VALUE == ANOFFSET (objfile->section_offsets, 
 > -	                                  SECT_OFF_TEXT))
 > +	                                  SECT_OFF_TEXT (objfile)))
 >  	  CUR_SYMBOL_VALUE = 
 >  	    find_stab_function_addr (namestring, pst->filename, objfile);
 >  	if (pst && textlow_not_set)
 > @@ -649,7 +649,7 @@ switch (CUR_SYMBOL_TYPE)
 >  	if (textlow_not_set
 >  	    || (CUR_SYMBOL_VALUE < pst->textlow
 >  		&& CUR_SYMBOL_VALUE
 > -		!= ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)))
 > +		!= ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))))
 >  	  {
 >  	    pst->textlow = CUR_SYMBOL_VALUE;
 >  	    textlow_not_set = 0;
 > Index: remote-os9k.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/remote-os9k.c,v
 > retrieving revision 1.2
 > diff -u -p -r1.2 remote-os9k.c
 > --- remote-os9k.c	2000/02/09 08:52:47	1.2
 > +++ remote-os9k.c	2000/04/30 14:43:40
 > @@ -514,8 +514,8 @@ rombug_wait (pid, status)
 >  	new_symfile_objfile (obj_sec->objfile, 1, 0);
 >        offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
 >        memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
 > -      ANOFFSET (offs, SECT_OFF_DATA) = addr;
 > -      ANOFFSET (offs, SECT_OFF_BSS) = addr;
 > +      ANOFFSET (offs, SECT_OFF_DATA (symfile_objfile)) = addr;
 > +      ANOFFSET (offs, SECT_OFF_BSS (symfile_objfile)) = addr;
 >  
 >        objfile_relocate (symfile_objfile, offs);
 >      }
 > Index: remote-vx.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/remote-vx.c,v
 > retrieving revision 1.2
 > diff -u -p -r1.2 remote-vx.c
 > --- remote-vx.c	2000/02/09 08:52:47	1.2
 > +++ remote-vx.c	2000/04/30 14:43:40
 > @@ -717,9 +717,9 @@ vx_add_symbols (name, from_tty, text_add
 >    bfd_map_over_sections (objfile->obfd, find_sect, &ss);
 >  
 >    /* Both COFF and b.out frontends use these SECT_OFF_* values.  */
 > -  ANOFFSET (offs, SECT_OFF_TEXT) = text_addr - ss.text_start;
 > -  ANOFFSET (offs, SECT_OFF_DATA) = data_addr - ss.data_start;
 > -  ANOFFSET (offs, SECT_OFF_BSS) = bss_addr - ss.bss_start;
 > +  ANOFFSET (offs, SECT_OFF_TEXT (so->objfile)) = text_addr - ss.text_start;
 > +  ANOFFSET (offs, SECT_OFF_DATA (so->objfile)) = data_addr - ss.data_start;
 > +  ANOFFSET (offs, SECT_OFF_BSS (so->objfile)) = bss_addr - ss.bss_start;
 >    objfile_relocate (objfile, offs);
 >  }
 >  
 > Index: remote.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/remote.c,v
 > retrieving revision 1.8
 > diff -u -p -r1.8 remote.c
 > --- remote.c	2000/04/17 02:27:37	1.8
 > +++ remote.c	2000/04/30 14:43:40
 > @@ -1803,14 +1803,14 @@ get_offsets ()
 >    offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
 >    memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
 >  
 > -  ANOFFSET (offs, SECT_OFF_TEXT) = text_addr;
 > +  ANOFFSET (offs, SECT_OFF_TEXT (symfile_objfile)) = text_addr;
 >  
 >    /* This is a temporary kludge to force data and bss to use the same offsets
 >       because that's what nlmconv does now.  The real solution requires changes
 >       to the stub and remote.c that I don't have time to do right now.  */
 >  
 > -  ANOFFSET (offs, SECT_OFF_DATA) = data_addr;
 > -  ANOFFSET (offs, SECT_OFF_BSS) = data_addr;
 > +  ANOFFSET (offs, SECT_OFF_DATA (symfile_objfile)) = data_addr;
 > +  ANOFFSET (offs, SECT_OFF_BSS (symfile_objfile)) = data_addr;
 >  
 >    objfile_relocate (symfile_objfile, offs);
 >  }
 > @@ -1918,9 +1918,9 @@ remote_cisco_objfile_relocate (text_off,
 >        offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
 >        memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
 >  
 > -      ANOFFSET (offs, SECT_OFF_TEXT) = text_off;
 > -      ANOFFSET (offs, SECT_OFF_DATA) = data_off;
 > -      ANOFFSET (offs, SECT_OFF_BSS) = bss_off;
 > +      ANOFFSET (offs, SECT_OFF_TEXT (symfile_objfile)) = text_off;
 > +      ANOFFSET (offs, SECT_OFF_DATA (symfile_objfile)) = data_off;
 > +      ANOFFSET (offs, SECT_OFF_BSS (symfile_objfile)) = bss_off;
 >  
 >        /* First call the standard objfile_relocate.  */
 >        objfile_relocate (symfile_objfile, offs);
 > Index: rs6000-nat.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
 > retrieving revision 1.4
 > diff -u -p -r1.4 rs6000-nat.c
 > --- rs6000-nat.c	2000/04/25 17:55:36	1.4
 > +++ rs6000-nat.c	2000/04/30 14:43:40
 > @@ -357,9 +357,9 @@ vmap_symtab (vp)
 >  
 >    /* The symbols in the object file are linked to the VMA of the section,
 >       relocate them VMA relative.  */
 > -  ANOFFSET (new_offsets, SECT_OFF_TEXT) = vp->tstart - vp->tvma;
 > -  ANOFFSET (new_offsets, SECT_OFF_DATA) = vp->dstart - vp->dvma;
 > -  ANOFFSET (new_offsets, SECT_OFF_BSS) = vp->dstart - vp->dvma;
 > +  ANOFFSET (new_offsets, SECT_OFF_TEXT (objfile)) = vp->tstart - vp->tvma;
 > +  ANOFFSET (new_offsets, SECT_OFF_DATA (objfile)) = vp->dstart - vp->dvma;
 > +  ANOFFSET (new_offsets, SECT_OFF_BSS (objfile)) = vp->dstart - vp->dvma;
 >  
 >    objfile_relocate (objfile, new_offsets);
 >  }
 > Index: somread.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/somread.c,v
 > retrieving revision 1.2
 > diff -u -p -r1.2 somread.c
 > --- somread.c	2000/04/21 14:24:45	1.2
 > +++ somread.c	2000/04/30 14:43:40
 > @@ -471,10 +471,24 @@ som_symfile_offsets (objfile, addrs)
 >    objfile->section_offsets = (struct section_offsets *)
 >      obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
 >  
 > +  /* FIXME: ezannoni 2000-04-20 The section names in SOM are not
 > +     .text, .data, etc, but $TEXT$, $DATA$,... We should initialize
 > +     SET_OFF_* from bfd. (See default_symfile_offsets()). But I don't
 > +     know the correspondence between SOM sections and GDB's idea of
 > +     section names. So for now we default to what is was before these
 > +     changes.*/
 > +  objfile->sect_index_text = 0;
 > +  objfile->sect_index_data = 1;
 > +  objfile->sect_index_bss = 2;
 > +  objfile->sect_index_rodata = 3;
 > +
 >    /* First see if we're a shared library.  If so, get the section
 >       offsets from the library, else get them from addrs.  */
 >    if (!som_solib_section_offsets (objfile, objfile->section_offsets))
 >      {
 > +      /* Note: Here is OK to compare with ".text" because this is the
 > +         name that gdb itself gives to that section, not the SOM
 > +         name. */
 >        for (i = 0; i < SECT_OFF_MAX && addrs->other[i].name; i++)
 >  	if (strcmp (addrs->other[i].name, ".text") == 0)
 >  	  break;
 > Index: somsolib.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/somsolib.c,v
 > retrieving revision 1.2
 > diff -u -p -r1.2 somsolib.c
 > --- somsolib.c	2000/04/21 14:24:45	1.2
 > +++ somsolib.c	2000/04/30 14:43:40
 > @@ -355,13 +355,13 @@ som_solib_load_symbols (so, name, from_t
 >      {
 >        if (p->the_bfd_section->flags & SEC_CODE)
 >  	{
 > -	  p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT);
 > -	  p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT);
 > +	  p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT (so->objfile));
 > +	  p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT (so->objfile));
 >  	}
 >        else if (p->the_bfd_section->flags & SEC_DATA)
 >  	{
 > -	  p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA);
 > -	  p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA);
 > +	  p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA (so->objfile));
 > +	  p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA (so->objfile));
 >  	}
 >      }
 >  
 > @@ -1407,11 +1407,11 @@ som_solib_section_offsets (objfile, offs
 >  	  asection *private_section;
 >  
 >  	  /* The text offset is easy.  */
 > -	  ANOFFSET (offsets, SECT_OFF_TEXT)
 > +	  ANOFFSET (offsets, SECT_OFF_TEXT (objfile))
 >  	    = (so_list->som_solib.text_addr
 >  	       - so_list->som_solib.text_link_addr);
 > -	  ANOFFSET (offsets, SECT_OFF_RODATA)
 > -	    = ANOFFSET (offsets, SECT_OFF_TEXT);
 > +	  ANOFFSET (offsets, SECT_OFF_RODATA (objfile))
 > +	    = ANOFFSET (offsets, SECT_OFF_TEXT (objfile));
 >  
 >  	  /* We should look at presumed_dp in the SOM header, but
 >  	     that's not easily available.  This should be OK though.  */
 > @@ -1420,14 +1420,14 @@ som_solib_section_offsets (objfile, offs
 >  	  if (!private_section)
 >  	    {
 >  	      warning ("Unable to find $PRIVATE$ in shared library!");
 > -	      ANOFFSET (offsets, SECT_OFF_DATA) = 0;
 > -	      ANOFFSET (offsets, SECT_OFF_BSS) = 0;
 > +	      ANOFFSET (offsets, SECT_OFF_DATA (objfile)) = 0;
 > +	      ANOFFSET (offsets, SECT_OFF_BSS (objfile)) = 0;
 >  	      return 1;
 >  	    }
 > -	  ANOFFSET (offsets, SECT_OFF_DATA)
 > +	  ANOFFSET (offsets, SECT_OFF_DATA (objfile))
 >  	    = (so_list->som_solib.data_start - private_section->vma);
 > -	  ANOFFSET (offsets, SECT_OFF_BSS)
 > -	    = ANOFFSET (offsets, SECT_OFF_DATA);
 > +	  ANOFFSET (offsets, SECT_OFF_BSS (objfile))
 > +	    = ANOFFSET (offsets, SECT_OFF_DATA (objfile));
 >  	  return 1;
 >  	}
 >        so_list = so_list->next;
 > Index: stabsread.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/stabsread.c,v
 > retrieving revision 1.3
 > diff -u -p -r1.3 stabsread.c
 > --- stabsread.c	2000/04/22 06:44:39	1.3
 > +++ stabsread.c	2000/04/30 14:43:41
 > @@ -1351,13 +1351,13 @@ define_symbol (valu, string, desc, type,
 >    switch (type & N_TYPE)
 >      {
 >      case N_TEXT:
 > -      SYMBOL_SECTION (sym) = SECT_OFF_TEXT;
 > +      SYMBOL_SECTION (sym) = SECT_OFF_TEXT (objfile);
 >        break;
 >      case N_DATA:
 > -      SYMBOL_SECTION (sym) = SECT_OFF_DATA;
 > +      SYMBOL_SECTION (sym) = SECT_OFF_DATA (objfile);
 >        break;
 >      case N_BSS:
 > -      SYMBOL_SECTION (sym) = SECT_OFF_BSS;
 > +      SYMBOL_SECTION (sym) = SECT_OFF_BSS (objfile);
 >        break;
 >      }
 >  
 > Index: symfile.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/symfile.c,v
 > retrieving revision 1.7
 > diff -u -p -r1.7 symfile.c
 > --- symfile.c	2000/04/17 16:09:04	1.7
 > +++ symfile.c	2000/04/30 14:43:41
 > @@ -518,33 +518,49 @@ default_symfile_offsets (objfile, addrs)
 >       struct section_addr_info *addrs;
 >  {
 >    int i;
 > +  asection *sect = NULL;
 >  
 >    objfile->num_sections = SECT_OFF_MAX;
 >    objfile->section_offsets = (struct section_offsets *)
 >      obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
 >    memset (objfile->section_offsets, 0, SIZEOF_SECTION_OFFSETS);
 >  
 > -  /* Now calculate offsets for other sections. */
 > +  /* Now calculate offsets for section that were specified by the
 > +     caller. */
 >    for (i = 0; i < MAX_SECTIONS && addrs->other[i].name; i++)
 >      {
 >        struct other_sections *osp ;
 >  
 >        osp = &addrs->other[i] ;
 > -      if (addrs->other[i].addr == 0)
 > +      if (osp->addr == 0)
 >    	continue;
 > -#if 0
 > -      if (strcmp (".text", osp->name) == 0)
 > -	SECT_OFF_TEXT = osp->sectindex ;
 > -      else if (strcmp (".data", osp->name) == 0)
 > -	SECT_OFF_DATA = osp->sectindex ;
 > -      else if (strcmp (".bss", osp->name) == 0)
 > -	SECT_OFF_BSS =  osp->sectindex ;
 > -#endif
 > +
 >        /* Record all sections in offsets */
 > +      /* The section_offsets in the objfile are here filled in using
 > +         the BFD index. */
 >        ANOFFSET (objfile->section_offsets, osp->sectindex) = osp->addr;
 >      }
 > -}
 >  
 > +  /* Remember the bfd indexes for the .text, .data, .bss and
 > +     .rodata sections. */
 > +
 > +  sect = bfd_get_section_by_name (objfile->obfd, ".text");
 > +  if (sect) 
 > +    objfile->sect_index_text = sect->index;
 > +
 > +  sect = bfd_get_section_by_name (objfile->obfd, ".data");
 > +  if (sect) 
 > +    objfile->sect_index_data = sect->index;
 > +
 > +  sect = bfd_get_section_by_name (objfile->obfd, ".bss");
 > +  if (sect) 
 > +    objfile->sect_index_bss = sect->index;
 > +
 > +  sect = bfd_get_section_by_name (objfile->obfd, ".rodata");
 > +  if (sect) 
 > +    objfile->sect_index_rodata = sect->index;
 > +
 > +}
 >  
 >  /* Process a symbol file, as either the main file or as a dynamically
 >     loaded file.
 > @@ -631,12 +647,12 @@ syms_from_objfile (objfile, addrs, mainl
 >        if (lower_sect == NULL)
 >  	warning ("no loadable sections found in added symbol-file %s",
 >  		 objfile->name);
 > -      else if ((bfd_get_section_flags (objfile->obfd, lower_sect) & SEC_CODE)
 > -	       == 0)
 > -	warning ("Lowest section in %s is %s at %s",
 > -		 objfile->name,
 > -		 bfd_section_name (objfile->obfd, lower_sect),
 > -		 paddr (bfd_section_vma (objfile->obfd, lower_sect)));
 > +      else 
 > +	if ((bfd_get_section_flags (objfile->obfd, lower_sect) & SEC_CODE) == 0)
 > +	  warning ("Lowest section in %s is %s at %s",
 > +		   objfile->name,
 > +		   bfd_section_name (objfile->obfd, lower_sect),
 > +		   paddr (bfd_section_vma (objfile->obfd, lower_sect)));
 >        if (lower_sect != NULL)
 >   	lower_offset = bfd_section_vma (objfile->obfd, lower_sect);
 >        else
 > Index: xcoffread.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/xcoffread.c,v
 > retrieving revision 1.1.1.9
 > diff -u -p -r1.1.1.9 xcoffread.c
 > --- xcoffread.c	1999/12/07 03:56:07	1.1.1.9
 > +++ xcoffread.c	2000/04/30 14:43:41
 > @@ -275,6 +275,7 @@ struct find_targ_sec_arg
 >      int targ_index;
 >      int *resultp;
 >      asection **bfd_sect;
 > +    struct objfile *objfile;
 >    };
 >  
 >  static void find_targ_sec PARAMS ((bfd *, asection *, void *));
 > @@ -286,15 +287,16 @@ find_targ_sec (abfd, sect, obj)
 >       PTR obj;
 >  {
 >    struct find_targ_sec_arg *args = (struct find_targ_sec_arg *) obj;
 > +  struct objfile *objfile = args->objfile;
 >    if (sect->target_index == args->targ_index)
 >      {
 >        /* This is the section.  Figure out what SECT_OFF_* code it is.  */
 >        if (bfd_get_section_flags (abfd, sect) & SEC_CODE)
 > -	*args->resultp = SECT_OFF_TEXT;
 > +	*args->resultp = SECT_OFF_TEXT (objfile);
 >        else if (bfd_get_section_flags (abfd, sect) & SEC_LOAD)
 > -	*args->resultp = SECT_OFF_DATA;
 > +	*args->resultp = SECT_OFF_DATA (objfile);
 >        else
 > -	*args->resultp = SECT_OFF_BSS;
 > +	*args->resultp = SECT_OFF_BSS (objfile);
 >        *args->bfd_sect = sect;
 >      }
 >  }
 > @@ -305,12 +307,13 @@ secnum_to_section (secnum, objfile)
 >       int secnum;
 >       struct objfile *objfile;
 >  {
 > -  int off = SECT_OFF_TEXT;
 > +  int off = SECT_OFF_TEXT (objfile);
 >    asection *sect = NULL;
 >    struct find_targ_sec_arg args;
 >    args.targ_index = secnum;
 >    args.resultp = &off;
 >    args.bfd_sect = &sect;
 > +  args.objfile = objfile;
 >    bfd_map_over_sections (objfile->obfd, find_targ_sec, &args);
 >    return off;
 >  }
 > @@ -321,7 +324,7 @@ secnum_to_bfd_section (secnum, objfile)
 >       int secnum;
 >       struct objfile *objfile;
 >  {
 > -  int off = SECT_OFF_TEXT;
 > +  int off = SECT_OFF_TEXT (objfile);
 >    asection *sect = NULL;
 >    struct find_targ_sec_arg args;
 >    args.targ_index = secnum;
 > @@ -849,7 +852,7 @@ enter_line_range (subfile, beginoffset, 
 >  	      ? int_lnno.l_addr.l_paddr
 >  	      : read_symbol_nvalue (int_lnno.l_addr.l_symndx));
 >        addr += ANOFFSET (this_symtab_psymtab->objfile->section_offsets,
 > -			SECT_OFF_TEXT);
 > +			SECT_OFF_TEXT (this_symtab_psymtab->objfile));
 >  
 >        if (addr < startaddr || (endaddr && addr >= endaddr))
 >  	return;
 > @@ -1095,7 +1098,7 @@ read_xcoff_symtab (pst)
 >  	  if (last_source_file)
 >  	    {
 >  	      pst->symtab =
 > -		end_symtab (cur_src_end_addr, objfile, SECT_OFF_TEXT);
 > +		end_symtab (cur_src_end_addr, objfile, SECT_OFF_TEXT (objfile));
 >  	      end_stabs ();
 >  	    }
 >  
 > @@ -1160,7 +1163,7 @@ read_xcoff_symtab (pst)
 >  			{
 >  			  complete_symtab (filestring, file_start_addr);
 >  			  cur_src_end_addr = file_end_addr;
 > -			  end_symtab (file_end_addr, objfile, SECT_OFF_TEXT);
 > +			  end_symtab (file_end_addr, objfile, SECT_OFF_TEXT (objfile));
 >  			  end_stabs ();
 >  			  start_stabs ();
 >  			  /* Give all csects for this source file the same
 > @@ -1180,7 +1183,7 @@ read_xcoff_symtab (pst)
 >  
 >  		      file_start_addr =
 >  			cs->c_value + ANOFFSET (objfile->section_offsets,
 > -						SECT_OFF_TEXT);
 > +						SECT_OFF_TEXT (objfile));
 >  		      file_end_addr = file_start_addr + CSECT_LEN (&main_aux);
 >  
 >  		      if (cs->c_name && cs->c_name[0] == '.')
 > @@ -1276,7 +1279,7 @@ read_xcoff_symtab (pst)
 >  
 >  	  complete_symtab (filestring, file_start_addr);
 >  	  cur_src_end_addr = file_end_addr;
 > -	  end_symtab (file_end_addr, objfile, SECT_OFF_TEXT);
 > +	  end_symtab (file_end_addr, objfile, SECT_OFF_TEXT (objfile));
 >  	  end_stabs ();
 >  
 >  	  /* XCOFF, according to the AIX 3.2 documentation, puts the filename
 > @@ -1311,7 +1314,7 @@ read_xcoff_symtab (pst)
 >  	  if (STREQ (cs->c_name, ".bf"))
 >  	    {
 >  	      CORE_ADDR off = ANOFFSET (objfile->section_offsets,
 > -					SECT_OFF_TEXT);
 > +					SECT_OFF_TEXT (objfile));
 >  	      bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
 >  				    0, cs->c_naux, &main_aux);
 >  
 > @@ -1323,7 +1326,7 @@ read_xcoff_symtab (pst)
 >  		(fcn_cs_saved.c_value + off,
 >  		 fcn_stab_saved.c_name, 0, 0, objfile);
 >  	      if (new->name != NULL)
 > -		SYMBOL_SECTION (new->name) = SECT_OFF_TEXT;
 > +		SYMBOL_SECTION (new->name) = SECT_OFF_TEXT (objfile);
 >  	    }
 >  	  else if (STREQ (cs->c_name, ".ef"))
 >  	    {
 > @@ -1356,7 +1359,7 @@ read_xcoff_symtab (pst)
 >  			    (fcn_cs_saved.c_value
 >  			     + fcn_aux_saved.x_sym.x_misc.x_fsize
 >  			     + ANOFFSET (objfile->section_offsets,
 > -					 SECT_OFF_TEXT)),
 > +					 SECT_OFF_TEXT (objfile))),
 >  			    objfile);
 >  	      within_function = 0;
 >  	    }
 > @@ -1426,7 +1429,7 @@ read_xcoff_symtab (pst)
 >  	      new = push_context (depth,
 >  				  (cs->c_value
 >  				   + ANOFFSET (objfile->section_offsets,
 > -					       SECT_OFF_TEXT)));
 > +					       SECT_OFF_TEXT (objfile))));
 >  	    }
 >  	  else if (STREQ (cs->c_name, ".eb"))
 >  	    {
 > @@ -1448,7 +1451,7 @@ read_xcoff_symtab (pst)
 >  				new->start_addr,
 >  				(cs->c_value
 >  				 + ANOFFSET (objfile->section_offsets,
 > -					     SECT_OFF_TEXT)),
 > +					     SECT_OFF_TEXT (objfile))),
 >  				objfile);
 >  		}
 >  	      local_symbols = new->locals;
 > @@ -1467,7 +1470,7 @@ read_xcoff_symtab (pst)
 >  
 >        complete_symtab (filestring, file_start_addr);
 >        cur_src_end_addr = file_end_addr;
 > -      s = end_symtab (file_end_addr, objfile, SECT_OFF_TEXT);
 > +      s = end_symtab (file_end_addr, objfile, SECT_OFF_TEXT (objfile));
 >        /* When reading symbols for the last C_FILE of the objfile, try
 >           to make sure that we set pst->symtab to the symtab for the
 >           file, not to the _globals_ symtab.  I'm not sure whether this
 > @@ -2763,22 +2766,43 @@ xcoff_symfile_offsets (objfile, addrs)
 >       struct objfile *objfile;
 >       struct section_addr_info *addrs;
 >  {
 > +  asection *sect = NULL;
 >    int i;
 >  
 >    objfile->num_sections = SECT_OFF_MAX;
 >    objfile->section_offsets = (struct section_offsets *)
 >      obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
 > +
 > +  /* Initialize the section indexes for future use. */
 > +  sect = bfd_get_section_by_name (objfile->obfd, ".text");
 > +  if (sect) 
 > +    objfile->sect_index_text = sect->index;
 > +
 > +  sect = bfd_get_section_by_name (objfile->obfd, ".data");
 > +  if (sect) 
 > +    objfile->sect_index_data = sect->index;
 > +
 > +  sect = bfd_get_section_by_name (objfile->obfd, ".bss");
 > +  if (sect) 
 > +    objfile->sect_index_bss = sect->index;
 > +
 > +  sect = bfd_get_section_by_name (objfile->obfd, ".rodata");
 > +  if (sect) 
 > +    objfile->sect_index_rodata = sect->index;
 >  
 > -  /* syms_from_objfile kindly subtracts from addr the bfd_section_vma
 > -     of the .text section.  This strikes me as wrong--whether the
 > -     offset to be applied to symbol reading is relative to the start
 > -     address of the section depends on the symbol format.  In any
 > -     event, this whole "addr" concept is pretty broken (it doesn't
 > -     handle any section but .text sensibly), so just ignore the addr
 > -     parameter and use 0.  rs6000-nat.c will set the correct section
 > -     offsets via objfile_relocate.  */
 >    for (i = 0; i < objfile->num_sections; ++i)
 > -    ANOFFSET (objfile->section_offsets, i) = 0;
 > +    {
 > +      /* syms_from_objfile kindly subtracts from addr the
 > +	 bfd_section_vma of the .text section.  This strikes me as
 > +	 wrong--whether the offset to be applied to symbol reading is
 > +	 relative to the start address of the section depends on the
 > +	 symbol format.  In any event, this whole "addr" concept is
 > +	 pretty broken (it doesn't handle any section but .text
 > +	 sensibly), so just ignore the addr parameter and use 0.
 > +	 rs6000-nat.c will set the correct section offsets via
 > +	 objfile_relocate.  */
 > +	ANOFFSET (objfile->section_offsets, i) = 0;
 > +    }
 >  }
 >  
 >  /* Register our ability to parse symbols for xcoff BFD files.  */
From dan@cgsoftware.com Wed May 03 07:56:00 2000
From: Daniel Berlin <dan@cgsoftware.com>
To: Jim Blandy <jimb@zwingli.cygnus.com>
Cc: Daniel Berlin <dan@cgsoftware.com>, gdb-patches@sourceware.cygnus.com
Subject: Re: Using typeinfo functions to determine RTTI
Date: Wed, 03 May 2000 07:56:00 -0000
Message-id: <ya5rel8d.fsf@dynamic-addr-88-117.resnet.rochester.edu>
References: <Pine.LNX.4.10.10005020923450.14281-100000@propylaea.anduin.com> <npu2ggf8g3.fsf@zwingli.cygnus.com>
X-SW-Source: 2000-05/msg00045.html
Content-length: 1194

Jim Blandy <jimb@zwingli.cygnus.com> writes:


> > Sorry i've been inactive, i've been bogged down by finals the past two
> > weeks. I've got a boat load of patches for C++ to commit to the trunk.
> 
> Sheesh.  Get your priorities straight.

I know.
What was i thinking?
Damnit, how can I be expected to study for abnormal psychology (the
study of my family), or constitutional law, when we've got a release
schedule to meet?


> 
> > Does anyone mind if i use the typeinfo functio name, rather than the
> > virtual table name, to figure out th real type of an object? It only
> > matters if someone does -fno-rtti, i believe. But I have no idea how many
> > people actually use that flag to save time/space in debugging
> > executables.
> 
> Almost all of Cygnus's customers use GDB to debug embedded apps, and
> space is often an issue there.  But I don't actually know how many of
> them use -fno-rtti.

Hmmm.
See, i've never actually run into problems with the way i do it now
(vtables) in real code.
I only noticed the problems when i started trying to get every single
test in virtfunc.exp to pass.

Does anyone actually write class hierarchies like those that are in
virtfunc.cc?

--Dan
From msnyder@cygnus.com Wed May 03 07:59:00 2000
From: Michael Snyder <msnyder@cygnus.com>
To: Jim Blandy <jimb@cygnus.com>
Cc: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>, gdb-patches@sourceware.cygnus.com, taylor@cygnus.com
Subject: Re: [PATCH]: Make Sparc Target Multi-Arch
Date: Wed, 03 May 2000 07:59:00 -0000
Message-id: <39103D79.5947@cygnus.com>
References: <200005022046.WAA14084@reisser.regent.e-technik.tu-muenchen.de> <npvh0wf8m3.fsf@zwingli.cygnus.com>
X-SW-Source: 2000-05/msg00046.html
Content-length: 928

Jim Blandy wrote:
> 
> > > What if I write the return struct size to the entry point address,
> > > following the trap instruction, and remove it when finished
> > > (like the trap instruction)?
> >
> > This will not work with nested user calls (breakpoint at called function,
> > stop there, call another user function [returning a struct :-)]).
> > It might be dangerous as well, as the entry point might just contain
> > a jump, and you might clobber code which will be called during the user
> > function (unlikely, but possible).
> [...]
> Alternatively, if we're using generic dummy frames, we could put each
> breakpoint / return size at a new address.  A synthetic call nested N
> deep would store its return breakpoint at ENTRY_POINT + K*N, for the
> appropriate value of K.

That would lose as soon as K*N > sizeof(entry_function), 'cause
then we might be putting call_dummy breakpoints in code that 
might be called.
From tromey@cygnus.com Wed May 03 08:45:00 2000
From: Tom Tromey <tromey@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: Re: Using typeinfo functions to determine RTTI
Date: Wed, 03 May 2000 08:45:00 -0000
Message-id: <871z3jsksh.fsf@cygnus.com>
References: <Pine.LNX.4.10.10005020923450.14281-100000@propylaea.anduin.com> <npu2ggf8g3.fsf@zwingli.cygnus.com>
X-SW-Source: 2000-05/msg00047.html
Content-length: 668

>> Does anyone mind if i use the typeinfo functio name, rather than
>> the virtual table name, to figure out th real type of an object? It
>> only matters if someone does -fno-rtti, i believe. But I have no
>> idea how many people actually use that flag to save time/space in
>> debugging executables.

Jim> Almost all of Cygnus's customers use GDB to debug embedded apps,
Jim> and space is often an issue there.  But I don't actually know how
Jim> many of them use -fno-rtti.

All Java programs are compiled with -fno-rtti.  This includes the C++
component.  So presumably if this change is made it will make it even
harder for me to debug libgcj.

Tom
From kettenis@wins.uva.nl Wed May 03 08:46:00 2000
From: Mark Kettenis <kettenis@wins.uva.nl>
To: dan@cgsoftware.com
Cc: jimb@zwingli.cygnus.com, dan@cgsoftware.com, gdb-patches@sourceware.cygnus.com
Subject: Re: Using typeinfo functions to determine RTTI
Date: Wed, 03 May 2000 08:46:00 -0000
Message-id: <200005031545.RAA18230@landau.wins.uva.nl>
References: <Pine.LNX.4.10.10005020923450.14281-100000@propylaea.anduin.com> <npu2ggf8g3.fsf@zwingli.cygnus.com> <ya5rel8d.fsf@dynamic-addr-88-117.resnet.rochester.edu>
X-SW-Source: 2000-05/msg00048.html
Content-length: 929

   From: Daniel Berlin <dan@cgsoftware.com>
   Date: 03 May 2000 10:56:02 -0400

   > > Does anyone mind if i use the typeinfo functio name, rather than the
   > > virtual table name, to figure out th real type of an object? It only
   > > matters if someone does -fno-rtti, i believe. But I have no idea how many
   > > people actually use that flag to save time/space in debugging
   > > executables.
   > 
   > Almost all of Cygnus's customers use GDB to debug embedded apps, and
   > space is often an issue there.  But I don't actually know how many of
   > them use -fno-rtti.

   Hmmm.
   See, i've never actually run into problems with the way i do it now
   (vtables) in real code.
   I only noticed the problems when i started trying to get every single
   test in virtfunc.exp to pass.

Is using typeinfo when available (if you expect that to be more
robust), and falling back on the vtables-approach an option?

Mark
From jimb@zwingli.cygnus.com Wed May 03 11:35:00 2000
From: Jim Blandy <jimb@zwingli.cygnus.com>
To: msnyder@cygnus.com
Cc: Jim Blandy <jimb@cygnus.com>, "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>, gdb-patches@sourceware.cygnus.com, taylor@cygnus.com
Subject: Re: [PATCH]: Make Sparc Target Multi-Arch
Date: Wed, 03 May 2000 11:35:00 -0000
Message-id: <npitwvfpnk.fsf@zwingli.cygnus.com>
References: <200005022046.WAA14084@reisser.regent.e-technik.tu-muenchen.de> <npvh0wf8m3.fsf@zwingli.cygnus.com> <39103D79.5947@cygnus.com>
X-SW-Source: 2000-05/msg00049.html
Content-length: 427

> That would lose as soon as K*N > sizeof(entry_function), 'cause
> then we might be putting call_dummy breakpoints in code that 
> might be called.

Picky, picky.  I think you should pick an address at random and set
the dummy breakpoint there.  I mean, small programs are easy to debug
without GDB, and in big programs, what are the chances you'd actually
hit the breakpoint by accident?

(Just trying to be constructive...)
From msnyder@cygnus.com Wed May 03 11:50:00 2000
From: Michael Snyder <msnyder@cygnus.com>
To: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH]: Make Sparc Target Multi-Arch
Date: Wed, 03 May 2000 11:50:00 -0000
Message-id: <3910741B.12FB@cygnus.com>
References: <200005030843.KAA15198@reisser.regent.e-technik.tu-muenchen.de>
X-SW-Source: 2000-05/msg00050.html
Content-length: 1304

Peter.Schauer wrote:
> 
> > > As the problematic calls are rare (Sun cc compiled 32 bit 
> > > ABI functions, returning structs), I think that we could 
> > > live with a warning and returning garbage in the return value.
> > > Personally I'd prefer that over AT_ENTRY hacking.
> >
> > Ah!  So you're saying this is a concern for Sparc32, but not
> > for Sparc64?
> > Then I have a solution.  I can easily use ON_STACK for Sparc32,
> > and AT_ENTRY_POINT for Sparc64.  That's the beauty of multi-arch! 
> >
> > Then the only losers will be people who activate C2 security 
> > on Sparc32.
> >
> > What do you think?
> 
> I don't have access to a v9 ABI, but looking at the generated v9
> code this seems to be a problem with Sparc32 only.
> 
> How hard would it be to default to AT_ENTRY for Sparc32 and make
> ON_STACK a user selectable option ?

Hmm, perhaps not impossible, but not trivial.  The gdbarch structs
get set up one time.  You'd have to change them on the fly.

As this user-selectability is an enhancement, how about if I make
it ON_STACK for 32, AT_ENTRY_POINT for 64, and check it in?  It
will be no worse for 32 than it is now, and much better for 64
(not to mention the 32/64 combo).  Then whoever wants to can
investigate making ON_STACK a user option for 32 at leisure.

				Michael
From msnyder@cygnus.com Wed May 03 12:55:00 2000
From: msnyder@cygnus.com
To: gdb-patches@sourceware.cygnus.com
Cc: nsd@bosbc.com, nsd@cygnus.com
Subject: [PATCH]: procfs fix for 64-bits (ATTN: Nick Duffek
Date: Wed, 03 May 2000 12:55:00 -0000
Message-id: <200005031955.MAA14413@seadog.cygnus.com>
X-SW-Source: 2000-05/msg00051.html
Content-length: 8059

There's a potential source of conflict here between Solaris and
UnixWare, so I'd like Nick to check these changes out on UnixWare
(if possible both in 32-bit and 64-bit native modes) before I
check them in.  If they conflict, then we'll have to do something
like:
#ifdef UNIXWARE
typedef int cmd_t;
#else
typedef long cmd_t;
#endif

Solaris declares this set of /proc parameters to be long.
UnixWare declares them to be int.  For Sparc32 it doesn't
make a difference, but for Sparc64 it does.

2000-05-03  Michael Snyder  <msnyder@seadog.cygnus.com>

        * procfs.c (int cmd;) Change to long cmd; affects many functions.
        The Sun documentation for procfs calls for these arguments to
        be longs.
        * proc-api.c (write_with_trace): Change int arg to long.
        Change int opcode to long.

Index: procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.6
diff -p -r1.6 procfs.c
*** procfs.c	2000/04/27 01:04:52	1.6
--- procfs.c	2000/05/03 19:46:44
*************** proc_stop_process (pi)
*** 1391,1397 ****
    else
      {
  #ifdef NEW_PROC_API
!       int cmd = PCSTOP;
        win = (write (pi->ctl_fd, (char *) &cmd, sizeof (cmd)) == sizeof (cmd));
  #else	/* ioctl method */
        win = (ioctl (pi->ctl_fd, PIOCSTOP, &pi->prstatus) >= 0);
--- 1391,1397 ----
    else
      {
  #ifdef NEW_PROC_API
!       long cmd = PCSTOP;
        win = (write (pi->ctl_fd, (char *) &cmd, sizeof (cmd)) == sizeof (cmd));
  #else	/* ioctl method */
        win = (ioctl (pi->ctl_fd, PIOCSTOP, &pi->prstatus) >= 0);
*************** proc_wait_for_stop (pi)
*** 1435,1441 ****
  
  #ifdef NEW_PROC_API
    {
!     int cmd = PCWSTOP;
      win = (write (pi->ctl_fd, (char *) &cmd, sizeof (cmd)) == sizeof (cmd));
      /* We been runnin' and we stopped -- need to update status.  */
      pi->status_valid = 0;
--- 1435,1441 ----
  
  #ifdef NEW_PROC_API
    {
!     long cmd = PCWSTOP;
      win = (write (pi->ctl_fd, (char *) &cmd, sizeof (cmd)) == sizeof (cmd));
      /* We been runnin' and we stopped -- need to update status.  */
      pi->status_valid = 0;
*************** proc_run_process (pi, step, signo)
*** 1512,1518 ****
  
  #ifdef NEW_PROC_API
    {
!     int cmd[2];
  
      cmd[0]  = PCRUN;
      cmd[1]  = runflags;
--- 1512,1518 ----
  
  #ifdef NEW_PROC_API
    {
!     long cmd[2];
  
      cmd[0]  = PCRUN;
      cmd[1]  = runflags;
*************** proc_set_traced_signals (pi, sigset)
*** 1558,1564 ****
  #ifdef NEW_PROC_API
    {
      struct {
!       int cmd;
        /* Use char array to avoid alignment issues.  */
        char sigset[sizeof (sigset_t)];
      } arg;
--- 1558,1564 ----
  #ifdef NEW_PROC_API
    {
      struct {
!       long cmd;
        /* Use char array to avoid alignment issues.  */
        char sigset[sizeof (sigset_t)];
      } arg;
*************** proc_set_traced_faults (pi, fltset)
*** 1606,1612 ****
  #ifdef NEW_PROC_API
    {
      struct {
!       int cmd;
        /* Use char array to avoid alignment issues.  */
        char fltset[sizeof (fltset_t)];
      } arg;
--- 1606,1612 ----
  #ifdef NEW_PROC_API
    {
      struct {
!       long cmd;
        /* Use char array to avoid alignment issues.  */
        char fltset[sizeof (fltset_t)];
      } arg;
*************** proc_set_traced_sysentry (pi, sysset)
*** 1652,1658 ****
  #ifdef NEW_PROC_API
    {
      struct {
!       int cmd;
        /* Use char array to avoid alignment issues.  */
        char sysset[sizeof (sysset_t)];
      } arg;
--- 1652,1658 ----
  #ifdef NEW_PROC_API
    {
      struct {
!       long cmd;
        /* Use char array to avoid alignment issues.  */
        char sysset[sizeof (sysset_t)];
      } arg;
*************** proc_set_traced_sysexit (pi, sysset)
*** 1698,1704 ****
  #ifdef NEW_PROC_API
    {
      struct {
!       int cmd;
        /* Use char array to avoid alignment issues.  */
        char sysset[sizeof (sysset_t)];
      } arg;
--- 1698,1704 ----
  #ifdef NEW_PROC_API
    {
      struct {
!       long cmd;
        /* Use char array to avoid alignment issues.  */
        char sysset[sizeof (sysset_t)];
      } arg;
*************** proc_set_held_signals (pi, sighold)
*** 1744,1750 ****
  #ifdef NEW_PROC_API
    {
      struct {
!       int cmd;
        /* Use char array to avoid alignment issues.  */
        char hold[sizeof (sigset_t)];
      } arg;
--- 1744,1750 ----
  #ifdef NEW_PROC_API
    {
      struct {
!       long cmd;
        /* Use char array to avoid alignment issues.  */
        char hold[sizeof (sigset_t)];
      } arg;
*************** proc_clear_current_fault (pi)
*** 2162,2168 ****
  
  #ifdef NEW_PROC_API
    {
!     int cmd = PCCFAULT;
      win = (write (pi->ctl_fd, (void *) &cmd, sizeof (cmd)) == sizeof (cmd));
    }
  #else
--- 2162,2168 ----
  
  #ifdef NEW_PROC_API
    {
!     long cmd = PCCFAULT;
      win = (write (pi->ctl_fd, (void *) &cmd, sizeof (cmd)) == sizeof (cmd));
    }
  #else
*************** proc_set_current_signal (pi, signo)
*** 2192,2198 ****
  {
    int win;
    struct {
!     int cmd;
      /* Use char array to avoid alignment issues.  */
      char sinfo[sizeof (struct siginfo)];
    } arg;
--- 2192,2198 ----
  {
    int win;
    struct {
!     long cmd;
      /* Use char array to avoid alignment issues.  */
      char sinfo[sizeof (struct siginfo)];
    } arg;
*************** proc_clear_current_signal (pi)
*** 2262,2268 ****
  #ifdef NEW_PROC_API
    {
      struct {
!       int cmd;
        /* Use char array to avoid alignment issues.  */
        char sinfo[sizeof (struct siginfo)];
      } arg;
--- 2262,2268 ----
  #ifdef NEW_PROC_API
    {
      struct {
!       long cmd;
        /* Use char array to avoid alignment issues.  */
        char sinfo[sizeof (struct siginfo)];
      } arg;
*************** proc_set_gregs (pi)
*** 2422,2428 ****
      {
  #ifdef NEW_PROC_API
        struct {
! 	int cmd;
  	/* Use char array to avoid alignment issues.  */
  	char gregs[sizeof (gdb_gregset_t)];
        } arg;
--- 2422,2428 ----
      {
  #ifdef NEW_PROC_API
        struct {
! 	long cmd;
  	/* Use char array to avoid alignment issues.  */
  	char gregs[sizeof (gdb_gregset_t)];
        } arg;
*************** proc_set_fpregs (pi)
*** 2466,2472 ****
      {
  #ifdef NEW_PROC_API
        struct {
! 	int cmd;
  	/* Use char array to avoid alignment issues.  */
  	char fpregs[sizeof (gdb_fpregset_t)];
        } arg;
--- 2466,2472 ----
      {
  #ifdef NEW_PROC_API
        struct {
! 	long cmd;
  	/* Use char array to avoid alignment issues.  */
  	char fpregs[sizeof (gdb_fpregset_t)];
        } arg;
*************** proc_kill (pi, signo)
*** 2530,2536 ****
    else
      {
  #ifdef NEW_PROC_API
!       int cmd[2];
  
        cmd[0] = PCKILL;
        cmd[1] = signo;
--- 2530,2536 ----
    else
      {
  #ifdef NEW_PROC_API
!       long cmd[2];
  
        cmd[0] = PCKILL;
        cmd[1] = signo;
*************** proc_set_watchpoint (pi, addr, len, wfla
*** 2594,2600 ****
    return 0;
  #else
    struct {
!     int cmd;
      char watch[sizeof (prwatch_t)];
    } arg;
    prwatch_t *pwatch;
--- 2594,2600 ----
    return 0;
  #else
    struct {
!     long cmd;
      char watch[sizeof (prwatch_t)];
    } arg;
    prwatch_t *pwatch;
Index: proc-api.c
===================================================================
RCS file: /cvs/src/src/gdb/proc-api.c,v
retrieving revision 1.2
diff -p -r1.2 proc-api.c
*** proc-api.c	2000/04/27 00:53:41	1.2
--- proc-api.c	2000/05/03 19:46:44
*************** static off_t lseek_offset;
*** 440,453 ****
  int
  write_with_trace (fd, arg, len, file, line)
       int  fd;
!      int *arg;
       size_t len;
       char *file;
       int  line;
  {
    int  i;
    int ret;
!   int opcode = arg[0];
  
    if (procfs_trace)
      {
--- 440,453 ----
  int
  write_with_trace (fd, arg, len, file, line)
       int  fd;
!      long *arg;
       size_t len;
       char *file;
       int  line;
  {
    int  i;
    int ret;
!   long opcode = arg[0];
  
    if (procfs_trace)
      {
From kevinb@cygnus.com Wed May 03 13:05:00 2000
From: Kevin Buettner <kevinb@cygnus.com>
To: msnyder@cygnus.com, gdb-patches@sourceware.cygnus.com
Cc: nsd@bosbc.com, nsd@cygnus.com
Subject: Re: [PATCH]: procfs fix for 64-bits (ATTN: Nick Duffek
Date: Wed, 03 May 2000 13:05:00 -0000
Message-id: <1000503200437.ZM29257@ocotillo.lan>
References: <200005031955.MAA14413@seadog.cygnus.com>
X-SW-Source: 2000-05/msg00052.html
Content-length: 463

On May 3, 12:55pm, msnyder@cygnus.com wrote:

> There's a potential source of conflict here between Solaris and
> UnixWare, so I'd like Nick to check these changes out on UnixWare
> (if possible both in 32-bit and 64-bit native modes) before I
> check them in.  If they conflict, then we'll have to do something
> like:
> #ifdef UNIXWARE
> typedef int cmd_t;
> #else
> typedef long cmd_t;
> #endif

If this is necessary, we should try to devise an autoconf test.
From kettenis@wins.uva.nl Wed May 03 13:19:00 2000
From: Mark Kettenis <kettenis@wins.uva.nl>
To: ac131313@cygnus.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [RFA] Fix stepping over signal trampoline.
Date: Wed, 03 May 2000 13:19:00 -0000
Message-id: <200005032019.e43KJ2u00599@delius.kettenis.local>
References: <200005010027.e410Ria00298@delius.kettenis.local> <390E7E6B.E4BC16AA@cygnus.com>
X-SW-Source: 2000-05/msg00053.html
Content-length: 535

   Date: Tue, 02 May 2000 17:06:19 +1000
   From: Andrew Cagney <ac131313@cygnus.com>

   > 2000-05-01  Mark Kettenis  <kettenis@gnu.org>
   > 
   >         * infrun.c (handle_inferior_event): When doing a "next", and
   >         stepping out of a signal handler into its calling trampoline
   >         ignore the value of step_frame_address.
   >         (step_over_function): Only modify step_resume_breakpoint->frame if
   >         the value of step_frame_address is non-zero.

   I think this one is ok.

OK, committed.

Mark



      reply	other threads:[~2000-05-02 13:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200005021109.NAA12981@reisser.regent.e-technik.tu-muenchen.de>
2000-05-02 10:13 ` Michael Snyder
2000-05-02 13:46   ` Peter.Schauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200005022046.WAA14084@reisser.regent.e-technik.tu-muenchen.de \
    --to=peter.schauer@regent.e-technik.tu-muenchen.de \
    --cc=gdb-patches@sourceware.cygnus.com \
    --cc=msnyder@cygnus.com \
    --cc=taylor@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox