patchAVR C Runtime Library - Patches: patch #3593, Reassigned item: extend linker...

 
 

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

patch #3593: Reassigned item: extend linker scripts to permit -fdata-sections (gcc PR14064) and -ffunction-sections

Submitter:  None
Submitted:  Thu 23 Dec 2004 08:54:35 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Closed

Jump to the original submission

Mon 01 May 2006 04:29:13 PM UTC, comment #7: 

It's done.

Anatoly Sokolov <aesok>
Group administrator
Wed 02 Mar 2005 11:14:47 PM UTC, comment #6: 

I've tested Rolf's patch for avr-specific things:
.progmem.gcc_sw_table
.eeprom
.progmem

I haven't found any problems with it.

Bernd Trog

Anonymous
Fri 07 Jan 2005 01:17:08 PM UTC, comment #5: 

The ld.texi has some description of the purpose of the KEEP command:

Input Section and Garbage Collection
....................................

   When link-time garbage collection is in use (`--gc-sections'), it is often useful to mark sections that should not be eliminated.  This is accomplished by surrounding an input section's wildcard entry with `KEEP()', as in KEEP((.init))' or `KEEP(SORT()(.ctors))'.

---------------------------------------

See other sc scripts like xstormy16.sc, which has similar comments.  I am not sure about the correct placement for keeping the descrutors (.fini?). It seems to work OK.

Additionally we link all .data.* sections as well (for -fdata-sections), see line 119.

Here is a patch against avr.sc.  It is not really well tested, but at least preliminarily tested.  I don't have much AVR programs to test for regressions:

--- avr.sc~ 2002-06-02 01:28:59.000000000 +0200
+++ avr.sc 2005-01-07 13:45:29.402862400 +0100
@@ -74,7 +74,7 @@
   /* Internal text space or external memory */
   .text :
   {
-    *(.vectors)
+    KEEP(*(.vectors))
 
     ${CONSTRUCTING+ __ctors_start = . ; }
     ${CONSTRUCTING+ *(.ctors) }
@@ -86,20 +86,21 @@
     (.progmem.gcc)
     (.progmem)
     ${RELOCATING+. = ALIGN(2);}
-    (.init0)  / Start here after reset.  */
-    *(.init1)
-    (.init2)  / Clear _zero_reg_, set up stack pointer.  */
-    *(.init3)
-    (.init4)  / Initialize data and BSS.  */
-    *(.init5)
-    (.init6)  / C++ constructors.  */
-    *(.init7)
-    *(.init8)
-    (.init9)  / Call main().  */
+    KEEP((.init0))  / Start here after reset.  */
+    KEEP(*(.init1))
+    KEEP((.init2))  / Clear _zero_reg_, set up stack pointer.  */
+    KEEP(*(.init3))
+    KEEP((.init4))  / Initialize data and BSS.  */
+    KEEP(*(.init5))
+    KEEP((.init6))  / C++ constructors.  */
+    KEEP(*(.init7))
+    KEEP(*(.init8))
+    KEEP((.init9))  / Call main().  */
     *(.text)
     ${RELOCATING+. = ALIGN(2);}
     (.text.)
     ${RELOCATING+. = ALIGN(2);}
+    KEEP(*(.fini?))
     (.fini9)  / _exit() starts here.  */
     *(.fini8)
     *(.fini7)
@@ -117,6 +118,8 @@
   {
     ${RELOCATING+ PROVIDE (__data_start = .) ; }
     *(.data)
+    ${RELOCATING+. = ALIGN(2);}
+    (.data.)
     (.gnu.linkonce.d)
     ${RELOCATING+. = ALIGN(2);}
     ${RELOCATING+ _edata = . ; }

Rolf Ebert <rolf_ebert>
Mon 27 Dec 2004 08:23:57 PM UTC, comment #4: 

Linker scripts like avr2.x are generated from ld/scripttempl/avr.sc - please submit a well tested patch for the latter.  I've never used --gc-sections, so I'm not sure how the scripts with other extensions (depending on $RELOCATING etc.) should be changed.

Marek Michalkiewicz <marekm>
Group administrator
Mon 27 Dec 2004 07:03:36 PM UTC, comment #3: 

Assigning to Marek as he has write permission in binutils (where this patch would go).

Eric Weddington <arcanum>
Group administrator
Thu 23 Dec 2004 08:54:35 AM UTC, comment #2: 

This item has been reassigned from the project AVR C Runtime Library bugs tracker to your tracker.

The original report is still available at bugs #11383

Following are the information included in the original report:

[field #0] Item ID: 11383
[field #1] Group ID: 2140
[field #2] Status: Open
[field #3] Severity: 5 - Average
[field #4] Privacy: Public
[field #5] Category: Library
[field #6] Submitted by: None
[field #7] Assigned to: None
[field #8] Submitted on: Thu 12/23/2004 at 08:21
[field #9] Summary: extend linker scripts to permit -fdata-sections (gcc PR14064) and  -ffunction-sections
[field #10] Original Submission: gcc-3.4.3 now fully supports -fdata-sections (PR14064) and

-ffunction-sections for AVR targets.  It needs, however, modified linker scripts. see the attached patch for avr2.x
[field #12] Item Group: None
[field #13] Resolution: None
[field #14] Component Version: None
[field #15] Platform Version: None
[field #16] Reproducibility: None
[field #17] Size (loc): None
[field #18] Fixed Release: None
[field #19] Planned Release: None
[field #20] Effort: 0.00
[field #24] Priority: 5 - Normal
[field #27] Percent Complete: 0%
[field #29] Release: None
[field #32] Originator Email: rolf.ebert@gmx.net
[field #54] Custom Select Box #1: None
[field #55] Custom Select Box #2: None
[field #56] Custom Select Box #3: None
[field #57] Custom Select Box #4: None
[field #58] Custom Select Box #5: None
[field #59] Custom Select Box #6: None
[field #60] Custom Select Box #7: None
[field #61] Custom Select Box #8: None
[field #62] Custom Select Box #9: None
[field #63] Custom Select Box #10: None

Joerg Wunsch <joerg_wunsch>
Group administrator
Thu 23 Dec 2004 08:54:31 AM UTC, comment #1: 

Move to the patch tracker, as it is a feature request rather
than a bug, and a patch is supplied as well.

Joerg Wunsch <joerg_wunsch>
Group administrator
Thu 23 Dec 2004 08:54:35 AM UTC, original submission:  

gcc-3.4.3 now fully supports -fdata-sections (PR14064) and
-ffunction-sections for AVR targets.  It needs, however, modified linker scripts. see the attached patch for avr2.x

Anonymous

 

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

Attached Files
file #8224:  avr.sc.udiff added by rolf_ebert (2KiB - application/octet-stream - Patch against avr.sc)
file #8204:  avr-libc-1.0-avr2.x.diff added by None (2KiB - application/octet-stream - patch to linker script to make --gc-sections work correctly)

 

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.

 

Follow 8 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-05-01 aesok StatusNone Done
    Assigned tomarekm None
    Open/ClosedOpen Closed
2005-01-07 rolf_ebert Attached File- Added avr.sc.udiff, #4005
    Carbon-Copy- Added rolf_ebert --AT-- web --DOT-- de
2004-12-27 arcanum Assigned toNone marekm
    Originator Email -email is unavailable-
2004-12-23 joerg_wunsch Reassign itemFrom group AVR C Runtime Library, bugs tracker To group AVR C Runtime Library, patch tracker

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code