bugGNU Development Chain for 68HC11/68HC12 - Bugs: bug #14131, switch statement tables put in...


You are not allowed to post comments on this tracker with your current authentification level.

bug #14131: switch statement tables put in .rodata instead of .text

Submitted by:  None
Submitted on:  Mon Aug 15 15:34:04 2005  
Category: gccSeverity: 3 - Normal
Item Group: sw-bugStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Wed Feb 11 20:59:08 2009, comment #3:

That Linker script has some interesting stuff I can't even get paged memory to work yet.

Fri Mar 14 08:02:22 2008, comment #2:



Mon Aug 15 15:45:36 2005, comment #1:

oh, I forgot to include gcc version information:
m68hc12-elf-gcc -v
Reading specs from /Users/jgurney/work/hcs12/gnu-m68hc11/tools/lib/gcc-lib/m68hc12-elf/3.3.5-m68hc1x-20050515/specsConfigured with: ./configure --target=m68hc12-elf --prefix=/Users/jgurney/work/hcs12/gnu-m68hc11/tools --program-prefix=m68hc12-elf- --enable-languages=cThread model: singlegcc version 3.3.5-m68hc1x-20050515

Mon Aug 15 15:34:04 2005, original submission:

If you generate a large enough switch statement, the table that is used is stuck in the public .rodata section. The .rodata section is global, why put function local data in a global area. This will cause many linker errors, because the PPAGE data will be dropped from the table (as demonstrated below).

I have attached the s.c and *.x files, and the following commands are used to reproduce the error:
m68hc12-elf-gcc -m68hc12 -ffreestanding -mshort -Wall -Werror -c s.c
m68hc12-elf-objcopy --rename-section .text.reloc=.text.bank1 s.o
m68hc12-elf-gcc -m68hc12 -ffreestanding -mshort -Wall -Werror -Wl,--script,m68hc12elfb.x -Wl,--bank-window,flashwindow -o s.elf s.o

The last command will output many errors like:
s.o(.rodata+0xc05c): In function `.L18':
: reference to a banked address [3d:803c] in the normal address space at c05cs.o(.rodata+0xc05e): In function `.L18':
: reference to a banked address [3d:803c] in the normal address space at c05es.o(.rodata+0xc060): In function `.L18':
: reference to a banked address [3d:803c] in the normal address space at c060



Attached Files
file #3363:  example.tar.gz added by None (4kB - application/x-gzip - s.c and *.x files to reproduce bug)


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.


Please enter the title of George Orwell's famous dystopian book (it's a date):



Follows 1 latest change.

Date Changed By Updated Field Previous Value => Replaced By
Mon Aug 15 15:34:04 2005NoneAttached File-=>Added example.tar.gz, #2824

Back to the top

Powered by Savane 3.1-cleanup1