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 authentication level.

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

Submitter:  None
Submitted:  Mon 15 Aug 2005 03:34:04 PM UTC
   
 
Category:  gcc Severity:  3 - Normal
Item Group:  sw-bug Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Wed 11 Feb 2009 08:59:08 PM UTC, comment #3: 

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

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

Thanks.

-------------
online

Anonymous
Mon 15 Aug 2005 03:45:36 PM UTC, 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

Anonymous
Mon 15 Aug 2005 03:34:04 PM UTC, 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

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #3363:  example.tar.gz added by None (4KiB - 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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2005-08-15 None Attached File- Added example.tar.gz, #2824

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code