Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[tip:x86/urgent] x86: Fix objdump version check in arch/x86/tools/chkobjdump.awk

2 views
Skip to first unread message

tip-bot for akpm@linux-foundation.org

unread,
Dec 18, 2009, 12:00:02 AM12/18/09
to
Commit-ID: 8c63450718ea62ee3a70bffde170b4d15fc72d3c
Gitweb: http://git.kernel.org/tip/8c63450718ea62ee3a70bffde170b4d15fc72d3c
Author: ak...@linux-foundation.org <ak...@linux-foundation.org>
AuthorDate: Thu, 17 Dec 2009 15:26:36 -0800
Committer: H. Peter Anvin <h...@zytor.com>
CommitDate: Thu, 17 Dec 2009 15:34:29 -0800

x86: Fix objdump version check in arch/x86/tools/chkobjdump.awk

It says

Warning: objdump version is older than 2.19
Warning: Skipping posttest.

because it used the wrong field from `objdump -v':

akpm:/usr/src/25> /opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-objdump -v
GNU objdump 2.16.1
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.

Cc: Thomas Gleixner <tg...@linutronix.de>
Cc: Ingo Molnar <mi...@elte.hu>
Signed-off-by: Andrew Morton <ak...@linux-foundation.org>
LKML-Reference: <200912172326....@imap1.linux-foundation.org>
Signed-off-by: H. Peter Anvin <h...@zytor.com>
Cc: Masami Hiramatsu <mhir...@redhat.com>
---
arch/x86/tools/chkobjdump.awk | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/tools/chkobjdump.awk b/arch/x86/tools/chkobjdump.awk
index 0d13cd9..5bbb5a3 100644
--- a/arch/x86/tools/chkobjdump.awk
+++ b/arch/x86/tools/chkobjdump.awk
@@ -9,7 +9,7 @@ BEGIN {
}

/^GNU/ {
- split($4, ver, ".");
+ split($3, ver, ".");
if (ver[1] > od_ver ||
(ver[1] == od_ver && ver[2] >= od_sver)) {
exit 1;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Masami Hiramatsu

unread,
Dec 18, 2009, 12:10:01 AM12/18/09
to
Hi,

tip-bot for ak...@linux-foundation.org wrote:
> Commit-ID: 8c63450718ea62ee3a70bffde170b4d15fc72d3c
> Gitweb: http://git.kernel.org/tip/8c63450718ea62ee3a70bffde170b4d15fc72d3c
> Author: ak...@linux-foundation.org <ak...@linux-foundation.org>
> AuthorDate: Thu, 17 Dec 2009 15:26:36 -0800
> Committer: H. Peter Anvin <h...@zytor.com>
> CommitDate: Thu, 17 Dec 2009 15:34:29 -0800
>
> x86: Fix objdump version check in arch/x86/tools/chkobjdump.awk
>
> It says
>
> Warning: objdump version is older than 2.19
> Warning: Skipping posttest.
>
> because it used the wrong field from `objdump -v':
>
> akpm:/usr/src/25> /opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-objdump -v
> GNU objdump 2.16.1
> Copyright 2005 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License. This program has absolutely no warranty.


Oh, I didn't know that.
On my environment, objdump shows version in below format.
---
$ objdump -v
GNU objdump version 2.19.51.0.14-1.fc11 20090722
Copyright 2008 Free Software Foundation, Inc.


This program is free software; you may redistribute it under the terms of

the GNU General Public License version 3 or (at your option) any later version.


This program has absolutely no warranty.

---

Hmm, maybe, we need to check if ($3 == "version") to decide
which argument we should use.

Thank you,

--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhir...@redhat.com

H. Peter Anvin

