[BFD][PR21703]Override the new defined symbol with the old normal symbol when --allow-multiple-definition is provided

Renlin Li renlin.li@foss.arm.com
Thu Oct 26 10:10:00 GMT 2017


Hi Alan,

Thanks for the review! I updated the patch with your suggestions.

Allow the "ld -r" test for targets without shared library support.
Relax pr21703-r.sd and pr21703-shared.sd with additional "#..." pattern lines.

All targets checked again in cross environment. No failures.

Regards,
Renlin

ld/ChangeLog:

2017-10-26  Renlin Li  <renlin.li@arm.com>

	* testsuite/ld-elf/elf.exp: xfail pr21703 tests on specific targets.
	Only run shared lib test for targets which support it.
	* testsuite/ld-elf/pr21703-r.sd: Adjust the expected output.
	* testsuite/ld-elf/pr21703-shared.sd: Likewise.



On 25/10/17 22:12, Alan Modra wrote:
> On Wed, Oct 25, 2017 at 09:24:21PM +0100, Renlin Li wrote:
>> Hi,
>>
>> This patch fixes the test cases failures on target which don't support share library.
>> Additional, targets which use _bfd_generic_link_add_symbols instead of
>> bfd_elf_link_add_symbols are expected to fail on those tests.
>>
>> all the failed targets mentioned by Alan have been checked. All fixed.
>> However, all the checks are done on cross-target environment as I don't
>> native environment except arm, aarch64 and x86.
>>
>> Is it Okay to commit?
>
> No, there isn't any reason why the ld -r test shouldn't run on targets
> without shared lib support.  If I take a look at the first target in
> my list that failed the ld -r test, avr-elf, I see the readelf -s
> output is
>
> Symbol table '.symtab' contains 17 entries:
>     Num:    Value  Size Type    Bind   Vis      Ndx Name
>       0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
>       1: 00000000     0 SECTION LOCAL  DEFAULT    1
>       2: 00000000     0 SECTION LOCAL  DEFAULT    2
>       3: 00000000     0 SECTION LOCAL  DEFAULT    3
>       4: 0000ffa0     0 NOTYPE  GLOBAL DEFAULT  ABS __DATA_REGION_LENGTH__
>       5: 00000000     4 FUNC    GLOBAL DEFAULT    1 foo@FOO
>       6: 00000400     0 NOTYPE  GLOBAL DEFAULT  ABS __LOCK_REGION_LENGTH__
>       7: 00000004    32 FUNC    GLOBAL DEFAULT    1 foo1
>       8: 00000400     0 NOTYPE  GLOBAL DEFAULT  ABS __SIGNATURE_REGION_LENGTH
>       9: 00000004    32 FUNC    GLOBAL DEFAULT    1 foo@@FOO1
>      10: 00000034     8 FUNC    GLOBAL DEFAULT    1 bar1
>      11: 00000400     0 NOTYPE  GLOBAL DEFAULT  ABS __USER_SIGNATURE_REGION_L
>      12: 00000000     4 FUNC    GLOBAL DEFAULT    1 foo
>      13: 00010000     0 NOTYPE  GLOBAL DEFAULT  ABS __EEPROM_REGION_LENGTH__
>      14: 00000024    16 FUNC    GLOBAL DEFAULT    1 bar
>      15: 00000400     0 NOTYPE  GLOBAL DEFAULT  ABS __FUSE_REGION_LENGTH__
>      16: 00002000     0 NOTYPE  GLOBAL DEFAULT  ABS __TEXT_REGION_LENGTH__
>
> The foo and bar symbols are actually the right size, but we have extra
> symbols.  pr21703-r.sd ought to be modified to make this pass, by
> inserting "#..." lines between the symbols you need to check.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmp.diff
Type: text/x-patch
Size: 3384 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20171026/e9da87d2/attachment.bin>


More information about the Binutils mailing list