public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60158] New: powerpc: usage of the .data.rel.ro.local section
@ 2014-02-12 10:59 jal2 at gmx dot de
  2015-10-15 15:41 ` [Bug other/60158] " joakim.tjernlund at transmode dot se
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jal2 at gmx dot de @ 2014-02-12 10:59 UTC (permalink / raw)
  To: gcc-bugs

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"


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/60158] powerpc: usage of the .data.rel.ro.local section
  2014-02-12 10:59 [Bug c/60158] New: powerpc: usage of the .data.rel.ro.local section jal2 at gmx dot de
@ 2015-10-15 15:41 ` joakim.tjernlund at transmode dot se
  2020-06-03  0:02 ` segher at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: joakim.tjernlund at transmode dot se @ 2015-10-15 15:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60158

joakim.tjernlund at transmode dot se <joakim.tjernlund at transmode dot se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joakim.tjernlund@transmode.
                   |                            |se

--- Comment #1 from joakim.tjernlund at transmode dot se <joakim.tjernlund at transmode dot se> ---
There is a patch at http://patchwork.ozlabs.org/patch/342888/
to address this issue and I THINK it is included in gcc-4.9.3

However, when I build the test case I do not get any .fixup section
I cross building from amd64 to ppc32 if that is important


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/60158] powerpc: usage of the .data.rel.ro.local section
  2014-02-12 10:59 [Bug c/60158] New: powerpc: usage of the .data.rel.ro.local section jal2 at gmx dot de
  2015-10-15 15:41 ` [Bug other/60158] " joakim.tjernlund at transmode dot se
@ 2020-06-03  0:02 ` segher at gcc dot gnu.org
  2020-06-03  8:10 ` joakim.tjernlund at infinera dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: segher at gcc dot gnu.org @ 2020-06-03  0:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60158

Segher Boessenkool <segher at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |segher at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #6 from Segher Boessenkool <segher at gcc dot gnu.org> ---
The powerpcspe backend has been deprecated in GCC 8 and removed during GCC 9
development. See corresponding mailing list threads[1,2,3] for details.

[1] https://gcc.gnu.org/legacy-ml/gcc/2018-04/msg00102.html
[2] https://gcc.gnu.org/legacy-ml/gcc-patches/2018-12/msg00123.html
[3] https://gcc.gnu.org/pipermail/gcc/2020-May/232342.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/60158] powerpc: usage of the .data.rel.ro.local section
  2014-02-12 10:59 [Bug c/60158] New: powerpc: usage of the .data.rel.ro.local section jal2 at gmx dot de
  2015-10-15 15:41 ` [Bug other/60158] " joakim.tjernlund at transmode dot se
  2020-06-03  0:02 ` segher at gcc dot gnu.org
@ 2020-06-03  8:10 ` joakim.tjernlund at infinera dot com
  2020-06-03 14:40 ` segher at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: joakim.tjernlund at infinera dot com @ 2020-06-03  8:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60158

--- Comment #7 from Joakim Tjernlund <joakim.tjernlund at infinera dot com> ---
(In reply to Segher Boessenkool from comment #6)
> The powerpcspe backend has been deprecated in GCC 8 and removed during GCC 9
> development. See corresponding mailing list threads[1,2,3] for details.
> 
> [1] https://gcc.gnu.org/legacy-ml/gcc/2018-04/msg00102.html
> [2] https://gcc.gnu.org/legacy-ml/gcc-patches/2018-12/msg00123.html
> [3] https://gcc.gnu.org/pipermail/gcc/2020-May/232342.html

This is not SPE specific.
More like powerpc or gcc

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/60158] powerpc: usage of the .data.rel.ro.local section
  2014-02-12 10:59 [Bug c/60158] New: powerpc: usage of the .data.rel.ro.local section jal2 at gmx dot de
                   ` (2 preceding siblings ...)
  2020-06-03  8:10 ` joakim.tjernlund at infinera dot com
@ 2020-06-03 14:40 ` segher at gcc dot gnu.org
  2020-06-03 18:52 ` joakim.tjernlund at infinera dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: segher at gcc dot gnu.org @ 2020-06-03 14:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60158

--- Comment #8 from Segher Boessenkool <segher at gcc dot gnu.org> ---
It does not happen on any target currently, and it has never happened
on non-SPE targets before.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/60158] powerpc: usage of the .data.rel.ro.local section
  2014-02-12 10:59 [Bug c/60158] New: powerpc: usage of the .data.rel.ro.local section jal2 at gmx dot de
                   ` (3 preceding siblings ...)
  2020-06-03 14:40 ` segher at gcc dot gnu.org
