Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966758AbbBDQlg (ORCPT ); Wed, 4 Feb 2015 11:41:36 -0500 Received: from mail-qa0-f43.google.com ([209.85.216.43]:55336 "EHLO mail-qa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966560AbbBDQld (ORCPT ); Wed, 4 Feb 2015 11:41:33 -0500 MIME-Version: 1.0 In-Reply-To: <20150204162536.GJ8656@n2100.arm.linux.org.uk> References: <1422881149-8177-1-git-send-email-hanjun.guo@linaro.org> <2422968.Es7R0p3loO@vostro.rjw.lan> <1422984576.18187.82.camel@deneb.redhat.com> <8901765.mLfPOCUyAN@vostro.rjw.lan> <20150204104832.GF8656@n2100.arm.linux.org.uk> <20150204162536.GJ8656@n2100.arm.linux.org.uk> From: Bjorn Helgaas Date: Wed, 4 Feb 2015 10:41:11 -0600 Message-ID: Subject: Re: [PATCH v8 02/21] acpi: fix acpi_os_ioremap for arm64 To: Russell King - ARM Linux Cc: "Rafael J. Wysocki" , Mark Salter , Mark Rutland , Mark Langsdorf , linaro-acpi@lists.linaro.org, Catalin Marinas , Will Deacon , Yijing Wang , Rob Herring , Lorenzo Pieralisi , Timur Tabi , Daniel Lezcano , "linux-acpi@vger.kernel.org" , Grant Likely , Charles Garcia-Tobin , phoenix.liyi@huawei.com, Robert Richter , Jason Cooper , Arnd Bergmann , Marc Zyngier , Jon Masters , Mark Brown , linux-arm , Ashwin Chaugule , Graeme Gregory , Randy Dunlap , "linux-kernel@vger.kernel.org" , Hanjun Guo , Suravee Suthikulpanit , Sudeep Holla , Olof Johansson Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1374 Lines: 27 On Wed, Feb 4, 2015 at 10:25 AM, Russell King - ARM Linux wrote: > On Wed, Feb 04, 2015 at 09:53:28AM -0600, Bjorn Helgaas wrote: >> On Wed, Feb 4, 2015 at 4:48 AM, Russell King - ARM Linux >> wrote: >> > Moreover, __weak is positively harmful when you consider it adds bloat >> > and dead code - the overriden __weak function is left behind in the >> > resulting final image. >> >> Huh, I didn't realize that. Is that a linker bug, or is there some >> reason the weak function has to be in the final image? I tried a >> trivial test on x86 with gcc-4.8.2/ld-2.24, and I think the weak >> function text was omitted, but a string constant used only by the weak >> function was included. > ... > The reason this happens is because normally, each function text is > emitted into the .text section of the object file, one after each > other. When the image is linked, the linker copies the contents of > the complete input section to the output file, and then resolves the > symbolic information and relocations. OK, that makes sense. Thanks a lot for the detailed explanation! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/