This is the mail archive of the binutils@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]

[PATCH v2] ld/emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for relocating operation.


It will cause multiple definitions for _HEAP_START, _HEAP_MAX, and
_STACK_START (e.g. build linux kernel).

2015-03-27  Chen Gang  <gang.chen.5i5j@gmail.com>

	* emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for
	relocating operation.
---
 ld/ChangeLog                    | 5 +++++
 ld/emulparams/elf32_tic6x_le.sh | 9 +++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 3a5edf2..587e2be 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-27  Chen Gang  <gang.chen.5i5j@gmail.com>
+
+	* emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for
+	relocating operation.
+
 2015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
 
 	* emultempl/aarch64elf.em (_aarch64_add_stub_section): Set section
diff --git a/ld/emulparams/elf32_tic6x_le.sh b/ld/emulparams/elf32_tic6x_le.sh
index dfd64c1..6533c7f 100644
--- a/ld/emulparams/elf32_tic6x_le.sh
+++ b/ld/emulparams/elf32_tic6x_le.sh
@@ -44,7 +44,11 @@ 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 +64,6 @@ case ${target} in
     _STACK_START = .;
   }"
 	;;
-esac
+  esac
+fi
 ATTRS_SECTIONS='.c6xabi.attributes 0 : { KEEP (*(.c6xabi.attributes)) KEEP (*(.gnu.attributes)) }'
-- 
1.9.3


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