diff options
author | ticat_fp <fanpeng@loongson.cn> | 2024-02-26 11:11:35 +0800 |
---|---|---|
committer | liuzhensong <liuzhensong@loongson.cn> | 2024-02-27 14:22:23 +0800 |
commit | 268391acb9fa956bad24533e2cc0d1459dea1b3d (patch) | |
tree | df3d788a1617f27cd1f5e652e7f6be0b5934081b /ld | |
parent | fb266c9083b42d6287b2fe93a82ffe663d8f4640 (diff) | |
download | gdb-268391acb9fa956bad24533e2cc0d1459dea1b3d.zip gdb-268391acb9fa956bad24533e2cc0d1459dea1b3d.tar.gz gdb-268391acb9fa956bad24533e2cc0d1459dea1b3d.tar.bz2 |
LoongArch: Modify inconsistent behavior of ld with --unresolved-symbols=ignore-all
Remove duplicated check when producing executable files that reference external symbols
defined in other files. RELOC_FOR_GLOBAL_SYMBOL will check it.
Testcase is:
resolv.c:
int main(int argc, char *argv[]) {
return argc;
}
t.c:
extern const struct my_struct ms1;
static const struct my_struct *ms = &ms1;
t.h:
typedef struct my_struct {
char *str;
int i;
} my_struct;
Compiling and linking command with:
gcc t.c -c ; gcc resolv.c -c
gcc resolv.o t.o -o resolv -Wl,--unresolved-symbols=ignore-all
Got error as:
~/install/usr/bin/ld: t.o:(.data.rel+0x0): undefined reference to `ms1'
collect2: error: ld returned 1 exit status
Diffstat (limited to 'ld')
0 files changed, 0 insertions, 0 deletions