From patchwork Sun Mar 1 20:47:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 5381 Received: (qmail 104970 invoked by alias); 1 Mar 2015 21:57:33 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 104902 invoked by uid 89); 1 Mar 2015 21:57:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Message-Id: In-Reply-To: References: From: Florian Weimer Date: Sun, 1 Mar 2015 21:47:31 +0100 Subject: [PATCH 2/6] vfprintf: Introduce JUMP_TABLE_BASE_LABEL To: libc-alpha@sourceware.org This makes the offset handling more explicit and avoids cross-references between the jump tables. --- stdio-common/vfprintf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index d575994..16e70b8 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -304,7 +304,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) spec = (ChExpr); \ offset = NOT_IN_JUMP_RANGE (spec) ? REF (form_unknown) \ : table[CHAR_CLASS (spec)]; \ - ptr = &&do_form_unknown + offset; \ + ptr = &&JUMP_TABLE_BASE_LABEL + offset; \ goto *ptr; \ } \ while (0) @@ -1329,7 +1329,8 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) do { #ifdef SHARED -# define REF(Name) &&do_##Name - &&do_form_unknown +# define JUMP_TABLE_BASE_LABEL do_form_unknown +# define REF(Name) &&do_##Name - &&JUMP_TABLE_BASE_LABEL #else # define REF(Name) &&do_##Name #endif @@ -1897,7 +1898,9 @@ do_positional: { #undef REF #ifdef SHARED -# define REF(Name) &&do2_##Name - &&do_form_unknown +# undef JUMP_TABLE_BASE_LABEL +# define JUMP_TABLE_BASE_LABEL do2_form_unknown +# define REF(Name) &&do2_##Name - &&JUMP_TABLE_BASE_LABEL #else # define REF(Name) &&do2_##Name #endif