[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: linux-next: Tree for March 8 (BROKEN: arch/x86/kernel/entry_32.S? Debian's binutils/as?)



On Tue, Mar 8, 2011 at 11:44 AM, Sedat Dilek <sedat.dilek@googlemail.com> wrote:
> Hi,
>
> my build of linux-next (next-20110308, the same with the one from
> yesterday) is broken.
> (I translated the German output.)
>
> [ build.log ]
>  AS      arch/x86/kernel/entry_32.o
> /home/sd/src/linux-2.6/linux-2.6.38-rc7/debian/build/source_i386_none/arch/x86/kernel/entry_32.S:
> Assembler messages:
> /home/sd/src/linux-2.6/linux-2.6.38-rc7/debian/build/source_i386_none/arch/x86/kernel/entry_32.S:1421:
> Error: .size expression does not evaluate to a constant
> make[6]: *** [arch/x86/kernel/entry_32.o] Fehler 1 (Error 1)
> make[5]: *** [arch/x86/kernel] Fehler 2 (Error 2)
> make[4]: *** [arch/x86] Fehler 2 (Error 2)
> make[4]: *** Warte auf noch nicht beendete Prozesse... (Waiting for
> unfinished jobs...)
>
> I am not sure if this is a problem of Debian's binutils snapshot from
> binutils-2_21-branch (Debian-version: 2.21.0.20110302-1) from sid/i386
> or this is only a problem for x86, but I just want to let you know.
>
> FYI: The previous binutils (2.21.0.20110216-2) works fine.
>
> I have tried with reverting the last two changes to
> arch/x86/kernel/entry_32.S in linux-next:
>
> "x86: Use {push,pop}_cfi in more places" (see [1])
> "x86, asm: Cleanup unnecssary macros in asm-offsets.c" (see [2])
>
> Reverting both or [1] or [2] breaks with Debians as (2.21.0.20110302-1).
>
> BTW, [3] has a complete GIT history for the above file.
>
> So, I am unsure from where the problem exactly aroses.
> If this a known issue (and a fix around) or rings a bell to you, let
> me and others know.
>
> Thanks in advance.
>
> Regards,
> - Sedat -
>
> [1] http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commit;h=60cf637a13932a4750da6746efd0199e8a4c341b
>
> [2] http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commit;h=7bf04be8f48ceeeffa5b5a79734d6d6e0d59e5f8
>
> [3] http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=history;f=arch/x86/kernel/entry_32.S;h=2878821cb8c1da1d7147b26271114fa9546afe03;hb=HEAD
>

Just FYI (for the "dropped" MLs while finding the "brain bug"):
Finally, with the help of x86 folks and H.J. Lu a fix for the
linux-kernel can now be found in [1].

Commits [2] and [3] from binutils master GIT helped to dig deeper into
the right places.
So I would appreciated both to be backported to binutils-2_21-branch GIT.

@Matthias:
If you like you can use the two backported patches (see file
attachments) for a next binutils upload to Debian/sid.
As usually (and you demanded once from me) I dropped any ChangeLog
entries from the code, but kept the history in the commit-text. Also,
I documented my changes.
So the patches should cleanly apply.

Thanks.

- Sedat -

[1] https://patchwork.kernel.org/patch/621001/
[2] http://sourceware.org/git/?p=binutils.git;a=commit;h=b9521fc0be7945fc842ce1197e241a023378125d
[3] http://sourceware.org/git/?p=binutils.git;a=commit;h=cbd141bb69f791de7ea1581abe7afb34f0c61288
From 3708bdd06792e812acd9da711b51482c0b4b2797 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Tue, 8 Mar 2011 14:59:35 +0100
Subject: [PATCH 1/2] Mention symbol name in non-constant .size expression.

gas/

2011-03-05  H.J. Lu  <hongjiu.lu@intel.com>

	* config/obj-elf.c (elf_frob_symbol): Mention symbol name in
	non-constant .size expression.

gas/testsuite/

2011-03-05  H.J. Lu  <hongjiu.lu@intel.com>

	* gas/elf/bad-size.err: Updated.

Conflicts:

	gas/ChangeLog
	gas/testsuite/ChangeLog
	gas/testsuite/gas/elf/bad-size.err

2011-03-08  Sedat Dilek  <sedat.dilek@gmail.com>

	* Cherry-picked from commit b9521fc0be7945fc842ce1197e241a023378125d
	* Drop changes in gas/ChangeLog and gas/testsuite/ChangeLog
---
 gas/config/obj-elf.c               |   48 ++++++++++++++++++++++++++++++++---
 gas/testsuite/gas/elf/bad-size.err |    2 +
 2 files changed, 45 insertions(+), 5 deletions(-)
 create mode 100644 gas/testsuite/gas/elf/bad-size.err

diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 969a509..d43409a 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -1879,6 +1879,7 @@ void
 elf_frob_symbol (symbolS *symp, int *puntp)
 {
   struct elf_obj_sy *sy_obj;
+  expressionS *size;
 
 #ifdef NEED_ECOFF_DEBUG
   if (ECOFF_DEBUGGING)
@@ -1887,13 +1888,50 @@ elf_frob_symbol (symbolS *symp, int *puntp)
 
   sy_obj = symbol_get_obj (symp);
 
-  if (sy_obj->size != NULL)
+  size = sy_obj->size;
+  if (size != NULL)
     {
-      if (resolve_expression (sy_obj->size)
-	  && sy_obj->size->X_op == O_constant)
-	S_SET_SIZE (symp, sy_obj->size->X_add_number);
+      if (resolve_expression (size)
+	  && size->X_op == O_constant)
+	S_SET_SIZE (symp, size->X_add_number);
       else
-	as_bad (_(".size expression does not evaluate to a constant"));
+	{
+	  const char *op_name = NULL;
+	  const char *add_name = NULL;
+
+	  if (size->X_op == O_subtract)
+	    {
+	      op_name = S_GET_NAME (size->X_op_symbol);
+	      add_name = S_GET_NAME (size->X_add_symbol);
+	      if (strcmp (op_name, FAKE_LABEL_NAME) == 0)
+		op_name = NULL;
+	      if (strcmp (add_name, FAKE_LABEL_NAME) == 0)
+		add_name = NULL;
+
+	      if (op_name && add_name)
+		as_bad (_(".size expression with symbols `%s' and `%s' "
+			  "does not evaluate to a constant"),
+			op_name, add_name);
+	      else
+		{
+		  const char *name;
+
+		  if (op_name)
+		    name = op_name;
+		  else if (add_name)
+		    name = add_name;
+		  else
+		    name = NULL;
+
+		  if (name)
+		    as_bad (_(".size expression with symbol `%s' "
+			      "does not evaluate to a constant"), name);
+		}
+	    }
+	  
+	  if (!op_name && !add_name)
+	    as_bad (_(".size expression does not evaluate to a constant"));
+	}
       free (sy_obj->size);
       sy_obj->size = NULL;
     }
diff --git a/gas/testsuite/gas/elf/bad-size.err b/gas/testsuite/gas/elf/bad-size.err
new file mode 100644
index 0000000..a5bfc31
--- /dev/null
+++ b/gas/testsuite/gas/elf/bad-size.err
@@ -0,0 +1,2 @@
+.*bad-size\.s: Assembler messages:
+.*bad-size\.s:6: Error:.*`_test_nop'.*
-- 
1.7.4.1

From eff5315213e5ad4cf255e3ec536f629a015100ee Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Tue, 8 Mar 2011 15:05:45 +0100
Subject: [PATCH 2/2] Revert the last change on gas/elf/bad-size.err.

2011-03-06  H.J. Lu  <hongjiu.lu@intel.com>

	* gas/elf/bad-size.err: Revert the last change.

Conflicts:

	gas/testsuite/ChangeLog

2011-03-08  Sedat Dilek  <sedat.dilek@gmail.com>

	* Cherry-picked from commit cbd141bb69f791de7ea1581abe7afb34f0c61288
	* Drop changes in gas/testsuite/ChangeLog
---
 gas/testsuite/gas/elf/bad-size.err |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gas/testsuite/gas/elf/bad-size.err b/gas/testsuite/gas/elf/bad-size.err
index a5bfc31..5e01ef2 100644
--- a/gas/testsuite/gas/elf/bad-size.err
+++ b/gas/testsuite/gas/elf/bad-size.err
@@ -1,2 +1,2 @@
 .*bad-size\.s: Assembler messages:
-.*bad-size\.s:6: Error:.*`_test_nop'.*
+.*bad-size\.s:6: Error: .*
-- 
1.7.4.1


Reply to: