------- Comment #14 from f dot frumento at ngi dot it  2009-10-11 22:52 -------
(In reply to comment #0)
> Put this in main.c and build it with a 4.4-branch compiler using recent
> binutils:
> 
> int main ()
> {
>   return 0;
> }
> 
> Versions:
> 
> GNU assembler (GNU Binutils) 2.19.51.20090611
> i686-pc-linux-gnu-gcc (GCC) 4.4.1 20090611 (prerelease)
> 
> % i686-pc-linux-gnu-gcc -c main.c; objdump --wide -h main.o | grep ALLOC
>   0 .text         0000000a  00000000  00000000  00000034  2**2  CONTENTS,
> ALLOC, LOAD, READONLY, CODE
>   1 .data         00000000  00000000  00000000  00000040  2**2  CONTENTS,
> ALLOC, LOAD, DATA
>   2 .bss          00000000  00000000  00000000  00000040  2**2  ALLOC
> 
> % i686-pc-linux-gnu-gcc -c -g main.c; objdump --wide -h main.o | grep ALLOC
>   0 .text         0000000a  00000000  00000000  00000034  2**2  CONTENTS,
> ALLOC, LOAD, READONLY, CODE
>   1 .data         00000000  00000000  00000000  00000040  2**2  CONTENTS,
> ALLOC, LOAD, DATA
>   2 .bss          00000000  00000000  00000000  00000040  2**2  ALLOC
>  12 .eh_frame     00000034  00000000  00000000  000001c0  2**2  CONTENTS,
> ALLOC, LOAD, RELOC, READONLY, DATA
> 
> We're using GAS's .cfi_startproc et cetera directives to generate debug
> information.  But they only generate .eh_frame, not .debug_frame.
> 
> I also noticed this problem on an ARM EABI target.  ARM EABI does not use
> .eh_frame, only .debug_frame and .ARM.exidx.
> 
> The easiest fix is to disable use of the CFI directives when we are trying to
> generate .debug_frame.  I believe GCC used to generate both .debug_frame and
> .eh_frame for the same function.  If we want both to gain the advantages of
> using CFI directives (e.g. potentially accurate across inline asm), then we
> need to teach gas to emit .debug_frame/.eh_frame/both as requested.
> 

Hi all,

I've noticed ther behaviour differs for some platform

I've tested a cross compiler Gcc 4.4.1 on Cygwin and on Mac OSX 1.6,I've built
it from vanilla sources (gcc.gnu.org), the final target is M68K/Coldfire

on mac no problem at all while on cygwin i've got a "no memory region
...omissis... for .eh_frame" error message, i've built the same files just
checked out from svn repository. While i've solved disabling debug options i
can't use this setup for long, I've also modified the linker script as follow:

MEMORY
{
        flash  : ORIGIN = 0x0000000, LENGTH = 0x100000
        dpram  : ORIGIN = 0x0FFFE000, LENGTH = 0x1000
}

SECTIONS {
        .text : {*(boot) *(text) *(eh_frame)} > flash
        .data : {} > dpram
        .bss : {} > dpram
        eh_frame :{} > flash
        /DISCARD/ : { *(eh_*)}
}

but it seems that on cygwin the /DISCARD/ special command doesn't work so my
binary files is larger than the mac generated one.

Any idea ?


-- 

f dot frumento at ngi dot it changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |f dot frumento at ngi dot it


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

Reply via email to