public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/30417] Section .data cannot be moved with -mmcu=atmega88
       [not found] <bug-30417-4@http.gcc.gnu.org/bugzilla/>
@ 2014-04-21 17:21 ` e9fritte at etek dot chalmers.se
  0 siblings, 0 replies; 5+ messages in thread
From: e9fritte at etek dot chalmers.se @ 2014-04-21 17:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30417

Andreas Fritiofson <e9fritte at etek dot chalmers.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
      Known to work|4.2.0                       |
               Host|i486-linux-gnu              |x86_64-linux-gnu
            Version|4.1.0                       |4.8.2
         Resolution|WORKSFORME                  |---
              Build|i486-linux-gnu              |x86_64-linux-gnu
           Severity|normal                      |minor

--- Comment #5 from Andreas Fritiofson <e9fritte at etek dot chalmers.se> ---
Just updating this to note that this still/again fails, however not exactly the
same as in my original report.

Using --section-data=.data=0x800200 correctly overrides the -Tdata 0x800100
that gcc adds for some AVRs.

But the (according to ld docs) equivalent -Tdata=0x800200 is silently discarded
and the .data section remains at 0x800100, causing havoc at runtime.

Can't tell if this is a bug in binutils or if this is intended behavior and gcc
should adapt the collect2 arguments to avoid triggering it.

Minimal test cases:
$ avr-gcc -v
Using built-in specs.
COLLECT_GCC=avr-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/avr/4.8.2/lto-wrapper
Target: avr
Configured with: ../src/configure -v --enable-languages=c,c++ --prefix=/usr/lib
--infodir=/usr/share/info --mandir=/usr/share/man --bindir=/usr/bin
--libexecdir=/usr/lib --libdir=/usr/lib --enable-shared --with-system-zlib
--enable-long-long --enable-nls --without-included-gettext --disable-libssp
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=avr
Thread model: single
gcc version 4.8.2 (GCC)
$ avr-ld -v
GNU ld (GNU Binutils) 2.23.1
$ echo 'int main(void) { return 0; }' > main.c

Works:
$ avr-gcc -mmcu=atmega88 -Wl,-Map,main.map,--section-start,.data=0x800200 -o
main.elf main.c && grep ^.data < main.map
.data           0x0000000000800200        0x0 load address 0x000000000000005c

Fails:
$ avr-gcc -mmcu=atmega88 -Wl,-Map,main.map,-Tdata=0x800200 -o main.elf main.c
&& grep ^.data < main.map
.data           0x0000000000800100        0x0 load address 0x000000000000005c

Works:
$ avr-gcc -mmcu=atmega8 -Wl,-Map,main.map,-Tdata=0x800200 -o main.elf main.c &&
grep ^.data < main.map
.data           0x0000000000800200        0x0 load address 0x000000000000004e


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

* [Bug target/30417] Section .data cannot be moved with -mmcu=atmega88
  2007-01-09 22:02 [Bug driver/30417] New: " e9fritte at etek dot chalmers dot se
                   ` (2 preceding siblings ...)
  2007-06-28 19:29 ` e9fritte at etek dot chalmers dot se
@ 2007-06-28 19:48 ` eweddington at cso dot atmel dot com
  3 siblings, 0 replies; 5+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-06-28 19:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from eweddington at cso dot atmel dot com  2007-06-28 19:48 -------
Closing bug as WORKSFORME.


-- 

eweddington at cso dot atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WORKSFORME


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30417


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

* [Bug target/30417] Section .data cannot be moved with -mmcu=atmega88
  2007-01-09 22:02 [Bug driver/30417] New: " e9fritte at etek dot chalmers dot se
  2007-01-09 22:10 ` [Bug target/30417] " e9fritte at etek dot chalmers dot se
  2007-06-23 15:39 ` eweddington at cso dot atmel dot com
@ 2007-06-28 19:29 ` e9fritte at etek dot chalmers dot se
  2007-06-28 19:48 ` eweddington at cso dot atmel dot com
  3 siblings, 0 replies; 5+ messages in thread
From: e9fritte at etek dot chalmers dot se @ 2007-06-28 19:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from e9fritte at etek dot chalmers dot se  2007-06-28 19:29 -------
At that time I was probably using binutils 2.16 (Ubunty Edgy). It seems Feisty
still has that version. It's great if this has been resolved in 4.2, although
my workaround does its job for now. Thanks to whoever fixed it!


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30417


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

* [Bug target/30417] Section .data cannot be moved with -mmcu=atmega88
  2007-01-09 22:02 [Bug driver/30417] New: " e9fritte at etek dot chalmers dot se
  2007-01-09 22:10 ` [Bug target/30417] " e9fritte at etek dot chalmers dot se
@ 2007-06-23 15:39 ` eweddington at cso dot atmel dot com
  2007-06-28 19:29 ` e9fritte at etek dot chalmers dot se
  2007-06-28 19:48 ` eweddington at cso dot atmel dot com
  3 siblings, 0 replies; 5+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-06-23 15:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from eweddington at cso dot atmel dot com  2007-06-23 15:39 -------
Works for me with gcc 4.2.0 and binutils 2.17.

Andreas, what version of binutils are you using?


-- 

eweddington at cso dot atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30417


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

* [Bug target/30417] Section .data cannot be moved with -mmcu=atmega88
  2007-01-09 22:02 [Bug driver/30417] New: " e9fritte at etek dot chalmers dot se
@ 2007-01-09 22:10 ` e9fritte at etek dot chalmers dot se
  2007-06-23 15:39 ` eweddington at cso dot atmel dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: e9fritte at etek dot chalmers dot se @ 2007-01-09 22:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from e9fritte at etek dot chalmers dot se  2007-01-09 22:09 -------
Adding me to CC list.


-- 

e9fritte at etek dot chalmers dot se changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |e9fritte at etek dot
                   |                            |chalmers dot se


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30417


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

end of thread, other threads:[~2014-04-21 17:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-30417-4@http.gcc.gnu.org/bugzilla/>
2014-04-21 17:21 ` [Bug target/30417] Section .data cannot be moved with -mmcu=atmega88 e9fritte at etek dot chalmers.se
2007-01-09 22:02 [Bug driver/30417] New: " e9fritte at etek dot chalmers dot se
2007-01-09 22:10 ` [Bug target/30417] " e9fritte at etek dot chalmers dot se
2007-06-23 15:39 ` eweddington at cso dot atmel dot com
2007-06-28 19:29 ` e9fritte at etek dot chalmers dot se
2007-06-28 19:48 ` eweddington at cso dot atmel 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).