unread,
Dec 18, 2009, 12:10:01 AM12/18/09
to
On 12/17/2009 04:04 PM, Masami Hiramatsu wrote:
>>
>> Warning: objdump version is older than 2.19
>> Warning: Skipping posttest.
>>
>> because it used the wrong field from `objdump -v':
>>
>> akpm:/usr/src/25> /opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-objdump -v
>> GNU objdump 2.16.1
>> Copyright 2005 Free Software Foundation, Inc.
>> This program is free software; you may redistribute it under the terms of
>> the GNU General Public License. This program has absolutely no warranty.
>
>
> Oh, I didn't know that.
> On my environment, objdump shows version in below format.
> ---
> $ objdump -v
> GNU objdump version 2.19.51.0.14-1.fc11 20090722
> Copyright 2008 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or (at your option) any later version.
> This program has absolutely no warranty.
> ---
>
> Hmm, maybe, we need to check if ($3 == "version") to decide
> which argument we should use.
>

How about looking for the first argument that starts with a number?

-hpa

Masami Hiramatsu

unread,
Dec 18, 2009, 12:20:02 AM12/18/09
to
H. Peter Anvin wrote:
> On 12/17/2009 04:04 PM, Masami Hiramatsu wrote:
>>>
>>> Warning: objdump version is older than 2.19
>>> Warning: Skipping posttest.
>>>
>>> because it used the wrong field from `objdump -v':
>>>
>>> akpm:/usr/src/25> /opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-objdump -v
>>> GNU objdump 2.16.1
>>> Copyright 2005 Free Software Foundation, Inc.
>>> This program is free software; you may redistribute it under the terms of
>>> the GNU General Public License. This program has absolutely no warranty.
>>
>>
>> Oh, I didn't know that.
>> On my environment, objdump shows version in below format.
>> ---
>> $ objdump -v
>> GNU objdump version 2.19.51.0.14-1.fc11 20090722
>> Copyright 2008 Free Software Foundation, Inc.
>> This program is free software; you may redistribute it under the terms of
>> the GNU General Public License version 3 or (at your option) any later version.
>> This program has absolutely no warranty.
>> ---
>>
>> Hmm, maybe, we need to check if ($3 == "version") to decide
>> which argument we should use.
>>
>
> How about looking for the first argument that starts with a number?

Sure, that's also possible. :-)

Thank you,

--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhir...@redhat.com

--

H. Peter Anvin

unread,
Dec 18, 2009, 12:30:02 AM12/18/09
to
On 12/17/2009 04:18 PM, Masami Hiramatsu wrote:
>>
>> How about looking for the first argument that starts with a number?
>
> Sure, that's also possible. :-)
>

Could you send me a patch?

-hpa

Masami Hiramatsu

unread,
Dec 18, 2009, 3:40:02 PM12/18/09
to
Different version of objdump says its version in different way;

GNU objdump 2.16.1

or

GNU objdump version 2.19.51.0.14-1.fc11 20090722

This patch uses the first argument which starts with a number
as version string.

Signed-off-by: Masami Hiramatsu <mhir...@redhat.com>
Suggested-by: H. Peter Anvin <h...@zytor.com>


Cc: Thomas Gleixner <tg...@linutronix.de>
Cc: Ingo Molnar <mi...@elte.hu>

Cc: Andrew Morton <ak...@linux-foundation.org>
---

arch/x86/tools/chkobjdump.awk | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/x86/tools/chkobjdump.awk b/arch/x86/tools/chkobjdump.awk
index 5bbb5a3..250dc79 100644
--- a/arch/x86/tools/chkobjdump.awk
+++ b/arch/x86/tools/chkobjdump.awk
@@ -8,14 +8,24 @@ BEGIN {
od_sver = 19;
}

