public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Henrique Coser <henrique.coser@tex.com.br>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Constant at fixed address
Date: Fri, 25 Feb 2022 16:01:39 +0000	[thread overview]
Message-ID: <FR1PR80MB47444A334DBB16A8BD3B8EC9BD3E9@FR1PR80MB4744.lamprd80.prod.outlook.com> (raw)

Hello,

I need a help. I'm trying to solve a problem for weeks.
I have a embeded software that is a boot loader. It puts the boot load version at a specific address.
My memmory starts at 0x400000 with 0x1400 size. My constant version string value must be placed @0x401000 with 8bytes length.
If I place this const value into a section like this:

 const unsigned char Version[8] __attribute__ ((section (".bootversion")))  = "V1.0.1a";

I got this error:

section .bootversion LMA [00401000,00401007] overlaps section .text LMA [00400000,00401013]collect2.exe(0,0): error: ld returned 1 exit status

I have already tried to split flash memmory using linker script but it does not worked.
I wish to find something like "automatic" split.

For example, this code was compiled using ARM Keil. With ARM Keil I have the attribute that makes all the magic :
 const unsigned char Version[8] __attribute__((at(0x0401000))) = "V1.0.1a";

I dont know if is possible to have something as pratical as ARM Keil attribute in GCC.

I really need make this thing work.
If this is not the best channel to ask, please, could you recommend me one?

Thank you very much!



Henrique Coser

Engenharia



TEX Equip.Eletronicos Ind.e Com.Ltda.

Fone: (+5511) 4591-2825

henrique.coser@tex.com.br<mailto:compras@tex.com.br>

MEDIR PARA MELHORAR!

             reply	other threads:[~2022-02-25 16:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25 16:01 Henrique Coser [this message]
2022-02-25 16:45 ` Martin Sebor
2022-02-25 17:56   ` David Brown
2022-02-25 18:18     ` AW: " stefan
2022-02-26 18:56       ` David Brown
2022-02-25 21:37     ` Henrique Coser
2022-02-26 18:57       ` David Brown
2022-02-28 15:16         ` Henrique Coser
2022-02-28 15:50           ` David Brown

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=FR1PR80MB47444A334DBB16A8BD3B8EC9BD3E9@FR1PR80MB4744.lamprd80.prod.outlook.com \
    --to=henrique.coser@tex.com.br \
    --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).