From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15835 invoked by alias); 12 Feb 2014 10:59:20 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 15813 invoked by uid 48); 12 Feb 2014 10:59:17 -0000 From: "jal2 at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/60158] New: powerpc: usage of the .data.rel.ro.local section Date: Wed, 12 Feb 2014 10:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jal2 at gmx dot de X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg01132.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60158 Bug ID: 60158 Summary: powerpc: usage of the .data.rel.ro.local section Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: jal2 at gmx dot de This bug may concern the gcc documentation on section usage only. Crosscompiling "Das U-Boot" with gcc 4.8.2 for powerpc with -fpic -mrelocatable, some addresses are put into a section .data.rel.ro.local, e.g. the address of "qwerty" from printf("%p\n", "qwerty"); There is no corresponding entry in the .fixup section. As "Das U-Boot" relocates itself to RAM using .got2/.got and .fixup sections only, how shall the section .data.rel.ro.local be handled? Currently it contains addresses only, but this may depend on the source code. I put .data.rel.ro.local into the GOT which solved my problem, but I'm not sure if this is the intention of the gcc developers. I've tried gcc 4.7.3 which put the address of "qwerty" into the GOT directly, i.e. there was no .data.rel.ro.local section and the string address was accessed with one redirection less. details: - gcc version: powerpc-softfloat-linux-gnuspe-gcc (Gentoo 4.8.2 p1.3r1, pie-0.5.8r1) 4.8.2 - gcc command line (some -I removed): -g -gdwarf-2 -Os -fpic -mrelocatable \ -meabi \ -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0xef770000 \ -fno-builtin -ffreestanding \ -isystem /usr/lib/gcc/powerpc-softfloat-linux-gnuspe/4.8.1/include \ -nostdinc -pipe -DCONFIG_PPC -D__powerpc__ -ffixed-r2 -Wa,-me500 \ -msoft-float -mno-string -mspe=yes -mno-spe -Wall -Wstrict-prototypes \ -fno-stack-protector -Wno-format-nonliteral -Wno-format-security \ -fstack-usage"