From owner-freebsd-arch@FreeBSD.ORG Thu May 15 13:36:52 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC3DB183; Thu, 15 May 2014 13:36:52 +0000 (UTC) Received: from mail-oa0-x22d.google.com (mail-oa0-x22d.google.com [IPv6:2607:f8b0:4003:c02::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5294728EE; Thu, 15 May 2014 13:36:52 +0000 (UTC) Received: by mail-oa0-f45.google.com with SMTP id l6so1242572oag.4 for ; Thu, 15 May 2014 06:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=9dXpo/Gq0pksI6O0kXDlpJ7jsTBDvXKgM/j4HLh8zZ4=; b=hwnkFnDC1ifolGhTD5VYGU8Slj179x9PhqDDWatQtKjuuxl4LoAvfer3ZqirkMOSGD SObnPLICB4CQd3yF/NlmBFjiAws90spMYCguABnGTYERu2aPhpLJ+QYGYRNkj7BRM/SA Hf+FMt2CSGXu0zkzhU+M92sG0ok2OIFHAGnk+zeyuFHYlH28UQObZy0zH8Dxy47Epacy 7uk3Bb3fL+eun1gYKu9mfInV1XZtFgilSzGEHQ6a9dhhuHArcQOmFZGv0HENZtxemgPN kbHLC8jSvKsx5sRo7Y64UEKhtwDOXC7tkUfYIzz0mqz/oc5ubaaz7lwE2f/EVcq/uY4I 9m9w== MIME-Version: 1.0 X-Received: by 10.60.92.132 with SMTP id cm4mr10082336oeb.49.1400161011519; Thu, 15 May 2014 06:36:51 -0700 (PDT) Received: by 10.182.216.197 with HTTP; Thu, 15 May 2014 06:36:51 -0700 (PDT) Date: Thu, 15 May 2014 15:36:51 +0200 Message-ID: Subject: [RFC] remove dead code from link_elf.c From: Oliver Pinter To: current@freebsd.org, arch@freebsd.org Content-Type: multipart/mixed; boundary=047d7b33d3c6b8550504f9706375 Cc: gavin@freebsd.org, kib@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 13:36:52 -0000 --047d7b33d3c6b8550504f9706375 Content-Type: text/plain; charset=ISO-8859-1 Hi all! I found that the SPARSE_MAPPING used only in sys/kern/link_elf.c file, and no other place in kernel, nor in generated codes in /usr/obj/... op@pandora-d opBSD.git> git grep -i SPARSE_MAPPING sys/kern/link_elf.c:#ifdef SPARSE_MAPPING sys/kern/link_elf.c:#ifdef SPARSE_MAPPING sys/kern/link_elf.c:#ifdef SPARSE_MAPPING sys/kern/link_elf.c:#ifdef SPARSE_MAPPING sys/kern/link_elf.c:#ifdef SPARSE_MAPPING sys/kern/link_elf.c:#ifdef SPARSE_MAPPING sys/kern/link_elf.c:#ifdef SPARSE_MAPPING I proposed to remove the old/dead codes. Patch attached. Tested on amd64. --047d7b33d3c6b8550504f9706375 Content-Type: application/octet-stream; name="0001-link_elf-remove-SPARSE_MAPPING-and-related-code.patch" Content-Disposition: attachment; filename="0001-link_elf-remove-SPARSE_MAPPING-and-related-code.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 RnJvbSAwZDBjNzBmNjI5YWUwYzRhYjBjOTkwYTMzZGYzN2UxYTc2NmE4NDIwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBPbGl2ZXIgUGludGVyIDxvbGl2ZXIucG50ckBnbWFpbC5jb20+ CkRhdGU6IFRodSwgMTUgTWF5IDIwMTQgMTU6MTk6MjQgKzAyMDAKU3ViamVjdDogW1BBVENIXS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