Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2501154ybp; Thu, 10 Oct 2019 08:16:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzHcrqfTuESQW5KEp+/FzS7SlUaXtxP1hkSz+ErtLKA72V+/QPh/AC0w6OQNwY8QGJKsVG X-Received: by 2002:a17:906:c57:: with SMTP id t23mr8616971ejf.219.1570720613488; Thu, 10 Oct 2019 08:16:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570720613; cv=none; d=google.com; s=arc-20160816; b=G0Yf6VypguZrbV6CPzjBma7A8UCUyRi9Q4zyqbGsmrXpho8YJmL+h+EVt9PiFB+caO FbXYBPuem43GteMUoNBIsHsOL9AP4YA3R8EbKWahQs23Wmt2Aufi08fAP+VLALGzh6Zl HZuuck9jviQL8dM0fQqYf+Lk2ZPMnYE/79uox3qK7qvK2NfHNuw/cfP/iTJxthPF56JM QvY5C31ZFhdyWO+qhcpmc4K6AmemtSrVq1eWKhC31vqLNOfQou8x39DjsWEO10OW7puT FeVDYWOsNDgqwxvaJv7FFRwi1cH7Net3H2pwq6AYngQ4EUGXyb+1o1vkuUNfYX4VogAy wThw== 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=1ARHOj6w9aLyVTJEhzjEUyZm1gwUAbrQST+T57l1TKQ=; b=aTE9i17KX+jv0PO9B8/TvZcHT4zTfNXaGhdyQwZybaYJBxJNjSBtT7qri8GVM8em/o F8YHASmTPom2OEL1c5YWEBjkvw8kCVe31rrcOoT6w4hFJJ2cz4tEN2HYQUxH502TWjbu 3F2apKGfRqGuzSDVkC8PxXRT36TAiMLumTDz/t4j8eM0xH3e+mjTD675XKFYU8zkwq5E p+YPKlmXOlWwi7XsmhKawfYLi/c+yUgTwc4BqpmSTzgkMtHJkVuYYlIEnpN85b6OX+Od LTtnxL60zT7ikA0n3n7MJnpunSo0NsuWdZDipzaLOnkSVY9l0B6MQma5shQEEnr9izF9 X3MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GJzkF6Ky; 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 gh2si3327772ejb.330.2019.10.10.08.16.28; Thu, 10 Oct 2019 08:16:53 -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=GJzkF6Ky; 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 S1726554AbfJJPQJ (ORCPT + 99 others); Thu, 10 Oct 2019 11:16:09 -0400 Received: from mail-wr1-f74.google.com ([209.85.221.74]:46481 "EHLO mail-wr1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbfJJPQH (ORCPT ); Thu, 10 Oct 2019 11:16:07 -0400 Received: by mail-wr1-f74.google.com with SMTP id z17so2902154wru.13 for ; Thu, 10 Oct 2019 08:16:06 -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=1ARHOj6w9aLyVTJEhzjEUyZm1gwUAbrQST+T57l1TKQ=; b=GJzkF6KyMP2v5SqFDiGZJugryBGiWEYtoB5Op7MJqsvBGEf1CmHYnQ8lhAWb8rJ5eH U1d3KEhCjV9KKwOYgyXJQ2FjPpDgWhGPRsjzCi3CjTkjf/j+DfstrQNGUtEhO5IanBNo TN2iZtJvoFLSVDwtNDfXGsg2Sjjf8e8rdF9pQX1efteHrrB4z1Q77M9PFWlabzr0lrtv t7GYMczsCoi8TkgZrhAud5IwHrAmQbSwfT6b7CIJESHL3/S1vbL1e14GevU22E0Ls6Ha Aq6QXeBCZ+dmN+V/1MsQONiaamFlStqgk0h2VdqlLhl5jF25igC9mEzhrdhI+yPbiTXr bOXw== 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=1ARHOj6w9aLyVTJEhzjEUyZm1gwUAbrQST+T57l1TKQ=; b=Z4Iv8jDfGphaVRjR8MvExS1mY2VZ6t73XOxQqBBynVxMvwoBI7L6Vv9IGay+v8vbpC av0W8Kwxbu00zwWE2+dIBJPcM4840otYwLwMUoroc7e688XMDhsmko+D83m9yXIVMnsb yZOD5MHnvmqx6/K9QmwuN2A7GWji+e7KJ6/DluLsLAX8FHHtkpC0fHWjGgvgI6DopFch 9QiSiQbs8yNqz+V+V6+/rVn4XSQmCfYwwkfL1PJ+DOtb9zWJrQMNJJdHx72BzGo4RWdd WhWbxmEDDZW+Ev8CPwtB+t6Tb/3Lcu07EjHHhH/hFZHjOXT9e8sH/sC+9k/aXGq4GL4x 1aaw== X-Gm-Message-State: APjAAAVh67JSI1gyawdVHxCAZUquwyYOdUewjONRYldpz1j6Vg7WQ548 jyho7rBioc9LNR4fz76w2zD4y3EaR8aM+uICvr+MISQmEYgeDEouCOy8n4DnRzWn9eAmbZ5pKwk qRF6Uy6y4Zf4L1TQ9Hl2QhIIVOHeR63vRVca11lL+JChAof6hfrzQS2qvHkx9xVyMDCWLtsASkQ c= X-Received: by 2002:a05:6000:128f:: with SMTP id f15mr8853717wrx.319.1570720566104; Thu, 10 Oct 2019 08:16:06 -0700 (PDT) Date: Thu, 10 Oct 2019 16:14:41 +0100 In-Reply-To: <20191010151443.7399-1-maennich@google.com> Message-Id: <20191010151443.7399-3-maennich@google.com> Mime-Version: 1.0 References: <20191010151443.7399-1-maennich@google.com> X-Mailer: git-send-email 2.23.0.581.g78d2f28ef7-goog Subject: [PATCH 2/4] modpost: make updating the symbol namespace explict From: Matthias Maennich To: linux-kernel@vger.kernel.org Cc: kernel-team@android.com, maennich@google.com, Jessica Yu , Masahiro Yamada , Martijn Coenen , Lucas De Marchi , Shaun Ruffell , Greg Kroah-Hartman , Will Deacon , linux-kbuild@vger.kernel.org, linux-modules@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Setting the symbol namespace of a symbol within sym_add_exported feels displaced and lead to issues in the current implementation of symbol namespaces. This patch makes updating the namespace an explicit call to decouple it from adding a symbol to the export list. Signed-off-by: Matthias Maennich --- scripts/mod/modpost.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 9f5dcdff4d2f..46137b730447 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -382,8 +382,8 @@ static void sym_update_namespace(const char *symname, const char *namespace) * Add an exported symbol - it may have already been added without a * CRC, in this case just update the CRC **/ -static struct symbol *sym_add_exported(const char *name, const char *namespace, - struct module *mod, enum export export) +static struct symbol *sym_add_exported(const char *name, struct module *mod, + enum export export) { struct symbol *s = find_symbol(name); @@ -399,7 +399,6 @@ static struct symbol *sym_add_exported(const char *name, const char *namespace, s->module = mod; } } - sym_update_namespace(name, namespace); s->preloaded = 0; s->vmlinux = is_vmlinux(mod->name); s->kernel = 0; @@ -761,7 +760,8 @@ static void handle_modversions(struct module *mod, struct elf_info *info, if (strstarts(symname, "__ksymtab_")) { name = symname + strlen("__ksymtab_"); namespace = sym_extract_namespace(&name); - sym_add_exported(name, namespace, mod, export); + sym_add_exported(name, mod, export); + sym_update_namespace(name, namespace); free(namespace); } if (strcmp(symname, "init_module") == 0) @@ -2469,12 +2469,12 @@ static void read_dump(const char *fname, unsigned int kernel) mod = new_module(modname); mod->skip = 1; } - s = sym_add_exported(symname, namespace, mod, - export_no(export)); + s = sym_add_exported(symname, mod, export_no(export)); s->kernel = kernel; s->preloaded = 1; s->is_static = 0; sym_update_crc(symname, mod, crc, export_no(export)); + sym_update_namespace(symname, namespace); } release_file(file, size); return; -- 2.23.0.581.g78d2f28ef7-goog