Summary: | internal error in target, at ../../binutils/gold/parameters.h:105 | ||
---|---|---|---|
Product: | binutils | Reporter: | Andrew Senkevich <andrew.n.senkevich> |
Component: | gold | Assignee: | Cary Coutant <ccoutant> |
Status: | CLOSED FIXED | ||
Severity: | normal | CC: | ccoutant, ian |
Priority: | P2 | ||
Version: | 2.26 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Andrew Senkevich
2015-07-20 20:47:25 UTC
> Where is the proper place for initialization?
gold doesn't set the target until it sees its first object file. In the case of an archive library as the first parameter, we have no way of knowing what the default entry point should be (because the entry point symbol is target specific).
Parameters::entry() should first check that target has been set, and if not, simply return NULL.
Library_base::should_include_member() should check for NULL, and either skip the check for the entry symbol, or print a warning that the -e option should be used when there is no startup file.
(In reply to Cary Coutant from comment #1) ... > or print a warning that the -e option should > be used when there is no startup file. But it could be some incremental linking. And, for example, ld.bfd doesn't print such warning. Also it seems we need additional field to save "entry point found" state while passing all object files. Is it really necessary? When linking with -r, Gnu ld doesn't use the entry symbol, so gold shouldn't either. When linking without -r, gold needs to know the target in order to know the entry symbol, so if no target has been established, don't look for an entry symbol. The master branch has been updated by Cary Coutant <ccoutant@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b8c6c5ef99ef8f07fcea1c777d5084dc6f7232e5 commit b8c6c5ef99ef8f07fcea1c777d5084dc6f7232e5 Author: Cary Coutant <ccoutant@gmail.com> Date: Tue Jul 21 12:50:45 2015 -0700 Fix typo in PR number. Fix internal error when linking an archive library with no preceding objects. gold/ PR gold/18698 * archive.cc (Library_base::should_include_member): Don't use entry point for relocatable links, or if target is not yet valid. * parameters.cc (Parameters::entry): Check target_valid(). Fixed on trunk. Sorry, I had a typo in the ChangeLog entry when I committed this. The actual commit that fixed the bug is here: https://sourceware.org/ml/binutils-cvs/2015-07/msg00142.html Thank you. |