This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Make mergeable read-only sections per-function, if requested.

On 05/07/2015 06:30 AM, Segher Boessenkool wrote:
On Thu, May 07, 2015 at 10:15:08AM +0200, Marek Polacek wrote:
+const char *
+function_mergeable_rodata_prefix (void)

This function needs a comment.

And much more importantly, I forgot to make it static.  Fixed.

+  section *s = targetm.asm_out.function_rodata_section (current_function_decl);
+    return s->;
+      else
+    return targetm.asm_out.mergeable_rodata_prefix;

else is wrongly formatted.

Huh, how did I do this.  Fixed.

Thanks for the review.  New patch:

- - -

Make mergeable read-only sections per-function, if requested.

Currently GCC does not put mergeable read-only data in a per-function
section, so the --gc-sections linker option does not do much for such
data.  Fix that.

Bootstrapped and tested on powerpc64-linux; no regressions.

Is this okay for trunk?


2015-05-07  Segher Boessenkool  <>

	PR middle-end/192
	PR middle-end/54303
	* varasm.c (function_mergeable_rodata_prefix): New function.
	(mergeable_string_section): Use it.
	(mergeable_constant_section): Use it.
If you could cobble together a little test (ppc specific is fine with me) it'd be appreciated.

With that, approved for the trunk.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]