From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2066.outbound.protection.outlook.com [40.107.236.66]) by sourceware.org (Postfix) with ESMTPS id B6AC53857405 for ; Mon, 14 Mar 2022 11:15:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B6AC53857405 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kxvx5HCh/JVD1wWtTSpmQUl2WW82v9P9B5l1vHDjMjMBlmiWFmWhhNNrCHDdmfiw5msAy18VA1SXAf4dIruMQfQZf2kh0CukWz9tYrr6iqR8/v/DQlKZsIvG10+JupcJmKlexsSbyiz8N7FtCUT33pLUgSm55ltwAK1RaYZ8cU0i6+YKGtFTWIDlefXNckethLvYrSNw5FwRq92jODbOS+6a0ThXMT6gkNL14p0MUhKv4TKcHTxeuyF+KOBMhB3Ve6iC69c+VATPf6tj9Cv1HN8VnL2V5VSaxex30S01QEALko///tRKkJS9pfqIVE7v4vPQgi3G2ZX9h15DaOk2fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KKAH+eQKv/ZCxgqjUDWmlJmzrOlV8ewUpz3uW0yKyHc=; b=iCtyUrR1NwHmnuA+horfW8S/wiba0xG+QxIQItl2XdVyj4xXElJH2pacOTOIVnDG2g9wJ77j+Bith215/qnyHMgtIu40ktMFyPHcMQikL3Lrczx4w9FDrbtFBDEu0podEfvVaUrJFvRyMeIN0KWaeEfSqwk1060LdqCKg7lK43ed7fMNZ5j/n6pyaHNYie+tPwaYsPA+x1MKE1XbU7Ydd29pS0NyLMbSdScg+QcAwP0L8dxo8MXGVczqsAPM8LAHHmcisijKXCNsfYUCaLmsDHYt5FgiEIrUGcHueU5xiA9Cy/oWXtHcGadM2cz70dE85LRK28jN3fRQYjrIOyHBkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none Received: from DM4PR12MB5796.namprd12.prod.outlook.com (2603:10b6:8:63::16) by DM6PR12MB3417.namprd12.prod.outlook.com (2603:10b6:5:118::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22; Mon, 14 Mar 2022 11:15:16 +0000 Received: from DM4PR12MB5796.namprd12.prod.outlook.com ([fe80::c1c5:fe5b:5a50:ba4d]) by DM4PR12MB5796.namprd12.prod.outlook.com ([fe80::c1c5:fe5b:5a50:ba4d%6]) with mapi id 15.20.5061.028; Mon, 14 Mar 2022 11:15:16 +0000 From: "Natarajan, Kavitha" To: "Natarajan, Kavitha via Gdb-patches" CC: "Parasuraman, Hariharan" , "George, Jini Susan" Subject: RE: [PATCH] Debug support for global alias variable Thread-Topic: [PATCH] Debug support for global alias variable Thread-Index: Adgvx/KC9Ls2FcnvTJeRu5jcNWYisQHxHiHg Date: Mon, 14 Mar 2022 11:15:16 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_ActionId=dc9d7c15-1086-43c9-8bfb-09c6455a1224; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_ContentBits=0; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Enabled=true; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Method=Standard; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Name=AMD Official Use Only-AIP 2.0; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_SetDate=2022-03-04T12:57:32Z; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6f4ea9eb-4b1a-4a9c-c34d-08da05abeac1 x-ms-traffictypediagnostic: DM6PR12MB3417:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oe+HZCpfoSB+06jpSOtuqOF8MLU+BsqZ4O+LIQl/OQjcTgm6FcHzwqf2ZMQmQYDVnaEVYpyvQpQTZnzDMxYyLKRaiAkqjVbb0WjerisV12WCnamyjMIerQS23S8LMLf5J1VNKy+BEuhC2fiqNUWmoFOwIFhCw3FdXReHsforBMfZKGYb40Xm5BtSg+4KD+7jtkOH/YyJiUyOnUTsRTOF5aj0foX/21PP9zwbD1R9l89J8v2eGL+Sz9MqE3H8/pWHvDxPVdZLgZuFFe7EuviHvxvwSjXvUD1M2FWxRGI03J04Ud7OKgbBVG896+ZkRuvY5ZVpEEWLgxXSItzXWeiJQJ511P9QRcgd5Op45MzkaykLFYKUQwPe/VbiHTHPK6VfXLwJm9CFVUamJ+bgdE9tkepjE/gLP+arau7y8uCIeTxLJHiNzIXj7zdoVV28lVdd7m52UN6CVVjV0oBnmRuArAyWOul4PZ+a/Wsv72yhSaCNywjDNVh3HP+PXg6J4jEXm32P0XSZiBWGWfPIxOL0ZU8tHKXMp+nM2Q19txXvR4X8QPaNg+tKOl11gRCMEOXTTJL3oxxTfe10yKoofkE4kmLCCXt4K7Np9utsYf4oY00gjeK72rCd8x6Aj1SuKmYhptNB0L/9VqmhoFqd/2NZvw2kRo4hVWRPH83eQw1cEk2+idnKal/63VpN5c5tSQkYreDFajCpoJL+jxdT0FoHRAbnbDUZv6D1Me8K/IUlPCkHzQSKdCzmfN6yEPy17VirUW7DV0VwRxPSr0lG6cA70EhohgGscPwALisb9QI+SnffXRXCpT7SJ2or9uApyYsmNKTkYRT3eyXAvbZzW39Dlw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5796.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(83380400001)(52536014)(71200400001)(38070700005)(6506007)(6916009)(54906003)(9686003)(38100700002)(7696005)(26005)(8936002)(53546011)(186003)(508600001)(966005)(122000001)(316002)(2906002)(86362001)(166002)(5660300002)(33656002)(84970400001)(66556008)(55016003)(66446008)(21615005)(64756008)(66476007)(8676002)(4326008)(76116006)(66946007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?y/+NTqI61o5ZhFEtykNU6wD1dTU84o36ui4Q1/Gn0PYvdWbGnjBjkP9e7E43?= =?us-ascii?Q?Q2+07ygqzSzzwrVxWEJf56oou2jath4PqXEoLttvoMvGNLCDWeQZyIlsnuzc?= =?us-ascii?Q?ljcuDHlxEp1X22jeRAS36JwMzyjYda1IefHZLhMQ4HkYOerudsuxJEv2+K5v?= =?us-ascii?Q?v+bXqhP98LROnrustzCE0TYydSjn/mFi6ui6KxQdDLQq4HQYBZMl7x52fj98?= =?us-ascii?Q?VTTPI5JtQklX6w98wNjhKHXKjyQr+G1yp1jAf2czyBFZbDiWBzbnvybr8ySM?= =?us-ascii?Q?wwaemck8JBtcdzKU2e0o3scA4F82PnJXSAEB9IZw9Xg09Ul15rOBmDnrdtR0?= =?us-ascii?Q?VSV+aqdKs4JFcJdC7QPJlxxNdZnj2NqWoCnMG6fAcf0eRBHXz5Dk3FR8l4Vq?= =?us-ascii?Q?+P1L6tK0UAbwoKU7VpJUXcRw5nNqNDB+ODMscsXuW3cEyp8ex1luleJ6/02A?= =?us-ascii?Q?01RH7Bsi6eFTX1T2FsW74MS1U9eW6OtSGIzzn6ongsZNknAXeLg2qIX1HLf4?= =?us-ascii?Q?u1yRnHigU12FKXFTvEC0T1VKpIOI8G6SrjVy2DXK5UAhnova0183jfX7D5Im?= =?us-ascii?Q?HpTreMPEQM6zJws53T6DvNt9kZKbQXccq7MRUUTe+nkbJNuRJ2o2WFBnezNZ?= =?us-ascii?Q?z9qC1Wi5MVqSLE6S5LlcK9FB7g9tK/ks8Zd/To7DqnlFKf6ujwLYXbVFrc/p?= =?us-ascii?Q?Bk2m5BgL5ZgyCQYjX9mMfobLTHGIc+EnVJg1zkEtMq/tE/UjjQp7VKOstylW?= =?us-ascii?Q?MyiXrLIa2WWp3HzZkZBbGNmH+1td2S+n9rxrF9smMP5RDGz+43auS4gs22jV?= =?us-ascii?Q?zyK01/GYySdI8nvfKUBZso7p8oQGvsitVV3RF1ujcnSMokt3FujZ8QGy4m4L?= =?us-ascii?Q?YaV7u10pfYfqIlMgikC/ZiahzuueJFGtTI0zpWzZEavU4GJEfWDtEklWAugJ?= =?us-ascii?Q?pp9EfpMp7zOiTxg18Skl9zKuYWRqwKJgq463P0cxlu6nnHDDvLU1tauORWNY?= =?us-ascii?Q?rPzqIjdULwUGuTrYOrGqJRsQ0mI2gZP/uhGKRZryR6LwtMcdaKXnB0NyttlU?= =?us-ascii?Q?ZVtRcHCksOmn8jHs5tvfsARydQnIS39oGPJtaL5rbmsdJ7IgCVbXSZGq4iA6?= =?us-ascii?Q?fN9/KMGjV+ObW96QlWAnsw2BmpwOKNaRxGqmmP3OB32wo200YFKJaEOUgMGf?= =?us-ascii?Q?KxEG2UyxXG3j/Rn9DlOJirSdgcUU8bJCra7wEH8LbAr1Oh32ZxTwiS2i9qDg?= =?us-ascii?Q?cO/7osVXLoqRWF5MrXunnVhh7hj6zFy981aYRJedJ6py/zbxpinZr+FdESek?= =?us-ascii?Q?EhO7EFQac9v6QLGM4PC8wM5SO4DcSuvkiGFZunbbbBvuGnIpeGb7xNKCu3eA?= =?us-ascii?Q?tQ/J0lBej7AcqkG3y8DY1TGu0wuUjikOFO3ztDhM1xLfShAc3UaBhSUgr5K5?= =?us-ascii?Q?O7e4YpVz2wrdAMxbb1HQaZCiAUAv+uvH?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5796.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f4ea9eb-4b1a-4a9c-c34d-08da05abeac1 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Mar 2022 11:15:16.1522 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dab07uCL464tXtYurjIx0cOaQaw25S29J5L6cdAkni0PI+DJf1cCDOXhVjMRAIIqWeYWCYenNYZelDpbKdO0Pw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3417 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, HTML_MESSAGE, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: , X-List-Received-Date: Mon, 14 Mar 2022 11:15:24 -0000 [AMD Official Use Only] Appreciate your review comments on this patch. Thanks, Kavitha From: Natarajan, Kavitha Sent: Friday, March 4, 2022 7:15 PM To: Natarajan, Kavitha via Gdb-patches Subject: [PATCH] Debug support for global alias variable Hi, For the below testcase, when compiled with clang compiler, debugger is not = able to print alias variable type or value. $ cat test.c int oldname =3D 1; extern int newname attribute((alias("oldname"))); int main () { return 0; } $ clang -g -O0 test.c $ gdb a.out (gdb) ptype oldname type =3D int (gdb) ptype newname type =3D (gdb) p oldname $1 =3D 1 (gdb) p newname 'newname' has unknown type; cast it to its declared type This is because clang is not emitting dwarf information for alias variable.= I have updated clang patch (originally from https://reviews.llvm.org/D1031= 31) to emit debug info for alias variable as imported entity (DW_TAG_import= ed_declaration): https://reviews.llvm.org/D120989 However, gdb cannot handle the imported declaration for alias variables. GC= C emits debug info for alias variables as DW_TAG_variable which gdb can han= dle. The discussions in the llvm bug report bug-50052 and above review links talk about why it is appro= priate to emit alias variable as DW_TAG_imported_declaration rather than DW= _TAG_variable. Refer section "3.2.3 Imported (or Renamed) Declaration Entri= es" in DWARF 5 specification. It was also previously discussed in gdb forum= in the below thread: https://sourceware.org/pipermail/gdb/2021-June/049509.html The attached gdb patch can handle DW_TAG_imported_declaration as alias vari= ables. This change fixes the failure in testcase: gdb.base/symbol-alias.exp This testcase is also updated to test nested (recursive) alias, static alia= see and deferred aliasee. Please review the below gdb patch (also attached). --- gdb/dwarf2/read.c | 113 ++++++++++++++++-------- gdb/testsuite/gdb.base/symbol-alias.exp | 23 ++++- gdb/testsuite/gdb.base/symbol-alias2.c | 10 +++ 3 files changed, 107 insertions(+), 39 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 10550336063..0f709d9ccc1 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -1132,6 +1132,10 @@ static void add_partial_subprogram (struct partial_d= ie_info *pdi, CORE_ADDR *lowpc, CORE_ADDR *highpc, int need_pc, struct dwarf2_cu *cu); +static void var_decode_location (struct attribute *attr, + struct symbol *sym, + struct dwarf2_cu *cu); + static unsigned int peek_abbrev_code (bfd *, const gdb_byte *); static struct partial_die_info *load_partial_dies @@ -1332,7 +1336,7 @@ static struct using_direct **using_directives (struct= dwarf2_cu *cu); static void read_import_statement (struct die_info *die, struct dwarf2_cu *= ); -static int read_namespace_alias (struct die_info *die, struct dwarf2_cu *c= u); +static int read_alias (struct die_info *die, struct dwarf2_cu *cu); static struct type *read_module_type (struct die_info *die, struct dwarf2_cu *cu); @@ -9742,9 +9746,11 @@ process_die (struct die_info *die, struct dwarf2_cu = *cu) break; case DW_TAG_imported_declaration: cu->processing_has_namespace_info =3D true; - if (read_namespace_alias (die, cu)) + if (((cu->per_cu->lang =3D=3D language_c) + || (cu->per_cu->lang =3D=3D language_cplus)) + && read_alias (die, cu)) break; - /* The declaration is not a global namespace alias. */ + /* The declaration is not a global namespace or variable alias. */ /* Fall through. */ case DW_TAG_imported_module: cu->processing_has_namespace_info =3D true; @@ -10212,18 +10218,20 @@ dwarf2_physname (const char *name, struct die_inf= o *die, struct dwarf2_cu *cu) return retval; } -/* Inspect DIE in CU for a namespace alias. If one exists, record - a new symbol for it. +#define MAX_NESTED_IMPORTED_DECLARATIONS 100 + +/* Inspect DIE in CU for a namespace alias or a variable + with alias attribute. If one exists, record a new symbol + for it. - Returns 1 if a namespace alias was recorded, 0 otherwise. */ + Returns 1 if an alias was recorded, 0 otherwise. */ static int -read_namespace_alias (struct die_info *die, struct dwarf2_cu *cu) +read_alias (struct die_info *die, struct dwarf2_cu *cu) { struct attribute *attr; - /* If the die does not have a name, this is not a namespace - alias. */ + /* The die must have a name for namespace or variable alias */ attr =3D dwarf2_attr (die, DW_AT_name, cu); if (attr !=3D NULL) { @@ -10232,42 +10240,71 @@ read_namespace_alias (struct die_info *die, struc= t dwarf2_cu *cu) struct dwarf2_cu *imported_cu =3D cu; /* If the compiler has nested DW_AT_imported_declaration DIEs, - keep inspecting DIEs until we hit the underlying import. */ -#define MAX_NESTED_IMPORTED_DECLARATIONS 100 + keep inspecting DIEs until we hit the underlying import. */ for (num =3D 0; num < MAX_NESTED_IMPORTED_DECLARATIONS; ++num) - { - attr =3D dwarf2_attr (d, DW_AT_import, cu); - if (attr =3D=3D NULL) - break; + { + attr =3D dwarf2_attr (d, DW_AT_import, cu); + if (attr =3D=3D NULL) + return 0; - d =3D follow_die_ref (d, attr, &imported_cu); - if (d->tag !=3D DW_TAG_imported_declaration) - break; - } + d =3D follow_die_ref (d, attr, &imported_cu); + if (d->tag !=3D DW_TAG_imported_declaration) + break; + } if (num =3D=3D MAX_NESTED_IMPORTED_DECLARATIONS) - { - complaint (_("DIE at %s has too many recursively imported " - "declarations"), sect_offset_str (d->sect_off)); - return 0; - } + { + complaint (_("DIE at %s has too many recursively imported " + "declarations"), sect_offset_str (d->sect_off)); + return 0; + } if (attr !=3D NULL) - { - struct type *type; - sect_offset sect_off =3D attr->get_ref_die_offset (); - - type =3D get_die_type_at_offset (sect_off, cu->per_cu, cu->per_ob= jfile); - if (type !=3D NULL && type->code () =3D=3D TYPE_CODE_NAMESPACE) - { - /* This declaration is a global namespace alias. Add - a symbol for it whose type is the aliased namespace. */ - new_symbol (die, type, cu); - return 1; - } - } + { + struct type *type; + if (d->tag =3D=3D DW_TAG_variable) + { + /* This declaration is a global variable alias. Add + a symbol for it whose type is same as aliased variable. */ + type =3D die_type (d, imported_cu); + struct symbol *sym =3D new_symbol(die, type, cu); + attr =3D dwarf2_attr (d, DW_AT_location, imported_cu); + if (attr !=3D nullptr) + { + var_decode_location (attr, sym, cu); + return 1; + } + else + { + /* We do not know the address of this symbol. + If it is an external symbol and we have type informat= ion + for it, enter the symbol as a LOC_UNRESOLVED symbol. + The address of the variable will then be determined f= rom + the minimal symbol table whenever the variable is + referenced. */ + attr =3D dwarf2_attr (d, DW_AT_external, imported_cu); + if (attr !=3D nullptr && attr->as_boolean () + && dwarf2_attr (d, DW_AT_type, imported_cu) !=3D NUL= L) + { + sym->set_aclass_index (LOC_UNRESOLVED); + return 1; + } + } + } + else + { + sect_offset sect_off =3D attr->get_ref_die_offset (); + type =3D get_die_type_at_offset (sect_off, cu->per_cu, cu->p= er_objfile); + if (type !=3D NULL && type->code () =3D=3D TYPE_CODE_NAMESPA= CE) + { + /* This declaration is a global namespace alias. Add + a symbol for it whose type is the aliased namespace. = */ + new_symbol (die, type, cu); + return 1; + } + } + } } - return 0; } diff --git a/gdb/testsuite/gdb.base/symbol-alias.exp b/gdb/testsuite/gdb.ba= se/symbol-alias.exp index 2b53cc31053..1259c1daf1d 100644 --- a/gdb/testsuite/gdb.base/symbol-alias.exp +++ b/gdb/testsuite/gdb.base/symbol-alias.exp @@ -15,6 +15,7 @@ # along with this program. If not, see http://www.gnu.org/licenses/. standard_testfile symbol-alias.c symbol-alias2.c +set using_clang [test_compiler_info clang*] if { [prepare_for_testing "failed to prepare" ${testfile} [list $srcfile $s= rcfile2]] } { return -1 @@ -31,6 +32,26 @@ foreach f {"func" "func_alias"} { } # Variables. -foreach v {"g_var_s" "g_var_s_alias"} { +foreach v {"g_var_s" "g_var_s_alias" "g_var_s_alias2"} { gdb_test "p $v" "=3D {field1 =3D 1, field2 =3D 2}" } + +# Static Variable. +foreach v {"g_var" "g_var_alias"} { + gdb_test "p $v" " =3D 1" +} + +# Deferred Variable. +gdb_test "p g_def_var" " =3D 2" +gdb_test_multiple "p g_def_var_alias" "p g_def_var_alias" { + -re " =3D 2.*$gdb_prompt $" { + pass "print alias of deferred variable" + } + -re ".*has unknown type; cast it to its declared type.*$gdb_prompt $"= { + if { $using_clang } { + xfail "print alias of deferred variable" + } else { + fail "print alias of deferred variable" + } + } +} diff --git a/gdb/testsuite/gdb.base/symbol-alias2.c b/gdb/testsuite/gdb.bas= e/symbol-alias2.c index 34f4e121e25..79b3195caf5 100644 --- a/gdb/testsuite/gdb.base/symbol-alias2.c +++ b/gdb/testsuite/gdb.base/symbol-alias2.c @@ -23,6 +23,8 @@ struct S struct S g_var_s =3D { 1, 2 }; +static int g_var =3D 1; + #ifdef __cplusplus /* So that the alias attribute below work without having to figure out this function's mangled name. */ @@ -38,3 +40,11 @@ func (void) struct S *func_alias (void) __attribute__ ((alias ("func"))); extern struct S g_var_s_alias __attribute__ ((alias ("g_var_s"))); + +extern struct S g_var_s_alias2 __attribute__ ((alias ("g_var_s_alias"))); + +extern int g_var_alias __attribute__ ((alias ("g_var"))); + +extern int g_def_var_alias __attribute__ ((alias ("g_def_var"))); + +int g_def_var =3D 2; --