This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Patch: Add END_SYMBOLS in ld/scripttempl/elf.sc
- From: Jie Zhang <jzhang918 at gmail dot com>
- To: binutils <binutils at sources dot redhat dot com>
- Date: Fri, 16 Dec 2005 12:01:32 +0800
- Subject: Patch: Add END_SYMBOLS in ld/scripttempl/elf.sc
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. */