-/^GNU/ {
- split($3, ver, ".");
+/^GNU objdump/ {
+ verstr = ""
+ for (i = 3; i <= NF; i++)
+ if (match($(i), "^[0-9]")) {
+ verstr = $(i++);
+ break;
+ }
+ if (verstr == "") {
+ printf("Warning: Failed to find objdump version number.\n");
+ exit 0;
+ }
+ split(verstr, ver, ".");


if (ver[1] > od_ver ||
(ver[1] == od_ver && ver[2] >= od_sver)) {
exit 1;

} else {
printf("Warning: objdump version %s is older than %d.%d\n",
- $4, od_ver, od_sver);
+ verstr, od_ver, od_sver);
print("Warning: Skipping posttest.");
# Logic is inverted, because we just skip test without error.
exit 0;


--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhir...@redhat.com

Masami Hiramatsu

unread,
Dec 18, 2009, 3:40:02 PM12/18/09
to
^^^^oops, it's not needed!

Masami Hiramatsu

unread,
Dec 18, 2009, 3:40:03 PM12/18/09
to
Different version of objdump says its version in different way;

GNU objdump 2.16.1

or

GNU objdump version 2.19.51.0.14-1.fc11 20090722

This patch uses the first argument which starts with a number
as version string.

Changes in v2:
- Remove unneeded increment.

Signed-off-by: Masami Hiramatsu <mhir...@redhat.com>
Suggested-by: H. Peter Anvin <h...@zytor.com>
Cc: Thomas Gleixner <tg...@linutronix.de>
Cc: Ingo Molnar <mi...@elte.hu>
Cc: Andrew Morton <ak...@linux-foundation.org>
---

arch/x86/tools/chkobjdump.awk | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/x86/tools/chkobjdump.awk b/arch/x86/tools/chkobjdump.awk
index 5bbb5a3..fd1ab80 100644


--- a/arch/x86/tools/chkobjdump.awk
+++ b/arch/x86/tools/chkobjdump.awk
@@ -8,14 +8,24 @@ BEGIN {
od_sver = 19;
}

-/^GNU/ {
- split($3, ver, ".");
+/^GNU objdump/ {
+ verstr = ""
+ for (i = 3; i <= NF; i++)
+ if (match($(i), "^[0-9]")) {

+ verstr = $(i);


+ break;
+ }
+ if (verstr == "") {
+ printf("Warning: Failed to find objdump version number.\n");
+ exit 0;
+ }
+ split(verstr, ver, ".");
if (ver[1] > od_ver ||
(ver[1] == od_ver && ver[2] >= od_sver)) {
exit 1;
} else {
printf("Warning: objdump version %s is older than %d.%d\n",
- $4, od_ver, od_sver);
+ verstr, od_ver, od_sver);
print("Warning: Skipping posttest.");
# Logic is inverted, because we just skip test without error.
exit 0;


--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhir...@redhat.com

tip-bot for Masami Hiramatsu

unread,
Dec 18, 2009, 6:10:02 PM12/18/09
to
Commit-ID: 8bee738bb1979c8bf7b42716b772522ab7d26b0c
Gitweb: http://git.kernel.org/tip/8bee738bb1979c8bf7b42716b772522ab7d26b0c
Author: Masami Hiramatsu <mhir...@redhat.com>
AuthorDate: Fri, 18 Dec 2009 10:40:13 -0500

Committer: H. Peter Anvin <h...@zytor.com>
CommitDate: Fri, 18 Dec 2009 09:26:56 -0800

x86: Fix objdump version check in chkobjdump.awk for different formats.

Different version of objdump says its version in different way;

GNU objdump 2.16.1

or

GNU objdump version 2.19.51.0.14-1.fc11 20090722

This patch uses the first argument which starts with a number
as version string.

Changes in v2:
- Remove unneeded increment.

Signed-off-by: Masami Hiramatsu <mhir...@redhat.com>
LKML-Reference: <20091218154012....@dhcp-100-2-132.bos.redhat.com>


Suggested-by: H. Peter Anvin <h...@zytor.com>
Cc: Thomas Gleixner <tg...@linutronix.de>
Cc: Ingo Molnar <mi...@elte.hu>
Cc: Andrew Morton <ak...@linux-foundation.org>

Signed-off-by: H. Peter Anvin <h...@zytor.com>

0 new messages