If --allow-multiple-definition option is given, LLD does not treat duplicate
symbol error as a fatal error. GNU LD supports this option.
Details
Details
- Reviewers
Bigcheese shankarke - Commits
- rL205015: [ELF] Add --allow-multiple-definition option.
Diff Detail
Diff Detail
Event Timeline
Comment Actions
You would need to correct error to a warning if allow multiple definition option is used.
Comment Actions
actually infact, there is no warning even shown with gnu, you might want the errors that is displayed to the user when there is a multiple definition.
Testcase with Gnu :-
cat > 1.c << \!
int foo = 10;
!
+ cat
cat > 2.c << \!
int foo = 10;
!
+ cat
gcc -c 1.c 2.c
+ gcc -c 1.c 2.c
ld 1.o 2.o --allow-multiple-definition
+ ld 1.o 2.o --allow-multiple-definition
ld: warning: cannot find entry symbol _start; defaulting to 00000000004000b0