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]

Re: [PATCH] ld/emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for "-r" option.


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


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