From patchwork Mon Feb 18 18:41:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 1044254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-100117-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="c6gLxDrX"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 443CQw6Xyrz9s9G for ; Tue, 19 Feb 2019 05:42:32 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type; q=dns; s=default; b=a2Zm6dwF1uGvvBiy 2ZkwtffL7jpBKG0F1LIClz+QvSAWx29c5CpxpqFJbJ1zWy0bQqxqiqV5M5XPe+Ae xFSsgdUSwsIkl7i7QSJhw65ID/0gTqnSqFmLYb3Z/yky+vNbW/XRfjElTbFOeX/G IpCtnxakjsTmSApMAywpT23vdy8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type; s=default; bh=Ay+Uii7iDBLmjxti67QsJw wPf7I=; b=c6gLxDrXG2YOUHkrzZb0P6O/cPwml2Hb9mJNn1BJ+EFr51GQTTJQS7 OIx1qBJaqIfrsNbnUldwb+Z5KnSVOqYqz9kYp8vR7opCIKcuk9HcjFzvVFH1OKCp +tx2+JoRo2xaHT6O8QkDocupUEqgwJCljuT/dZ+mTEd+MI4ZtctCE= Received: (qmail 115538 invoked by alias); 18 Feb 2019 18:42:02 -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 115296 invoked by uid 89); 18 Feb 2019 18:42:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Mon, 18 Feb 2019 18:41:54 +0000 From: Joseph Myers To: CC: Subject: Fix SPARC64 handling of R_SPARC_H34 (bug 24231) Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Building glibc with -Wextra shows a -Wimplicit-fallthrough warning for SPARC64 that appears to be a real bug in glibc. The dynamic linker handling of R_SPARC_H34 falls through to that of R_SPARC_H44, which in the case of this code is nonsensical (it means the value computed for R_SPARC_H34 gets overwritten by one computed with the different logic for R_SPARC_H44). Thus, this patch adds the missing break there. Note: I do not have a testcase to demonstrate this bug. Tested with build-many-glibcs.py. 2019-02-18 Joseph Myers [BZ #24231] * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Add break after R_SPARC_H34 case. diff --git a/sysdeps/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h index 2fb207dc2d..14930890e3 100644 --- a/sysdeps/sparc/sparc64/dl-machine.h +++ b/sysdeps/sparc/sparc64/dl-machine.h @@ -573,6 +573,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, *(unsigned int *) reloc_addr = ((*(unsigned int *)reloc_addr & 0xffc00000) | ((value >> 12) & 0x3fffff)); + break; /* MEDMID code model relocs */ case R_SPARC_H44: