public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joerg Albert <jal2@gmx.de>
To: gcc-help@gcc.gnu.org
Subject: gcc 4.8.1, powerpc, .data.rel.ro.local entry with no corresponding .fixup entry
Date: Mon, 03 Feb 2014 15:10:00 -0000	[thread overview]
Message-ID: <loom.20140203T154631-645@post.gmane.org> (raw)

Hi,

we've recently compiled "Das U-Boot" with gcc 4.8.1 for powerpc target. This
bootloader relocates itself into RAM, using the content of the .fixup section.

A codeline similar to "printf("%p\n", "qwerty");" inside a static function
creates an address entry (for "qwerty") in .data.rel.ro.local, but I cannot
find a corresponding entry in the .fixup section of this object file. This
let the bootloader reference "qwerty" in the flash after it relocated to RAM.

Could someone please explain how the .fixup section is supposed to work?
Shall every .rela.data.* entry in the elf file have a corresponding entry in
the .fixup section?
Are there any command line options which may suppress the generation of the
data.rel.ro.* sections (as U-Boot does not write-protect parts of the RAM)?

The code works fine with gcc 4.7.x, but I haven't looked into the details of
the generated assembly code and section layout.


Thanks,
Joerg

details:
- gcc version: powerpc-softfloat-linux-gnuspe-gcc (Gentoo 4.8.1 p1.0,
pie-0.5.6) 4.8.1
- 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"


             reply	other threads:[~2014-02-03 15:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-03 15:10 Joerg Albert [this message]
2014-02-10 14:33 ` Joerg Albert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20140203T154631-645@post.gmane.org \
    --to=jal2@gmx.de \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).