Shop OBEX P1 Docs P2 Docs Learn Events
[solved] Garbage Collection, again — Parallax Forums

[solved] Garbage Collection, again

SRLMSRLM Posts: 5,045
edited 2013-05-30 08:56 in Propeller 1
Well, I'm starting to get near the limit of available memory, and I would like to see if we can get automatic garbage collection back.

History
http://forums.parallax.com/showthread.php/144139-PropGCC-Problems-garbage-collecting-functions

Motivation
GCC does not provide automatic garbage collection. That is unfortunate, due to the Propeller's limited memory size. It would be nice if garbage collection was done automatically at compile time for the unused functions and variables.

Changes
In the newest version of PropGCC (on the p2test branch, v0_3_5_1920+) there is the new kerext feature. While this may be useful for improving kernel performance, it breaks the older half working style of garbage collection. This is because it uses a __load_start_* type identifier, which I wasn't able to get working before.

Current Work
I've attached a simple program and associated Makefile and main.ld script. I tried various KEEP directives in the main.ld script, and I'm able to prevent the section from being garbage collected. But, in the end, it always comes down to one error:
/opt/parallax/lib/gcc/propeller-elf/4.6.1/_crtend.o
/opt/parallax/lib/gcc/propeller-elf/4.6.1/_crt0.o: In function `__mem_kernel_ptr':
(.kernel+0x4f8): undefined reference to `__load_start_memory_kerext'
collect2: ld returned 1 exit status
make: *** [Debug] Error 1

I have no idea where to look. Any suggestions would be welcome, and a solution would be wonderful.

