This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ld/emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for "-r" option.
- From: Chen Gang <xili_gchen_5257 at hotmail dot com>
- To: binutils at sourceware dot org
- Date: Tue, 24 Mar 2015 16:31:53 +0800
- Subject: Re: [PATCH] ld/emulparams/elf32_tic6x_le.sh: Skip OTHER_BSS_SECTIONS for "-r" option.
- Authentication-results: sourceware.org; auth=none
- References: <BLU437-SMTP319D820D4080183F6DB12CB90F0 at phx dot gbl> <20150324002320 dot GI26234 at bubble dot grove dot modra dot org> <BLU436-SMTP95817BF656CF3D850E228FB90A0 at phx dot gbl> <20150324032358 dot GK26234 at bubble dot grove dot modra dot org>
On 3/24/15 11:23, Alan Modra wrote:
> On Tue, Mar 24, 2015 at 10:59:05AM +0800, Chen Gang wrote:
>> 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).
>
> No, that won't work. I meant something like
> if test -n "$RELOCATING"; then
>
After searched all ${RELOCATING} with ld source code, all are used as
${RELOCATING-/+...}.
In elf32_tic6x_le.sh, it always use ${RELOCATING-0}, and I tested the
diff with ${RELOCATING-0}, it would not generate OTHER_BSS_SECTIONS for
-r and -u, but would generated OTHER_BSS_SECTIONS in normal using.
So for me, I guess, ${RELOCATION-0} is OK, too.
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed