This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: GOLD: Add support for MEMORY regions in linker scripts
- From: Ian Lance Taylor <iant at google dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 08 Sep 2010 08:42:25 -0700
- Subject: Re: RFC: GOLD: Add support for MEMORY regions in linker scripts
- References: <m3r5ht5ytt.fsf@redhat.com> <mcraaoh47pw.fsf@google.com> <4C7FA9F6.2060600@redhat.com>
Nick Clifton <nickc@redhat.com> writes:
> gold/ChangeLog
> 2010-09-02 Nick Clifton <nickc@redhat.com>
>
> * README: Remove claim that MEMORY is not supported.
> * expression.cc (script_exp_function_origin)
> (script_exp_function_length): Move from here to ...
> * script.cc: ... here.
> (script_set_section_region, script_add_memory)
> (script_parse_memory_attr, script_include_directive): New
> functions.
> * script-sections.cc
> (class Memory_region): New class.
> (class Output_section_definition): Add set_memory_region,
> set_section_vma, set_section_lma and get_section_name methods.
> (class Script_Sections): Add add_memory_region,
> find_memory_region, find_memory_region_origin,
> find_memory_region_length and set_memory_region methods.
> Have set_section_addresses method walk the list of set memory
> regions.
> Extend the print methos to display memory regions.
> * script-sections.h: Add prototypes for new methods.
> Add enum for MEMORY region attributes.
> * yyscript.y: Add support for parsing MEMORY regions.
> * script-c.h: Add prototypes for new functions.
> * testsuite/Makefile.am: Add test of MEMORY region functionality.
> * testsuite/Makefile.in: Regenerate.
> * testsuite/memory_test.sh: New script.
> * testsuite/memory_test.s: New assembler source file.
> * testsuite/memory_test.t: New linker script.
> + extern void
> + script_add_memory(void*, const char*, size_t, unsigned int, Expression_ptr, Expression_ptr);
Line too long.
> + { gold_error (_("Attempt to set a memory region for a non-output section")); }
No space before left parenthesis.
> + gold_error (_("region '%.*s' already defined"), namelen, name);
Likewise.
> + switch (*attrs++)
> + {
> + case 'R':
> + case 'r':
> + attributes |= MEM_READABLE; break;
It's hard to tell in the diff format, but I'm not sure the indentation
is correct here. The statements after the case labels should be
indented by two spaces.
This is OK with those changes.
Thanks.
Ian