Browse Source
Note that we don't even warn if scripts adjust a symbol as in ld-elf/var1 and ld-scripts/pr14962. include/ * bfdlink.h (struct bfd_link_info): Add warn_multiple_definition. ld/ * ldexp.c (exp_fold_tree_1): Warn on script defining a symbol defined in an object file. * ldmain.c (multiple_definition): Heed info->warn_multiple_definition. * testsuite/ld-scripts/defined5.d: Expect a warning.binutils-2_37-branch
6 changed files with 32 additions and 11 deletions
@ -1,10 +1,11 @@ |
|||||
#ld: -Tdefined5.t |
#ld: -Tdefined5.t |
||||
|
#warning: .*multiple definition of `defined'.* |
||||
#nm: -B |
#nm: -B |
||||
#source: defined5.s |
|
||||
#xfail: [is_xcoff_format] |
#xfail: [is_xcoff_format] |
||||
# xcoff outputs value of "defined" from the object file |
# xcoff outputs value of "defined" from the object file |
||||
|
|
||||
# Check that arithmetic on DEFINED works. |
# Check that a script can override an object file symbol, if multiple |
||||
|
# definitions are allowed. See pr12356. |
||||
#... |
#... |
||||
0+1000 D defined |
0+1000 D defined |
||||
#pass |
#pass |
||||
|
|||||
Loading…
Reference in new issue