[gold] PR gold/18048 Patch to support non-toplevel and nesting INCLUDE
Hán Shěn (沈涵)
shenhan@google.com
Wed Mar 4 03:48:00 GMT 2015
HI Cary, thanks, that's great! (didn't notice you have a quick/good solution).
I'll back-port it to chromeos after your submission.
Thanks,
Han
On Tue, Mar 3, 2015 at 6:23 PM, Cary Coutant <ccoutant@google.com> wrote:
>> Hi here is the patch for PR gold/18048 - gold does not support
>> non-toplevel INCLUDE properly. With this bug, Gold fails to build one
>> particular package (coreboot) of ChromeOs.
>
> Thanks for working on this, but I think it can be much, much, simpler.
>
> All we really need is three new productions at the top level:
>
> top:
> ...
> | PARSING_SECTIONS_BLOCK sections_block
> | PARSING_SECTION_COMMANDS section_cmds
> | PARSING_MEMORY_DEF memory_defs
>
> Then we can just pass a first_token to script_include_directive(), like this:
>
> | INCLUDE string
> { script_include_directive(PARSING_SECTIONS_BLOCK,
> closure, $2.value, $2.length); }
>
> ...and have it pass that on to read_script_file().
>
> I did have to clone the productions for file_or_sections_cmd, because
> the INCLUDE directive there could have meant either
> PARSING_LINKER_SCRIPT or PARSING_SECTIONS_BLOCK, depending on context.
>
> I'll commit the attached patch after I update a few of the script
> tests to exercise INCLUDE directives.
>
> -cary
--
Han Shen | Software Engineer | shenhan@google.com | +1-650-440-3330
More information about the Binutils
mailing list