Patch: Add END_SYMBOLS in ld/scripttempl/elf.sc

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch: Add END_SYMBOLS in ld/scripttempl/elf.sc

jiez
Hi,

This patch adds END_SYMBOLS in ld/scripttempl/elf.sc. Such that targets,
like bfin, can customize it. This patch also defines DATA_END_SYMBOLS
and END_SYMBOLS and adds a prefix '_' to ENTRY for bfin to avoid
namespace pollution in user applications.

Is it OK to add END_SYMBOLS in ld/scripttempl/elf.sc?

Thanks,
Jie


        * emulparams/bfin.sh: Define DATA_END_SYMBOLS and END_SYMBOLS.
        And add a prefix '_' to ENTRY.
        * scripttempl/elf.sc: Add END_SYMBOLS.


Index: ld/emulparams/bfin.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/bfin.sh,v
retrieving revision 1.1
diff -u -r1.1 bfin.sh
--- ld/emulparams/bfin.sh 30 Sep 2005 15:23:16 -0000 1.1
+++ ld/emulparams/bfin.sh 16 Dec 2005 03:40:36 -0000
@@ -6,8 +6,10 @@
 NONPAGED_TEXT_START_ADDR=${TEXT_START_ADDR}
 ARCH=bfin
 MACHINE=
-ENTRY=_start
+ENTRY=__start
 TEMPLATE_NAME=elf32
 GENERATE_SHLIB_SCRIPT=yes
 EMBEDDED=yes
 EXTRA_EM_FILE=bfin
+DATA_END_SYMBOLS="__edata = .; PROVIDE (_edata = .);"
+END_SYMBOLS="__end = .; PROVIDE (_end = .);"
Index: ld/scripttempl/elf.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v
retrieving revision 1.69
diff -u -r1.69 elf.sc
--- ld/scripttempl/elf.sc 11 Dec 2005 00:49:19 -0000 1.69
+++ ld/scripttempl/elf.sc 16 Dec 2005 03:40:36 -0000
@@ -451,8 +451,7 @@
   ${LARGE_SECTIONS}
   ${RELOCATING+. = ALIGN(${ALIGNMENT});}
   ${RELOCATING+${OTHER_END_SYMBOLS}}
-  ${RELOCATING+_end = .;}
-  ${RELOCATING+PROVIDE (end = .);}
+  ${RELOCATING+${END_SYMBOLS-_end = .; PROVIDE (end = .);}}
   ${RELOCATING+${DATA_SEGMENT_END}}
 
   /* Stabs debugging sections.  */
Reply | Threaded
Open this post in threaded view
|

Re: Patch: Add END_SYMBOLS in ld/scripttempl/elf.sc

Alan Modra
On Fri, Dec 16, 2005 at 12:01:32PM +0800, Jie Zhang wrote:
> Is it OK to add END_SYMBOLS in ld/scripttempl/elf.sc?

Yes, this is OK.

--
Alan Modra
IBM OzLabs - Linux Technology Centre
Reply | Threaded
Open this post in threaded view
|

Re: Patch: Add END_SYMBOLS in ld/scripttempl/elf.sc

jiez
Alan Modra wrote:
> On Fri, Dec 16, 2005 at 12:01:32PM +0800, Jie Zhang wrote:
>
>>Is it OK to add END_SYMBOLS in ld/scripttempl/elf.sc?
>
> Yes, this is OK.
>
Thanks! Committed.

Jie