Bug 27741 - Using --emit-relocs with --gc-sections or -flto ends in failure
Summary: Using --emit-relocs with --gc-sections or -flto ends in failure
Status: RESOLVED DUPLICATE of bug 25968
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.27
: P2 normal
Target Milestone: ---
Assignee: Cary Coutant
URL:
Keywords:
Depends on: 25968
Blocks:
  Show dependency treegraph
 
Reported: 2021-04-16 07:50 UTC by zhiwei
Modified: 2022-09-04 07:02 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhiwei 2021-04-16 07:50:41 UTC
test.c:
main(){ return 0; }


1) CFLAGS="-fuse-ld=gold -Wl,--emit-relocs -Wl,--gc-sections" make test
2) CFLAGS="-fuse-ld=gold -Wl,--emit-relocs -flto" make test

1)
/usr/bin/ld.gold: internal error in do_layout, at object.cc:1821
collect2: error: ld returned 1 exit status

2)
/usr/bin/ld.gold: internal error in emit_relocs_scan, at reloc.cc:518
collect2: error: ld returned 1 exit status
Comment 1 Fangrui Song 2022-09-04 07:02:43 UTC
Duplicate of PR25968

*** This bug has been marked as a duplicate of bug 25968 ***