[gold commit] PR 14746: Fix internal error in gold when script uses section address in assignment

Cary Coutant ccoutant@gmail.com
Wed Aug 26 01:17:00 GMT 2015


When processing assignment expressions in a linker script, gold processes
absolute assignments early, but when one of those assignments involves the
address of a section that has not yet been finalized, we get an internal
error in address. This patch fixes the problem by gracefully returning
from expression evaluation even if the address is not yet valid, and
deferring the assignment in such a case.

-cary


2015-08-25  Cary Coutant  <ccoutant@gmail.com>

gold/
        PR gold/14746
        * expression.cc (Expression::Expression_eval_info): Add
        is_valid_pointer field.
        (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
        Adjust all callers.
        (Addr_expression::value_from_output_section): Check whether address
        is valid.
        * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
        if evaluation failed due to address that is not yet valid.
        * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
        parameter.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr14746.patch
Type: application/octet-stream
Size: 6600 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150826/6a3981ac/attachment.obj>


More information about the Binutils mailing list