This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Make mergeable read-only sections per-function, if requested.
- From: Jeff Law <law at redhat dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>, Marek Polacek <polacek at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 07 May 2015 07:31:33 -0600
- Subject: Re: [PATCH] Make mergeable read-only sections per-function, if requested.
- Authentication-results: sourceware.org; auth=none
- References: <8f67f9aad3d5b98cb428dea0316a86615b89adb9 dot 1430937961 dot git dot segher at kernel dot crashing dot org> <20150507081507 dot GA3384 at redhat dot com> <20150507123058 dot GA23850 at gate dot crashing dot org>
On 05/07/2015 06:30 AM, Segher Boessenkool wrote:
If you could cobble together a little test (ppc specific is fine with
me) it'd be appreciated.
On Thu, May 07, 2015 at 10:15:08AM +0200, Marek Polacek wrote:
+const char *
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);
+ if (SECTION_STYLE (s) == SECTION_NAMED)
+ return s->named.name;
+ 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 <firstname.lastname@example.org>
* varasm.c (function_mergeable_rodata_prefix): New function.
(mergeable_string_section): Use it.
(mergeable_constant_section): Use it.
With that, approved for the trunk.