From patchwork Tue Mar 21 19:18:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 66718 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DFCBA383FB98 for ; Tue, 21 Mar 2023 19:19:23 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from qproxy5-pub.mail.unifiedlayer.com (qproxy5-pub.mail.unifiedlayer.com [69.89.21.30]) by sourceware.org (Postfix) with ESMTPS id DD63E3858C1F for ; Tue, 21 Mar 2023 19:19:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DD63E3858C1F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from outbound-ss-761.bluehost.com (outbound-ss-761.bluehost.com [74.220.211.250]) by qproxy5.mail.unifiedlayer.com (Postfix) with ESMTP id 281C980402F8 for ; Tue, 21 Mar 2023 19:19:02 +0000 (UTC) Received: from cmgw13.mail.unifiedlayer.com (unknown [10.0.90.128]) by progateway8.mail.pro1.eigbox.com (Postfix) with ESMTP id 46E101003E917 for ; Tue, 21 Mar 2023 19:18:32 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id ehVApZXjDNX2aehVApFZmZ; Tue, 21 Mar 2023 19:18:32 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=NMAQR22g c=1 sm=1 tr=0 ts=641a0308 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10:nop_charset_1 a=k__wU0fu6RkA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=cg9eeq0_zgdFXRHdC-sA:9 a=QEXdDO2ut3YA:10:nop_charset_2 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xmI0M93ghXjLFru0Sm4upFLBIRZsnlb9ikD8ZxAQyDY=; b=RMmosP2tjFZ/vznW/lzskcWOWM szTCybOqTGW62+GarvnhIiDAyGb1YzAxKGmS9yXPGACDc/0ZUv6EvVTt4BlzE5nJaj4idQ0w/uaeJ mauam6BDA+LivlP0LH7lSwfqC; Received: from 71-211-185-113.hlrn.qwest.net ([71.211.185.113]:53618 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pehV9-00150d-S8 for gdb-patches@sourceware.org; Tue, 21 Mar 2023 13:18:31 -0600 From: Tom Tromey Date: Tue, 21 Mar 2023 13:18:28 -0600 Subject: [PATCH 3/6] Use unrelocated_addr in partial symbol tables MIME-Version: 1.0 Message-Id: <20230321-submit-unrelocated-type-v1-3-2a1fb6117abf@tromey.com> References: <20230321-submit-unrelocated-type-v1-0-2a1fb6117abf@tromey.com> In-Reply-To: <20230321-submit-unrelocated-type-v1-0-2a1fb6117abf@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.1 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.185.113 X-Source-L: No X-Exim-ID: 1pehV9-00150d-S8 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-185-113.hlrn.qwest.net ([192.168.0.21]) [71.211.185.113]:53618 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3025.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This changes partial symbol tables to use unrelocated_addr for the text_high and text_low members. This revealed some latent bugs in ctfread.c, which are fixed here. --- gdb/ctfread.c | 15 +++++++------- gdb/dbxread.c | 60 ++++++++++++++++++++++++++++++++------------------------ gdb/mdebugread.c | 32 ++++++++++++++++++------------ gdb/psympriv.h | 30 +++++++++++++++------------- gdb/psymtab.c | 4 ++-- gdb/stabsread.h | 2 +- gdb/xcoffread.c | 15 ++++++++------ 7 files changed, 89 insertions(+), 69 deletions(-) diff --git a/gdb/ctfread.c b/gdb/ctfread.c index 42f2da7a88f..41411abef2b 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -127,7 +127,7 @@ struct ctf_psymtab : public standard_psymtab ctf_psymtab (const char *filename, psymtab_storage *partial_symtabs, objfile_per_bfd_storage *objfile_per_bfd, - CORE_ADDR addr) + unrelocated_addr addr) : standard_psymtab (filename, partial_symtabs, objfile_per_bfd, addr) { } @@ -1232,10 +1232,10 @@ add_stt_func (struct ctf_context *ccp) add_stt_entries (ccp, 1); } -/* Get text segment base for OBJFILE, TSIZE contains the segment size. */ +/* Get text section base for OBJFILE, TSIZE contains the size. */ static CORE_ADDR -get_objfile_text_range (struct objfile *of, int *tsize) +get_objfile_text_range (struct objfile *of, size_t *tsize) { bfd *abfd = of->obfd.get (); const asection *codes; @@ -1405,14 +1405,14 @@ ctf_psymtab::read_symtab (struct objfile *objfile) /* Start a symtab. */ CORE_ADDR offset; /* Start of text segment. */ - int tsize; + size_t tsize; offset = get_objfile_text_range (objfile, &tsize); ctf_start_compunit_symtab (this, objfile, offset); expand_psymtab (objfile); - set_text_low (offset); - set_text_high (offset + tsize); + set_text_low (unrelocated_addr (0)); + set_text_high (unrelocated_addr (tsize)); compunit_symtab = ctf_end_compunit_symtab (this, offset + tsize); /* Finish up the debug error message. */ @@ -1442,7 +1442,8 @@ create_partial_symtab (const char *name, { ctf_psymtab *pst; - pst = new ctf_psymtab (name, partial_symtabs, objfile->per_bfd, 0); + pst = new ctf_psymtab (name, partial_symtabs, objfile->per_bfd, + unrelocated_addr (0)); pst->context.arc = arc; pst->context.fp = cfp; diff --git a/gdb/dbxread.c b/gdb/dbxread.c index e5366ccd0d0..1ae527e9bf3 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -296,7 +296,7 @@ static void add_old_header_file (const char *, int); static void add_this_object_header_file (int); static legacy_psymtab *start_psymtab (psymtab_storage *, struct objfile *, - const char *, CORE_ADDR, int); + const char *, unrelocated_addr, int); /* Free up old header file tables. */ @@ -1125,16 +1125,18 @@ read_dbx_symtab (minimal_symbol_reader &reader, || (namestring[(nsl = strlen (namestring)) - 1] == 'o' && namestring[nsl - 2] == '.')) { + unrelocated_addr unrel_val = unrelocated_addr (nlist.n_value); + if (past_first_source_file && pst /* The gould NP1 uses low values for .o and -l symbols which are not the address. */ - && nlist.n_value >= pst->raw_text_low ()) + && unrel_val >= pst->raw_text_low ()) { dbx_end_psymtab (objfile, partial_symtabs, pst, psymtab_include_list, includes_used, symnum * symbol_size, - nlist.n_value > pst->raw_text_high () - ? nlist.n_value : pst->raw_text_high (), + unrel_val > pst->raw_text_high () + ? unrel_val : pst->raw_text_high (), dependency_list, dependencies_used, textlow_not_set); pst = (legacy_psymtab *) 0; @@ -1246,11 +1248,12 @@ read_dbx_symtab (minimal_symbol_reader &reader, if (pst) { + unrelocated_addr unrel_value = unrelocated_addr (valu); dbx_end_psymtab (objfile, partial_symtabs, pst, psymtab_include_list, includes_used, symnum * symbol_size, - (valu > pst->raw_text_high () - ? valu : pst->raw_text_high ()), + (unrel_value > pst->raw_text_high () + ? unrel_value : pst->raw_text_high ()), dependency_list, dependencies_used, prev_textlow_not_set); pst = (legacy_psymtab *) 0; @@ -1291,7 +1294,8 @@ read_dbx_symtab (minimal_symbol_reader &reader, if (!pst) { pst = start_psymtab (partial_symtabs, objfile, - namestring, valu, + namestring, + unrelocated_addr (valu), first_so_symnum * symbol_size); pst->dirname = dirname_nso; dirname_nso = NULL; @@ -1416,13 +1420,14 @@ read_dbx_symtab (minimal_symbol_reader &reader, /* See if this is an end of function stab. */ if (pst && nlist.n_type == N_FUN && *namestring == '\000') { - CORE_ADDR valu; + unrelocated_addr valu; /* It's value is the size (in bytes) of the function for function relative stabs, or the address of the function's end for old style stabs. */ - valu = nlist.n_value + last_function_start; - if (pst->raw_text_high () == 0 || valu > pst->raw_text_high ()) + valu = unrelocated_addr (nlist.n_value + last_function_start); + if (pst->raw_text_high () == unrelocated_addr (0) + || valu > pst->raw_text_high ()) pst->set_text_high (valu); break; } @@ -1673,7 +1678,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, if (pst && textlow_not_set && gdbarch_sofun_address_maybe_missing (gdbarch)) { - pst->set_text_low (nlist.n_value); + pst->set_text_low (unrelocated_addr (nlist.n_value)); textlow_not_set = 0; } /* End kludge. */ @@ -1688,10 +1693,11 @@ read_dbx_symtab (minimal_symbol_reader &reader, the partial symbol table. */ if (pst && (textlow_not_set - || (nlist.n_value < pst->raw_text_low () + || (unrelocated_addr (nlist.n_value) + < pst->raw_text_low () && (nlist.n_value != 0)))) { - pst->set_text_low (nlist.n_value); + pst->set_text_low (unrelocated_addr (nlist.n_value)); textlow_not_set = 0; } if (pst != nullptr) @@ -1729,7 +1735,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, if (pst && textlow_not_set && gdbarch_sofun_address_maybe_missing (gdbarch)) { - pst->set_text_low (nlist.n_value); + pst->set_text_low (unrelocated_addr (nlist.n_value)); textlow_not_set = 0; } /* End kludge. */ @@ -1744,10 +1750,11 @@ read_dbx_symtab (minimal_symbol_reader &reader, the partial symbol table. */ if (pst && (textlow_not_set - || (nlist.n_value < pst->raw_text_low () + || (unrelocated_addr (nlist.n_value) + < pst->raw_text_low () && (nlist.n_value != 0)))) { - pst->set_text_low (nlist.n_value); + pst->set_text_low (unrelocated_addr (nlist.n_value)); textlow_not_set = 0; } if (pst != nullptr) @@ -1871,7 +1878,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, dbx_end_psymtab (objfile, partial_symtabs, pst, psymtab_include_list, includes_used, symnum * symbol_size, - (CORE_ADDR) 0, dependency_list, + (unrelocated_addr) 0, dependency_list, dependencies_used, textlow_not_set); pst = (legacy_psymtab *) 0; includes_used = 0; @@ -1928,11 +1935,11 @@ read_dbx_symtab (minimal_symbol_reader &reader, { /* Don't set high text address of PST lower than it already is. */ - CORE_ADDR text_end = - (lowest_text_address == (CORE_ADDR) -1 - ? text_addr - : lowest_text_address) - + text_size; + unrelocated_addr text_end + = unrelocated_addr ((lowest_text_address == (CORE_ADDR) -1 + ? text_addr + : lowest_text_address) + + text_size); dbx_end_psymtab (objfile, partial_symtabs, pst, psymtab_include_list, includes_used, @@ -1952,7 +1959,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, static legacy_psymtab * start_psymtab (psymtab_storage *partial_symtabs, struct objfile *objfile, - const char *filename, CORE_ADDR textlow, int ldsymoff) + const char *filename, unrelocated_addr textlow, int ldsymoff) { legacy_psymtab *result = new legacy_psymtab (filename, partial_symtabs, objfile->per_bfd, textlow); @@ -1983,7 +1990,7 @@ legacy_psymtab * dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs, legacy_psymtab *pst, const char **include_list, int num_includes, - int capping_symbol_offset, CORE_ADDR capping_text, + int capping_symbol_offset, unrelocated_addr capping_text, legacy_psymtab **dependency_list, int number_dependencies, int textlow_not_set) @@ -2037,8 +2044,9 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs, } if (minsym.minsym) - pst->set_text_high (minsym.minsym->value_raw_address () - + minsym.minsym->size ()); + pst->set_text_high + (unrelocated_addr (minsym.minsym->value_raw_address () + + minsym.minsym->size ())); last_function_name = NULL; } diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 43542eae673..4bcda4b9d74 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -2601,7 +2601,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, { legacy_psymtab *save_pst; EXTR *ext_ptr; - CORE_ADDR textlow; + unrelocated_addr textlow; cur_fdr = fh = debug_info->fdr + f_idx; @@ -2614,9 +2614,9 @@ parse_partial_symbols (minimal_symbol_reader &reader, /* Determine the start address for this object file from the file header and relocate it, except for Irix 5.2 zero fh->adr. */ if (fh->cpd) - textlow = fh->adr; + textlow = unrelocated_addr (fh->adr); else - textlow = 0; + textlow = unrelocated_addr (0); pst = new legacy_psymtab (fdr_name (fh), partial_symtabs, objfile->per_bfd, textlow); pst->read_symtab_private = XOBNEW (&objfile->objfile_obstack, md_symloc); @@ -2695,7 +2695,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, { if (sh.st == stProc || sh.st == stStaticProc) { - CORE_ADDR procaddr; + unrelocated_addr procaddr; long isym; if (sh.st == stStaticProc) @@ -2705,7 +2705,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, mst_file_text, sh.sc, objfile); } - procaddr = sh.value; + procaddr = unrelocated_addr (sh.value); isym = AUX_GET_ISYM (fh->fBigendian, (debug_info->external_aux @@ -2718,7 +2718,9 @@ parse_partial_symbols (minimal_symbol_reader &reader, &sh); if (sh.st == stEnd) { - CORE_ADDR high = procaddr + sh.value; + unrelocated_addr high + = unrelocated_addr (CORE_ADDR (procaddr) + + sh.value); /* Kludge for Irix 5.2 zero fh->adr. */ if (!relocatable @@ -3304,8 +3306,12 @@ parse_partial_symbols (minimal_symbol_reader &reader, continue; case N_RBRAC: - if (sh.value > save_pst->raw_text_high ()) - save_pst->set_text_high (sh.value); + { + unrelocated_addr unrel_value + = unrelocated_addr (sh.value); + if (unrel_value > save_pst->raw_text_high ()) + save_pst->set_text_high (unrel_value); + } continue; case N_EINCL: case N_DSLINE: @@ -3409,8 +3415,8 @@ parse_partial_symbols (minimal_symbol_reader &reader, switch (sh.st) { - CORE_ADDR high; - CORE_ADDR procaddr; + unrelocated_addr high; + unrelocated_addr procaddr; int new_sdx; case stStaticProc: @@ -3479,7 +3485,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, sh.value, psymtab_language, partial_symtabs, objfile); - procaddr = sh.value; + procaddr = unrelocated_addr (sh.value); cur_sdx = new_sdx; (*swap_sym_in) (cur_bfd, @@ -3496,7 +3502,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, || procaddr < pst->raw_text_low ())) pst->set_text_low (procaddr); - high = procaddr + sh.value; + high = unrelocated_addr (CORE_ADDR (procaddr) + sh.value); if (high > pst->raw_text_high ()) pst->set_text_high (high); continue; @@ -4005,7 +4011,7 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile) if (! last_symtab_ended) { - cust = end_compunit_symtab (pst->raw_text_high ()); + cust = end_compunit_symtab (pst->text_high (objfile)); end_stabs (); } diff --git a/gdb/psympriv.h b/gdb/psympriv.h index 332d6a62686..8fb595e2e0b 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -130,7 +130,7 @@ struct partial_symtab partial_symtab (const char *filename, psymtab_storage *partial_symtabs, objfile_per_bfd_storage *objfile_per_bfd, - CORE_ADDR addr) + unrelocated_addr addr) ATTRIBUTE_NONNULL (2) ATTRIBUTE_NONNULL (3); virtual ~partial_symtab () @@ -171,14 +171,16 @@ struct partial_symtab virtual struct compunit_symtab *get_compunit_symtab (struct objfile *) const = 0; - /* Return the raw low text address of this partial_symtab. */ - CORE_ADDR raw_text_low () const + /* Return the unrelocated low text address of this + partial_symtab. */ + unrelocated_addr raw_text_low () const { return m_text_low; } - /* Return the raw high text address of this partial_symtab. */ - CORE_ADDR raw_text_high () const + /* Return the unrelocated_addr high text address of this + partial_symtab. */ + unrelocated_addr raw_text_high () const { return m_text_high; } @@ -186,24 +188,24 @@ struct partial_symtab /* Return the relocated low text address of this partial_symtab. */ CORE_ADDR text_low (struct objfile *objfile) const { - return m_text_low + objfile->text_section_offset (); + return CORE_ADDR (m_text_low) + objfile->text_section_offset (); } /* Return the relocated high text address of this partial_symtab. */ CORE_ADDR text_high (struct objfile *objfile) const { - return m_text_high + objfile->text_section_offset (); + return CORE_ADDR (m_text_high) + objfile->text_section_offset (); } /* Set the low text address of this partial_symtab. */ - void set_text_low (CORE_ADDR addr) + void set_text_low (unrelocated_addr addr) { m_text_low = addr; text_low_valid = 1; } - /* Set the hight text address of this partial_symtab. */ - void set_text_high (CORE_ADDR addr) + /* Set the high text address of this partial_symtab. */ + void set_text_high (unrelocated_addr addr) { m_text_high = addr; text_high_valid = 1; @@ -283,8 +285,8 @@ struct partial_symtab fields; these are located later in this structure for better packing. */ - CORE_ADDR m_text_low = 0; - CORE_ADDR m_text_high = 0; + unrelocated_addr m_text_low {}; + unrelocated_addr m_text_high {}; /* If NULL, this is an ordinary partial symbol table. @@ -372,7 +374,7 @@ struct standard_psymtab : public partial_symtab standard_psymtab (const char *filename, psymtab_storage *partial_symtabs, objfile_per_bfd_storage *objfile_per_bfd, - CORE_ADDR addr) + unrelocated_addr addr) : partial_symtab (filename, partial_symtabs, objfile_per_bfd, addr) { } @@ -414,7 +416,7 @@ struct legacy_psymtab : public standard_psymtab legacy_psymtab (const char *filename, psymtab_storage *partial_symtabs, objfile_per_bfd_storage *objfile_per_bfd, - CORE_ADDR addr) + unrelocated_addr addr) : standard_psymtab (filename, partial_symtabs, objfile_per_bfd, addr) { } diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 95a53b90edd..484199b4be2 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1110,7 +1110,7 @@ psymbol_functions::has_unexpanded_symtabs (struct objfile *objfile) partial_symtab::partial_symtab (const char *filename, psymtab_storage *partial_symtabs, objfile_per_bfd_storage *objfile_per_bfd, - CORE_ADDR textlow) + unrelocated_addr textlow) : partial_symtab (filename, partial_symtabs, objfile_per_bfd) { set_text_low (textlow); @@ -1653,7 +1653,7 @@ maintenance_check_psymtabs (const char *ignore, int from_tty) gdb_printf (" psymtab\n"); } } - if (ps->raw_text_high () != 0 + if (ps->raw_text_high () != unrelocated_addr (0) && (ps->text_low (objfile) < b->start () || ps->text_high (objfile) > b->end ())) { diff --git a/gdb/stabsread.h b/gdb/stabsread.h index 9df79bc7dfa..27ba176f63f 100644 --- a/gdb/stabsread.h +++ b/gdb/stabsread.h @@ -175,7 +175,7 @@ extern legacy_psymtab *dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs, legacy_psymtab *pst, const char **include_list, int num_includes, - int capping_symbol_offset, CORE_ADDR capping_text, + int capping_symbol_offset, unrelocated_addr capping_text, legacy_psymtab **dependency_list, int number_dependencies, int textlow_not_set); diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index a07f40b5702..c829fb2aea0 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1875,7 +1875,8 @@ xcoff_start_psymtab (psymtab_storage *partial_symtabs, { /* We fill in textlow later. */ legacy_psymtab *result = new legacy_psymtab (filename, partial_symtabs, - objfile->per_bfd, 0); + objfile->per_bfd, + unrelocated_addr (0)); result->read_symtab_private = XOBNEW (&objfile->objfile_obstack, struct xcoff_symloc); @@ -2172,14 +2173,16 @@ scan_xcoff_symtab (minimal_symbol_reader &reader, } if (pst != NULL) { - CORE_ADDR highval = - symbol.n_value + csect_aux.x_csect.x_scnlen.l; + unrelocated_addr highval + = unrelocated_addr (symbol.n_value + + csect_aux.x_csect.x_scnlen.l); if (highval > pst->raw_text_high ()) pst->set_text_high (highval); - if (!pst->text_low_valid - || symbol.n_value < pst->raw_text_low ()) - pst->set_text_low (symbol.n_value); + unrelocated_addr loval + = unrelocated_addr (symbol.n_value); + if (!pst->text_low_valid || loval < pst->raw_text_low ()) + pst->set_text_low (loval); } misc_func_recorded = 0; break;