diff mbox

[avr] Fix PR30417: Wrap -Tdata into %{!Tdata:...}.

Message ID 4ed641e0-6de8-5c95-794a-842f75b7a2af@gjlay.de
State New
Headers show

Commit Message

Georg-Johann Lay June 20, 2016, 1:36 p.m. UTC
This patch allows to specify -Tdata and -Ttext on the command line for MCUs 
where the specs file sets these options.  For -mmcu=atmega88 for example, the 
respective specs reads:

*link_data_start:
	-Tdata 0x800100

and the patch changes this to

*link_data_start:
	%{!Tdata:-Tdata 0x800100}

Same for *link_text_start and -Ttext.

Ok for trunk and backport?

Johann


	PR target/30417
	* config/avr/gen-avr-mmcu-specs.c (print_mcu):
	[*link_data_start]: Wrap -Tdata into %{!Tdata:...}.
	[*link_text_start]: Wrap -Ttext into %{!Ttext:...}.

Comments

Denis Chertykov June 20, 2016, 5:10 p.m. UTC | #1
2016-06-20 16:36 GMT+03:00 Georg-Johann Lay <avr@gjlay.de>:
> This patch allows to specify -Tdata and -Ttext on the command line for MCUs
> where the specs file sets these options.  For -mmcu=atmega88 for example,
> the respective specs reads:
>
> *link_data_start:
>         -Tdata 0x800100
>
> and the patch changes this to
>
> *link_data_start:
>         %{!Tdata:-Tdata 0x800100}
>
> Same for *link_text_start and -Ttext.
>
> Ok for trunk and backport?
>
> Johann
>
>
>         PR target/30417
>         * config/avr/gen-avr-mmcu-specs.c (print_mcu):
>         [*link_data_start]: Wrap -Tdata into %{!Tdata:...}.
>         [*link_text_start]: Wrap -Ttext into %{!Ttext:...}.
>

Ok. Please apply.
diff mbox

Patch

Index: config/avr/gen-avr-mmcu-specs.c
===================================================================
--- config/avr/gen-avr-mmcu-specs.c	(revision 237587)
+++ config/avr/gen-avr-mmcu-specs.c	(working copy)
@@ -242,12 +242,13 @@  bool is_arch = NULL == mcu->macro;
       fprintf (f, "*link_data_start:\n");
       if (mcu->data_section_start
           != arch->default_data_section_start)
-        fprintf (f, "\t-Tdata 0x%lX", 0x800000UL + mcu->data_section_start);
+        fprintf (f, "\t%%{!Tdata:-Tdata 0x%lX}",
+                 0x800000UL + mcu->data_section_start);
       fprintf (f, "\n\n");
 
       fprintf (f, "*link_text_start:\n");
       if (mcu->text_section_start != 0x0)
-        fprintf (f, "\t-Ttext 0x%lX", 0UL + mcu->text_section_start);
+        fprintf (f, "\t%%{!Ttext:-Ttext 0x%lX}", 0UL + mcu->text_section_start);
       fprintf (f, "\n\n");
     }