From patchwork Tue Sep 24 19:33:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 174297 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4571025ill; Tue, 24 Sep 2019 12:33:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzT/SaA31J9QXaFbAxwSdIKMkNQ+EgPN1/CSki0R/l+ViNP4xebi1iqg8DnH19zZh0wKtW X-Received: by 2002:a1c:4945:: with SMTP id w66mr1983977wma.40.1569353599664; Tue, 24 Sep 2019 12:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569353599; cv=none; d=google.com; s=arc-20160816; b=s6GRS738phARvHm9WRaGjLSDx1el8K1PTOfhZ4d3lQOGyErOuSh84V1V99ar35y0Yh HXd/e6X5J58tyg6DuhQIsIFpe6DOaRVMUNvXFQPM/3wPimDaInArhuwGhRLRDG3NV9RP ubksctESVZE6MRg6N7lRdM+nO/jZtFkMawZlqZCNXGLOdYDJurhuIMeBHnVV40R+esrP qWS0+EQI+GUWXswjlcXqv1Jddr1AXRffyFyvBemGxC9CoiG5Xsbh+A15H01n7h1psas6 JTNY9rxkj9lkjoJai5X6YrOkI+ZrA+FsTZoIAca0wrAfqwl7vDHsDxbieVagbydOZLYu qK0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=OrZSsFgz8YSYCzyY3m6MisHwmEHZxndakULq4rIEpuc=; b=akUH38e/vtrXfIByriL7rxNEsgoE/iJjHKJpH4UkGWcCgCsE51etLxZi7ctIkV0yCq QjRl/CsBRJnEmL9ckO9NIBGScjEXspVMhxrGZgbgBW0wxXCyLp1Q5+gyPWy8Bxv06Brk seLAvfqg0fFcp9sMDKzcdJb2pgk7wHB8wfA8iwfhm2bUw9+UEbXHq0qGsj4UjwNp7hlo hXTRmWjPrEQHUGhS53pKqDOefepONxHK302XB00cG+RUgxHyPmmWzvnnmFhtbku8XPIh t0SyMb7yTttRGNkReES6eSsoqen/1P1RoMLf9IQ2ry9JAf0s0gZ8HQ/mGZb3WhiWf7wi 0jtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JCee7g6O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11si1560490ejj.363.2019.09.24.12.33.19; Tue, 24 Sep 2019 12:33:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JCee7g6O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436597AbfIXTdP (ORCPT + 26 others); Tue, 24 Sep 2019 15:33:15 -0400 Received: from mail-pg1-f202.google.com ([209.85.215.202]:43576 "EHLO mail-pg1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbfIXTdO (ORCPT ); Tue, 24 Sep 2019 15:33:14 -0400 Received: by mail-pg1-f202.google.com with SMTP id 6so1944727pgi.10 for ; Tue, 24 Sep 2019 12:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=OrZSsFgz8YSYCzyY3m6MisHwmEHZxndakULq4rIEpuc=; b=JCee7g6OG9+4bweqR5aGATiwCA3e/cWEATDyxZar3AWX+mfuet8p4InLbwToRYS1fY D73O6sap0Cc1+YXgtQW63ytieUYaFWsd+uDb2lQZUI5OTKRk8HqTLa+J+raA5NYB4u9e 5fVPdS0GVbuykzouDvQYecqhhyj3UErHMVYoh7f8uymGRiYEq+VW2k19OXwyLU4Aqo+0 9YF3F7H8XtGQjtTyxTu+5n6Rw70qE2Lda5ib6J6Jfsi6nqV+ZjjPy8N2Zprtml9brWz5 Ihs2h8NYnZQPaCRMP6fgfhnXeNkF7Zr3zIgQXSPCs/GYvuLbTskd4+U+ryYJH5cMyikq F4fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=OrZSsFgz8YSYCzyY3m6MisHwmEHZxndakULq4rIEpuc=; b=qA9bMcRiJEkdlZ1523UaR30z3qFLKyasZA0gWG2aKvQ1GYpm4bT2ecVREq3Baz+aNi lhgiUYD4jwBzO3exoh06PNhTzc++Qi3ybvj4AB8/DoRQIX+jYgGn/9XNX5pZzO41O85g dDw8m/nl8i4sFIRjg6IzjrnBYSG5dXkAxZIMEV85TkMgFkmZwpRiJ5zMRYTx1t13cZAX 3DR2Zj83A9jaOVxcroF3XoOyIKJIzUfp0U5Mw0ugH+qWHkfudN47dV/8PAyrsZDckRQf G1ZVCmEShRX+68xCqbZQrb4XUfJGK6Y2dkI/nCVakOcXHVyT+dPzbTawN8VlkNiRNB4o U7Xg== X-Gm-Message-State: APjAAAVU0yiz28iWt5P+BlBAO9+PAWNca4oAJo+GmynCFOaz2Lj7hMYH 3B3BnENVirY0Mnso5Cfp7KRBIcZXp26fXAk1YzA= X-Received: by 2002:a63:6c81:: with SMTP id h123mr4758455pgc.132.1569353593673; Tue, 24 Sep 2019 12:33:13 -0700 (PDT) Date: Tue, 24 Sep 2019 12:33:08 -0700 In-Reply-To: Message-Id: <20190924193310.132104-1-ndesaulniers@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.23.0.351.gc4317032e6-goog Subject: [PATCH v2] x86, realmode: explicitly set entry via command line From: Nick Desaulniers To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de Cc: clang-built-linux@googlegroups.com, Nick Desaulniers , "H. Peter Anvin" , x86@kernel.org, Tri Vo , Masahiro Yamada , Rob Herring , George Rimar , linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linking with ld.lld via $ make LD=ld.lld produces the warning: ld.lld: warning: cannot find entry symbol _start; defaulting to 0x1000 Linking with ld.bfd shows the default entry is 0x1000: $ readelf -h arch/x86/realmode/rm/realmode.elf | grep Entry Entry point address: 0x1000 While ld.lld is being pedantic, just set the entry point explicitly, instead of depending on the implicit default. Link: https://github.com/ClangBuiltLinux/linux/issues/216 Signed-off-by: Nick Desaulniers --- Changes V1 -> V2: * Use command line flag, rather than linker script, as ld.bfd produces a syntax error for `ENTRY(0x1000)` but is happy with `-e 0x1000` arch/x86/realmode/rm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.23.0.351.gc4317032e6-goog Reported-by: Sedat Dilek diff --git a/arch/x86/realmode/rm/Makefile b/arch/x86/realmode/rm/Makefile index f60501a384f9..338a00c5257f 100644 --- a/arch/x86/realmode/rm/Makefile +++ b/arch/x86/realmode/rm/Makefile @@ -46,7 +46,7 @@ $(obj)/pasyms.h: $(REALMODE_OBJS) FORCE targets += realmode.lds $(obj)/realmode.lds: $(obj)/pasyms.h -LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T +LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -e 0x1000 -T CPPFLAGS_realmode.lds += -P -C -I$(objtree)/$(obj) targets += realmode.elf