@ 2020-06-03 18:52 ` joakim.tjernlund at infinera dot com
  2020-06-04 15:59 ` joakim.tjernlund at infinera dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: joakim.tjernlund at infinera dot com @ 2020-06-03 18:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60158

--- Comment #9 from Joakim Tjernlund <joakim.tjernlund at infinera dot com> ---
(In reply to Segher Boessenkool from comment #8)
> It does not happen on any target currently, and it has never happened
> on non-SPE targets before.

The main user, u-boot, added the workaround with -fno-ira-hoist-pressure 
to avoid the bug:

    arch/powerpc/config.mk: Pass -fno-ira-hoist-pressure when possible

    There are various toolchain issues that cause us to produce invalid
    binaries with certain gcc 4.8.x and 4.9.x versions when we don't pass
    this flag in.

    Tested-by: Joakim Tjernlund <joakim.tjernlund@transmode.se>
    Signed-off-by: Tom Rini <trini@konsulko.com>

The bug is still there as far as I known, the one-line patch hasn't been
applied
I think.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/60158] powerpc: usage of the .data.rel.ro.local section
  2014-02-12 10:59 [Bug c/60158] New: powerpc: usage of the .data.rel.ro.local section jal2 at gmx dot de
                   ` (4 preceding siblings ...)
  2020-06-03 18:52 ` joakim.tjernlund at infinera dot com
@ 2020-06-04 15:59 ` joakim.tjernlund at infinera dot com
  2020-06-04 20:22 ` segher at gcc dot gnu.org
  2020-06-04 23:21 ` joakim.tjernlund at infinera dot com
  7 siblings, 0 replies; 9+ messages in thread
From: joakim.tjernlund at infinera dot com @ 2020-06-04 15:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60158

--- Comment #10 from Joakim Tjernlund <joakim.tjernlund at infinera dot com> ---
To be clear, this is still a bug for powerpc(SPE or no SPE) and possibly any
other arch using fixup tables like ppc.

One can workaround this bug by using the -fno-ira-hoist-pressure, I am not
sure why this option work and if there is a chance it will stop working in the
future.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/60158] powerpc: usage of the .data.rel.ro.local section
  2014-02-12 10:59 [Bug c/60158] New: powerpc: usage of the .data.rel.ro.local section jal2 at gmx dot de
                   ` (5 preceding siblings ...)
  2020-06-04 15:59 ` joakim.tjernlund at infinera dot com
@ 2020-06-04 20:22 ` segher at gcc dot gnu.org
  2020-06-04 23:21 ` joakim.tjernlund at infinera dot com
  7 siblings, 0 replies; 9+ messages in thread
From: segher at gcc dot gnu.org @ 2020-06-04 20:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60158

--- Comment #11 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Do you have a reproducer you can share?

I'll happily reopen the PR then, of course!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug other/60158] powerpc: usage of the .data.rel.ro.local section
  2014-02-12 10:59 [Bug c/60158] New: powerpc: usage of the .data.rel.ro.local section jal2 at gmx dot de
                   ` (6 preceding siblings ...)
  2020-06-04 20:22 ` segher at gcc dot gnu.org
@ 2020-06-04 23:21 ` joakim.tjernlund at infinera dot com
  7 siblings, 0 replies; 9+ messages in thread
From: joakim.tjernlund at infinera dot com @ 2020-06-04 23:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60158

--- Comment #12 from Joakim Tjernlund <joakim.tjernlund at infinera dot com> ---
(In reply to Segher Boessenkool from comment #11)
> Do you have a reproducer you can share?
> 
> I'll happily reopen the PR then, of course!

After 6 years, no I don't.
You could use the test case included in the the patch I think.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-06-04 23:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 10:59 [Bug c/60158] New: powerpc: usage of the .data.rel.ro.local section jal2 at gmx dot de
2015-10-15 15:41 ` [Bug other/60158] " joakim.tjernlund at transmode dot se
2020-06-03  0:02 ` segher at gcc dot gnu.org
2020-06-03  8:10 ` joakim.tjernlund at infinera dot com
2020-06-03 14:40 ` segher at gcc dot gnu.org
2020-06-03 18:52 ` joakim.tjernlund at infinera dot com
2020-06-04 15:59 ` joakim.tjernlund at infinera dot com
2020-06-04 20:22 ` segher at gcc dot gnu.org
2020-06-04 23:21 ` joakim.tjernlund at infinera dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).