This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Prevent multiple definitions for _HEAP_START, _HEAP_MAX, and _STACK_START when performing a relocata


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=16c1c9d6a6f485af1b5b1a54a74dc1ebb25b16c0

commit 16c1c9d6a6f485af1b5b1a54a74dc1ebb25b16c0
Author: Chen Gang <gang.chen.5i5j@gmail.com>
Date:   Wed Apr 1 11:29:46 2015 +0100

    Prevent multiple definitions for _HEAP_START, _HEAP_MAX, and _STACK_START when performing a relocatable link with a tic6x target.
    
    	* emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for
    	relocating operation.

Diff:
---
 ld/ChangeLog                    |  5 +++++
 ld/emulparams/elf32_tic6x_le.sh | 10 ++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index b8c506f..718cdb6 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-01  Chen Gang  <gang.chen.5i5j@gmail.com>
+
+	* emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for
+	relocating operation.
+
 2015-04-01  Alan Modra  <amodra@gmail.com>
 
 	* ldlang.c (lang_size_sections): When alignment of sections
diff --git a/ld/emulparams/elf32_tic6x_le.sh b/ld/emulparams/elf32_tic6x_le.sh
index dfd64c1..efd7b24 100644
--- a/ld/emulparams/elf32_tic6x_le.sh
+++ b/ld/emulparams/elf32_tic6x_le.sh
@@ -44,7 +44,12 @@ OTHER_READWRITE_SECTIONS=".fardata ${RELOCATING-0} : { *(.fardata${RELOCATING+ .
 OTHER_READWRITE_RELOC_SECTIONS="
   .rel.fardata     ${RELOCATING-0} : { *(.rel.fardata${RELOCATING+ .rel.fardata.*}) }
   .rela.fardata    ${RELOCATING-0} : { *(.rela.fardata${RELOCATING+ .rela.fardata.*}) }"
-case ${target} in
+# For relocating operation, skip OTHER_BSS_SECTIONS, or will cause multiple definition.
+if [ ${RELOCATING-0} ]; then
+  OTHER_BSS_SECTIONS="";
+else
+  case ${target} in
+
     *-elf)
 	OTHER_BSS_SECTIONS="
   .heap :
@@ -60,5 +65,6 @@ case ${target} in
     _STACK_START = .;
   }"
 	;;
-esac
+  esac
+fi
 ATTRS_SECTIONS='.c6xabi.attributes 0 : { KEEP (*(.c6xabi.attributes)) KEEP (*(.gnu.attributes)) }'


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]