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] ld/emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for "-r" option.


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

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

        * emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for "-r"
        option.
---
 ld/ChangeLog                    | 5 +++++
 ld/emulparams/elf32_tic6x_le.sh | 8 ++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 3760916..da51085 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-21  Chen Gang  <gang.chen.5i5j@gmail.com>
+
+	* emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for "-r"
+	option.
+
 2015-03-18  Chen Gang  <gang.chen.5i5j@gmail.com>
 
 	* ldmain.c (main): Use %F instead of %X for einfo.
diff --git a/ld/emulparams/elf32_tic6x_le.sh b/ld/emulparams/elf32_tic6x_le.sh
index dfd64c1..62bd2c3 100644
--- a/ld/emulparams/elf32_tic6x_le.sh
+++ b/ld/emulparams/elf32_tic6x_le.sh
@@ -44,7 +44,10 @@ 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 ld -r, skip OTHER_BSS_SECTIONS, or will cause multiple definition.
+OTHER_BSS_SECTIONS="";
+if [ "x${LD_FLAG}" != "xr" ]; then
+  case ${target} in
     *-elf)
 	OTHER_BSS_SECTIONS="
   .heap :
@@ -60,5 +63,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]