From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D2F993858401; Tue, 18 Jul 2023 04:19:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2F993858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689653950; bh=WTfcNvgINJd/p81Lx87gnxf5vhXGQA37CRf3aZoqjzo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UXRrebOwA1+t51Hu1nv+Ig5vHzNkOd0yEcWJj9C7jNxJIDw4a5E9GoTsCGz8ZOkoi P3DEV3G1YM3Kdt983I0oqLUQncZvrJUaF1gRbNM8AiOfwsPFqFBUSEkzI93bY6xcYi v4aTbdzVHjbbLpuz0WfkE3xl2Ez0mBF/olZrLAnw= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110709] how to handle the initialization of global struct data for position independent executable application. Date: Tue, 18 Jul 2023 04:19:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110709 --- Comment #1 from Andrew Pinski --- I don't understand your question since if we look at the output of GCC we g= et: .LC0: .ascii "const char *text\000" .section .data.rel.local,"aw" .align 2 .type user_test, %object .size user_test, 112 user_test: .ascii "struct member testChArray\000" .space 74 .word 10 .word .LC0 .word 27 Only text will have a relocation associated with it since that is the only = one that needs it. Everything else has no need for a relocation since it is just data.=