On a slightly related note, I found that on line 191 of propgcc/gcc/gcc/config/propeller/kernel.ext it has "long", but not ".long" like the very similar looking section on line 87. Since the linker is not complaining about __load_start_math_kerext, I thought that single period might be it. So, I recompiled PropGCC with that change (I presume, it's my first time with a change) and the problem persists.

Comments

  • ersmithersmith Posts: 6,054
    edited 2013-03-30 04:56
    The problem is that nothing in the .memory.kerext is used by your program. The functions in there were originally intended to be improved assembly language versions of some of the standard memory functions like memset() and memclr(), but it turns out that the C versions were actually faster than the hand written assembly (better algorithms almost always trump assembly language!). So .memory.kerext is no longer used, but it's still included in the kernel. That's a bug, obviously! Thanks for catching it.

    We'll remove it from the sources, but for the moment you can get around the error by either (1) defining __load_start_memory_kerext to 0 somewhere, or (2) providing a reference to some function in the .memory.kerext section, like __Memcpy. Option (1) will save you around 156 bytes of memory, so it's probably the better one.

    Thanks for the bug report,
    Eric
  • SRLMSRLM Posts: 5,045
    edited 2013-04-01 20:48
    Thank you! Thank you! Thank you!

    I've been trying things on and off for over four months now, trying to get this to work. Your post provided the inspiration to solve the problem.

    Value of Garbage collection
    For the fairly large program that I'm developing, I'm able to get the following code size reduction for "free" using garbage collection:
    Without GC: 20720 bytes sent
    With GC:     18816 bytes sent
    
    2KB extra space is pretty generous. With the toggle code attached, the savings are:
    Without GC: 14060 bytes sent
    With GC:     6248 bytes sent
    
    An incredible savings of almost 8KB, more than half the program.

    How To
    The trick was to provide a reference to the assembly code so that it would not be pruned by the linker. I did this by adding the following to the cog GAS assembly driver:
    .section .cogtoggle, "ax"
    		.cog_ram
    		.global cogtoggleMain
    cogtoggleMain:
     //GAS stuff here
    

    Then, somewhere in the main, I added:
    volatile void * reference;
        __asm__ volatile (
            "mov %[reference], #cogtoggleMain \n\t"
        :
            [reference] "+r" (reference)
        );
    

    Now, the compiler will not optimize the reference away, and the linker won't prune assembly drivers.

    I've attached a version of the GAS toggle demo that has these features, along with the makefile and main.ld linker scirpt.

    Implementation details
    I didn't have to add anything specific to the linker script for the .cogtoggle section code. The only modifications that I made from the default linker script was to add the KEEP directive around some of the more important looking sections. It would be nice if the default propgcc linker script were updated to include these keep directives, since it will work for all PropGCC implementations.

    GCC does not garbage collect by default. To do that, you have to add some linker options:
    -Wl,--script=main.ld -Wl,--gc-sections -Wl,--print-gc-sections -Wl,--verbose
    
    The --script option specifies a linker script to use.
    The --gc-sections instructs the linker to garbage collect.
    The --print-gc-sections prints what was removed.
    The --verbose outputs a bunch of information, including the linker script used.

    I tried the following code to make a reference instead of the inline assembly, but it got optimized out with -Os.
    volatile extern void * reference asm("cogtoggleMain");
    	volatile void * reference2 = reference;
    

    It would be nice if the reference generation could be done automatically in one of the startup sections (.r0 - .r9?), but I don't know enough yet to provide suggestions on how to do this.

    I'm using a recent build:
    propeller-elf-gcc (propellergcc_v0_3_5_1958) 4.6.1
    
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-02 04:50
    SRLM wrote: »
    Thank you! Thank you! Thank you!

    I've been trying things on and off for over four months now, trying to get this to work. Your post provided the inspiration to solve the problem.

    Value of Garbage collection
    For the fairly large program that I'm developing, I'm able to get the following code size reduction for "free" using garbage collection:
    Without GC: 20720 bytes sent
    With GC:     18816 bytes sent
    
    2KB extra space is pretty generous. With the toggle code attached, the savings are:
    Without GC: 14060 bytes sent
    With GC:     6248 bytes sent
    
    An incredible savings of almost 8KB, more than half the program.

    How To
    The trick was to provide a reference to the assembly code so that it would not be pruned by the linker. I did this by adding the following to the cog GAS assembly driver:
    .section .cogtoggle, "ax"
    		.cog_ram
    		.global cogtoggleMain
    cogtoggleMain:
     //GAS stuff here
    

    Then, somewhere in the main, I added:
    volatile void * reference;
        __asm__ volatile (
            "mov %[reference], #cogtoggleMain \n\t"
        :
            [reference] "+r" (reference)
        );
    

    Now, the compiler will not optimize the reference away, and the linker won't prune assembly drivers.

    I've attached a version of the GAS toggle demo that has these features, along with the makefile and main.ld linker scirpt.

    Implementation details
    I didn't have to add anything specific to the linker script for the .cogtoggle section code. The only modifications that I made from the default linker script was to add the KEEP directive around some of the more important looking sections. It would be nice if the default propgcc linker script were updated to include these keep directives, since it will work for all PropGCC implementations.

    GCC does not garbage collect by default. To do that, you have to add some linker options:
    -Wl,--script=main.ld -Wl,--gc-sections -Wl,--print-gc-sections -Wl,--verbose
    
    The --script option specifies a linker script to use.
    The --gc-sections instructs the linker to garbage collect.
    The --print-gc-sections prints what was removed.
    The --verbose outputs a bunch of information, including the linker script used.

    I tried the following code to make a reference instead of the inline assembly, but it got optimized out with -Os.
    volatile extern void * reference asm("cogtoggleMain");
    	volatile void * reference2 = reference;
    

    It would be nice if the reference generation could be done automatically in one of the startup sections (.r0 - .r9?), but I don't know enough yet to provide suggestions on how to do this.

    I'm using a recent build:
    propeller-elf-gcc (propellergcc_v0_3_5_1958) 4.6.1
    

    Nice work!! Thanks for sticking with this!
  • jazzedjazzed Posts: 11,803
    edited 2013-04-02 08:17
    Any chance we can make changes in the compiler/linker so that any program can benefit from this effort?
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-02 08:22
    jazzed wrote: »
    Any chance we can make changes in the compiler/linker so that any program can benefit from this effort?
    Sounds like all we need to do is add some KEEP directives to the default linker scripts. The rest is taken care of by the --gc-sections option to the linker as I understand it.
  • SRLMSRLM Posts: 5,045
    edited 2013-04-11 16:35
    Hi All, I've done some more testing and it seems to be stable. Here is the diff:
    diff -r 0cae4a169973 binutils/ld/scripttempl/propeller.sc
    --- a/binutils/ld/scripttempl/propeller.sc	Tue Apr 09 18:53:10 2013 -0300
    +++ b/binutils/ld/scripttempl/propeller.sc	Thu Apr 11 16:21:47 2013 -0700
    @@ -34,7 +34,7 @@
       /* the initial startup code (including constructors) */
       .init ${RELOCATING-0} :
       {
    -    *(.init*)
    +    KEEP(*(.init*)) /*SRLM: Keep to allow for garbage collection*/
       } ${RELOCATING+ ${TEXT_MEMORY}}
     
       /* Internal text space or external memory.  */
    @@ -63,12 +63,12 @@
     
       .ctors ${RELOCATING-0} :
       {
    -    *(.ctors*)
    +    KEEP(*(.ctors*)) /*SRLM: Keep to allow for garbage collection*/
       } ${RELOCATING+ ${HUBTEXT_MEMORY}}
     
       .dtors ${RELOCATING-0} :
       {
    -    *(.dtors*)
    +    KEEP(*(.dtors*)) /*SRLM: Keep to allow for garbage collection*/
       } ${RELOCATING+ ${HUBTEXT_MEMORY}}
     
       .data	${RELOCATING-0} :
    

    I have tried it with CMM and LMM, but not any other memory models ( I don't have a board with external memory). Any suggestions on what to add for those would be welcome as well.

    If this diff meets with everybody's approval, I'd like to commit it to the repository myself.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-11 16:48
    SRLM wrote: »
    Hi All, I've done some more testing and it seems to be stable. Here is the diff:
    diff -r 0cae4a169973 binutils/ld/scripttempl/propeller.sc
    --- a/binutils/ld/scripttempl/propeller.sc	Tue Apr 09 18:53:10 2013 -0300
    +++ b/binutils/ld/scripttempl/propeller.sc	Thu Apr 11 16:21:47 2013 -0700
    @@ -34,7 +34,7 @@
       /* the initial startup code (including constructors) */
       .init ${RELOCATING-0} :
       {
    -    *(.init*)
    +    KEEP(*(.init*)) /*SRLM: Keep to allow for garbage collection*/
       } ${RELOCATING+ ${TEXT_MEMORY}}
     
       /* Internal text space or external memory.  */
    @@ -63,12 +63,12 @@
     
       .ctors ${RELOCATING-0} :
       {
    -    *(.ctors*)
    +    KEEP(*(.ctors*)) /*SRLM: Keep to allow for garbage collection*/
       } ${RELOCATING+ ${HUBTEXT_MEMORY}}
     
       .dtors ${RELOCATING-0} :
       {
    -    *(.dtors*)
    +    KEEP(*(.dtors*)) /*SRLM: Keep to allow for garbage collection*/
       } ${RELOCATING+ ${HUBTEXT_MEMORY}}
     
       .data	${RELOCATING-0} :
    

    I have tried it with CMM and LMM, but not any other memory models ( I don't have a board with external memory). Any suggestions on what to add for those would be welcome as well.

    If this diff meets with everybody's approval, I'd like to commit it to the repository myself.
    Looks okay to me. If Eric says it's okay then go ahead and commit it. Can you commit it to the p2test branch though?
  • SRLMSRLM Posts: 5,045
    edited 2013-04-11 16:59
    David Betz wrote: »
    Can you commit it to the p2test branch though?

    Yes I can. Once I do, I'll go ahead and add a tutorial on the Google Sites area. Which brings up another question: where is the preferred area for documentation: the wiki, the PropGCC Google Sites pages, ...?
  • jazzedjazzed Posts: 11,803
    edited 2013-04-11 17:41
    SRLM wrote: »
    Yes I can. Once I do, I'll go ahead and add a tutorial on the Google Sites area. Which brings up another question: where is the preferred area for documentation: the wiki, the PropGCC Google Sites pages, ...?

    For now use: https://sites.google.com/site/propellergcc/
    It's easier to make nice pages there.

    Both that site and propgcc wiki pages will be consolidated into another site soon. The old material will be removed.
  • ersmithersmith Posts: 6,054
    edited 2013-04-11 17:57
    The patch looks good to me, too. Thanks for sticking with this and figuring it out!
  • jazzedjazzed Posts: 11,803
    edited 2013-04-11 18:30
    Yes, please only commit to p2test branch.
  • Heater.Heater. Posts: 21,230
    edited 2013-04-12 11:44
    Is it so that this solution will remove all unused functions from whatever libraries one uses?

    If so I look forward to checking it out. For example TinyJS is a 60KByte program pulling in 550KBytes of C++ library code. I'm sure TinyJS is not using most of that.
  • SRLMSRLM Posts: 5,045
    edited 2013-04-12 14:15
    Heater. wrote: »
    Is it so that this solution will remove all unused functions from whatever libraries one uses?

    If so I look forward to checking it out. For example TinyJS is a 60KByte program pulling in 550KBytes of C++ library code. I'm sure TinyJS is not using most of that.

    --gc-sections removes sections that do not have a reference to them. To remove individual functions you must compile with -ffunction-sections. You can do the same for variables with the -fdata-sections flag. For many library functions this is not applicable, because each function is compiled into a separate .o file (and the compiler would not pull it in). It does come in handy, however, when multiple functions are put into the same file.

    The following cuts take out 3kB of code size, down to 12.5kB:
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._ZN16ConcurrentBuffer9LockclearEv' in file '/tmp/ccJMvtAq.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.rodata._ZN16ConcurrentBuffer5kSizeE' in file '/tmp/ccJMvtAq.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z9resetTestv' in file '/tmp/cciFfvOc.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z14UnityPrintMaskjj' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z15UnityAssertBitsiiiPKcj' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z24UnityAssertEqualIntArrayPKiS0_jPKcj21UNITY_DISPLAY_STYLE_T' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z26UnityAssertEqualFloatArrayPKfS0_jPKcj' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z23UnityAssertFloatsWithinfffPKcj' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z21UnityAssertFloatIsInffPKcj' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z24UnityAssertFloatIsNegInffPKcj' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z21UnityAssertFloatIsNaNfPKcj' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z24UnityAssertNumbersWithiniiiPKcj21UNITY_DISPLAY_STYLE_T' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z27UnityAssertEqualStringArrayPPKcS1_jS0_j' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z11UnityIgnorePKcj' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text._Z19UnityDefaultTestRunPFvvEPKci' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.data.UnityStrNaN' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.data.UnityStrNegInf' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.data.UnityStrInf' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.data.UnityStrDelta' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.data.UnityStrTo' in file '/tmp/ccs6RoMy.o'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.float.kerext' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(_loadfloat.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.kernel' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(_loadfloat.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.hubtext' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(_loadfloat.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(eqsf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_frame' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(eqsf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_info' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(eqsf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_abbrev' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(eqsf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_loc' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(eqsf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_aranges' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(eqsf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_ranges' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(eqsf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_line' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(eqsf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(gesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_frame' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(gesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_info' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(gesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_abbrev' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(gesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_loc' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(gesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_aranges' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(gesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_ranges' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(gesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_line' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(gesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(lesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_frame' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(lesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_info' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(lesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_abbrev' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(lesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_loc' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(lesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_aranges' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(lesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_ranges' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(lesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.debug_line' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/cmm/short-doubles/libgcc.a(lesf2.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.data' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/cmm/short-doubles/libc.a(fopen_intern.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.text' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/cmm/short-doubles/libc.a(thread.o)'
    /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld: Removing unused section '.data' in file '/opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/cmm/short-doubles/libc.a(thread.o)'
    

    As an interesting aside, you could modify the default linker script to change the size of hub memory, and compile very large programs (MB of memory, anyone? :) ). Of course it won't run...
  • SRLMSRLM Posts: 5,045
    edited 2013-04-30 01:53
    I'm on a roll: two commits in one night! The garbage collection commit is 69132bedd498.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-30 19:22
    SRLM: Thanks for checking in your linker script changes. I'll try them when I get back to NH this weekend.
  • SRLMSRLM Posts: 5,045
    edited 2013-04-30 19:33
    David Betz wrote: »
    SRLM: Thanks for checking in your linker script changes. I'll try them when I get back to NH this weekend.

    I've been using the changes for the last few weeks, and everything seems to be working fine. I've used it on small and large projects, LMM and CMM, with and without standard library, and with external .S files.

    I should note one thing: I've only tried it with propeller-elf-g++ (using C++), not propeller-elf-gcc (using C).
  • Jeff MartinJeff Martin Posts: 758
    edited 2013-05-30 08:36
    SRLM wrote: »
    I've been using the changes for the last few weeks, and everything seems to be working fine. I've used it on small and large projects, LMM and CMM, with and without standard library, and with external .S files.

    I should note one thing: I've only tried it with propeller-elf-g++ (using C++), not propeller-elf-gcc (using C).

    @SRLM: Thank you for doing all this!

    @ersmith, David Betz, jazzed: Thank you for following up on this feature!
  • David BetzDavid Betz Posts: 14,516
    edited 2013-05-30 08:56
    @SRLM: Thank you for doing all this!

    @ersmith, David Betz, jazzed: Thank you for following up on this feature!
    I can't really claim any credit. All the work was done by SRLM and Eric. All I did was encourage him to submit his changes.
Sign In or Register to comment.