[PATCH] ld/emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for "-r" option.
Chen Gang
xili_gchen_5257@hotmail.com
Tue Mar 24 02:59:00 GMT 2015
On 3/24/15 08:23, Alan Modra wrote:
> On Sat, Mar 21, 2015 at 11:20:04PM +0800, Chen Gang wrote:
>> * emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for "-r"
>> option.
>
> This looks OK, except
>
>> +# For ld -r, skip OTHER_BSS_SECTIONS, or will cause multiple definition.
>> +OTHER_BSS_SECTIONS="";
>> +if [ "x${LD_FLAG}" != "xr" ]; then
>
> this should test $RELOCATING instead of $LD_FLAG.
>
OK, thanks. I guess your meaning is that we need use ${RELOCATING-0}
instead of "x${LD_FLAG}" != "xr". If it is incorrect, please let me
know (the related diff may like below).
------------------------ diff begin ------------------------------------
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)) }'
------------------------ diff end --------------------------------------
And I shall send patch v2 within 2 days (2015-03-25).
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
More information about the Binutils
mailing list