public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] patch for vmlinux.lds.S
@ 2002-01-24  2:23 Bill Nottingham
  2002-01-24  2:33 ` Keith Owens
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Bill Nottingham @ 2002-01-24  2:23 UTC (permalink / raw)
  To: linux-ia64

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]

This fixes building the kernel for me; possibly a recent binutils
thing? (Otherwise, I'm getting dangling references to the
text.exit code in .IA_64.unwind.text.exit sections.)

Bill

[-- Attachment #2: linux-ia64.patch --]
[-- Type: text/plain, Size: 249 bytes --]

--- linux/arch/ia64/vmlinux.lds.S.foo	Wed Jan 23 17:40:23 2002
+++ linux/arch/ia64/vmlinux.lds.S	Wed Jan 23 17:39:26 2002
@@ -12,6 +12,8 @@
   /DISCARD/ : {
 	*(.text.exit)
 	*(.data.exit)
+	*(*.text.exit)
+	*(*.data.exit)
 	*(.exitcall.exit)
 	}
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Linux-ia64] patch for vmlinux.lds.S
  2002-01-24  2:23 [Linux-ia64] patch for vmlinux.lds.S Bill Nottingham
@ 2002-01-24  2:33 ` Keith Owens
  2002-01-24  2:40 ` Bill Nottingham
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Keith Owens @ 2002-01-24  2:33 UTC (permalink / raw)
  To: linux-ia64

On Wed, 23 Jan 2002 21:23:32 -0500, 
Bill Nottingham <notting@redhat.com> wrote:
>This fixes building the kernel for me; possibly a recent binutils
>thing? (Otherwise, I'm getting dangling references to the
>text.exit code in .IA_64.unwind.text.exit sections.)

Which binutils?

What does "objdump -h init/main.o vmlinux" report?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Linux-ia64] patch for vmlinux.lds.S
  2002-01-24  2:23 [Linux-ia64] patch for vmlinux.lds.S Bill Nottingham
  2002-01-24  2:33 ` Keith Owens
@ 2002-01-24  2:40 ` Bill Nottingham
  2002-01-24  5:23 ` Keith Owens
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Bill Nottingham @ 2002-01-24  2:40 UTC (permalink / raw)
  To: linux-ia64

Keith Owens (kaos@ocs.com.au) said: 
> On Wed, 23 Jan 2002 21:23:32 -0500, 
> Bill Nottingham <notting@redhat.com> wrote:
> >This fixes building the kernel for me; possibly a recent binutils
> >thing? (Otherwise, I'm getting dangling references to the
> >text.exit code in .IA_64.unwind.text.exit sections.)
> 
> Which binutils?

2.11.92.0.12 + patches.

> What does "objdump -h init/main.o vmlinux" report?

init/main.o:     file format elf64-ia64-little

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         00000740  0000000000000000  0000000000000000  00000040  2**5
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .data         00000108  0000000000000000  0000000000000000  00000780  2**3
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
  2 .bss          00000000  0000000000000000  0000000000000000  00000888  2**0
                  ALLOC
  3 .rodata.str1.8 00000708  0000000000000000  0000000000000000  00000888  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .sdata        00000020  0000000000000000  0000000000000000  00000f90  2**3
                  CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA
  5 .text.init    000013c0  0000000000000000  0000000000000000  00000fc0  2**5
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  6 .IA_64.unwind_info.text.init 00000130  0000000000000000  0000000000000000  00002380  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .IA_64.unwind.text.init 000000f0  0000000000000000  0000000000000000  000024b0  2**3
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  8 .data.init    00000708  0000000000000000  0000000000000000  000025a0  2**3
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
  9 .setup.init   00000060  0000000000000000  0000000000000000  00002ca8  2**3
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
 10 .IA_64.unwind_info 00000078  0000000000000000  0000000000000000  00002d08  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 11 .IA_64.unwind 00000060  0000000000000000  0000000000000000  00002d80  2**3
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
 12 .comment      00000039  0000000000000000  0000000000000000  00002de0  2**0
                  CONTENTS, READONLY

vmlinux:     file format elf64-ia64-little

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         00411d00  e000000004400000  0000000004400000  00010000  2**15
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .text.lock    00003480  e000000004811d00  0000000004811d00  00421d00  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 __ex_table    00001d98  e000000004815180  0000000004815180  00425180  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 __ksymtab     00005070  e000000004816f18  0000000004816f18  00426f18  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .IA_64.unwind_info 00023c18  e00000000481bf88  000000000481bf88  0042bf88  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .IA_64.unwind 0001b9f0  e00000000483fba0  000000000483fba0  0044fba0  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .rodata       000311f5  e00000000485b590  000000000485b590  0046b590  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .kstrtab      0000a5a0  e00000000488c788  000000000488c788  0049c788  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .opd          000097c0  e000000004896d30  0000000004896d30  004a6d30  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .text.init    00029ce0  e0000000048a4000  00000000048a4000  004b4000  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 10 .data.init    000307c8  e0000000048cdce0  00000000048cdce0  004ddce0  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 11 .setup.init   00000270  e0000000048fe4b0  00000000048fe4b0  0050e4b0  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 12 .initcall.init 00000150  e0000000048fe720  00000000048fe720  0050e720  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 13 init_task     00008000  e000000004900000  0000000004900000  00510000  2**4
                  CONTENTS, ALLOC, LOAD, DATA
 14 .data.cacheline_aligned 00032dc0  e000000004908000  0000000004908000  00518000  2**6
                  CONTENTS, ALLOC, LOAD, DATA
 15 .data         000dd3b8  e00000000493adc0  000000000493adc0  0054adc0  2**6
                  CONTENTS, ALLOC, LOAD, DATA
 16 .got          0000d1c8  e000000004a18178  0000000004a18178  00628178  2**3
                  CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA
 17 .sdata        00000b44  e000000004a25340  0000000004a25340  00635340  2**3
                  CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA
 18 .sbss         00000748  e000000004a25e88  0000000004a25e88  00635e88  2**3
                  ALLOC, SMALL_DATA
 19 .bss          0006df30  e000000004a265d0  0000000004a25e88  00635e88  2**4
                  ALLOC

Bill


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Linux-ia64] patch for vmlinux.lds.S
  2002-01-24  2:23 [Linux-ia64] patch for vmlinux.lds.S Bill Nottingham
  2002-01-24  2:33 ` Keith Owens
  2002-01-24  2:40 ` Bill Nottingham
@ 2002-01-24  5:23 ` Keith Owens
  2002-01-24  5:31 ` Keith Owens
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Keith Owens @ 2002-01-24  5:23 UTC (permalink / raw)
  To: linux-ia64

On Wed, 23 Jan 2002 21:40:09 -0500, 
Bill Nottingham <notting@redhat.com> wrote:
>Keith Owens (kaos@ocs.com.au) said: 
>> On Wed, 23 Jan 2002 21:23:32 -0500, 
>> Bill Nottingham <notting@redhat.com> wrote:
>> >This fixes building the kernel for me; possibly a recent binutils
>> >thing? (Otherwise, I'm getting dangling references to the
>> >text.exit code in .IA_64.unwind.text.exit sections.)
>> 
>> Which binutils?
>
>2.11.92.0.12 + patches.
>
>> What does "objdump -h init/main.o vmlinux" report?
>  6 .IA_64.unwind_info.text.init 00000130  0000000000000000  0000000000000000  00002380  2**3
>                  CONTENTS, ALLOC, LOAD, READONLY, DATA
>  7 .IA_64.unwind.text.init 000000f0  0000000000000000  0000000000000000  000024b0  2**3
>                  CONTENTS, ALLOC, LOAD, RELOC, DATA
> 10 .IA_64.unwind_info 00000078  0000000000000000  0000000000000000  00002d08  2**3
>                  CONTENTS, ALLOC, LOAD, READONLY, DATA
> 11 .IA_64.unwind 00000060  0000000000000000  0000000000000000  00002d80  2**3
>vmlinux:     file format elf64-ia64-little
>  4 .IA_64.unwind_info 00023c18  e00000000481bf88  000000000481bf88  0042bf88  2**3
>                  CONTENTS, ALLOC, LOAD, READONLY, DATA
>  5 .IA_64.unwind 0001b9f0  e00000000483fba0  000000000483fba0  0044fba0  2**3

Your patch looks OK, I just want to confirm that the binutils change to
generate multiple unwind sections has not broken the requirement that
unwind entries appear in ascending order.  Run this Perl script against
your vmlinux, it should say 0 out of order entries detected.

#!/usr/bin/perl -w
# Verify that ia64 unwind data is valid.
# Needs readelf command from recent binutils.

use strict;
use integer;
die($0 . " takes exactly one argument, the vmlinux to be explored\n") if($#ARGV);

my ($data, $section, $start, $size);
my @f;

open(VMLINUX, $ARGV[0]) || die("cannot open $ARGV[0] for reading");

$data = `readelf -S $ARGV[0] | fgrep -A 1 ' .IA_64.unwind '`;
chomp($data);
$data =~ s/\n/ /m;
die("$0 could not find .IA_64.unwind section in $ARGV[0]\n") if($data eq "");
print("Unwind section ", $data, "\n");
$data =~ s/[][]//g;
(@f) = split(' ', $data);
$section = $f[0];
$start = hex($f[4]);
$size = hex($f[5]);

sysseek(VMLINUX, $start, 0) || die "cannot seek to offset $start in $ARGV[0]";
sysread(VMLINUX, $data, $size) || die "cannot read $size bytes from offset $start in $ARGV[0]";
close(VMLINUX);

my @unwind;
my @previous = (0, 0, 0, 0, 0, 0);
my $i;
my $error = 0;

for ($i = 0; $i < $size; $i += 24) {
	# unpack Q is optional, don't rely on it
	@unwind = unpack("LLLLLL", substr($data, $i, 24));
	if ($unwind[0] < $previous[0] ||
	    $unwind[0] = $previous[0] && $unwind[1] < $previous[1]) {
		printf("Out of order\n");
		printf("start 0x%08x%08x end 0x%08x%08x info 0x%08x%08x\n",
			$previous[1], $previous[0], $previous[3], $previous[2], $previous[5], $previous[4]);
		printf("      0x%08x%08x     0x%08x%08x      0x%08x%08x\n",
			$unwind[1], $unwind[0], $unwind[3], $unwind[2], $unwind[5], $unwind[4]);
		++$error;
	}
	@previous = @unwind;
}

printf("%d out of order entries detected\n", $error);
exit($error);



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Linux-ia64] patch for vmlinux.lds.S
  2002-01-24  2:23 [Linux-ia64] patch for vmlinux.lds.S Bill Nottingham
                   ` (2 preceding siblings ...)
  2002-01-24  5:23 ` Keith Owens
@ 2002-01-24  5:31 ` Keith Owens
  2002-01-24  5:41 ` Bill Nottingham
  2002-01-25  6:38 ` David Mosberger
  5 siblings, 0 replies; 7+ messages in thread
From: Keith Owens @ 2002-01-24  5:31 UTC (permalink / raw)
  To: linux-ia64

Oops, wrong version of the script in previous mail.

On Wed, 23 Jan 2002 21:40:09 -0500, 
Bill Nottingham <notting@redhat.com> wrote:
>Keith Owens (kaos@ocs.com.au) said: 
>> On Wed, 23 Jan 2002 21:23:32 -0500, 
>> Bill Nottingham <notting@redhat.com> wrote:
>> >This fixes building the kernel for me; possibly a recent binutils
>> >thing? (Otherwise, I'm getting dangling references to the
>> >text.exit code in .IA_64.unwind.text.exit sections.)
>> 
>> Which binutils?
>
>2.11.92.0.12 + patches.
>
>> What does "objdump -h init/main.o vmlinux" report?
>  6 .IA_64.unwind_info.text.init 00000130  0000000000000000  0000000000000000  00002380  2**3
>                  CONTENTS, ALLOC, LOAD, READONLY, DATA
>  7 .IA_64.unwind.text.init 000000f0  0000000000000000  0000000000000000  000024b0  2**3
>                  CONTENTS, ALLOC, LOAD, RELOC, DATA
> 10 .IA_64.unwind_info 00000078  0000000000000000  0000000000000000  00002d08  2**3
>                  CONTENTS, ALLOC, LOAD, READONLY, DATA
> 11 .IA_64.unwind 00000060  0000000000000000  0000000000000000  00002d80  2**3
>vmlinux:     file format elf64-ia64-little
>  4 .IA_64.unwind_info 00023c18  e00000000481bf88  000000000481bf88  0042bf88  2**3
>                  CONTENTS, ALLOC, LOAD, READONLY, DATA
>  5 .IA_64.unwind 0001b9f0  e00000000483fba0  000000000483fba0  0044fba0  2**3

Your patch looks OK, I just want to confirm that the binutils change to
generate multiple unwind sections has not broken the requirement that
unwind entries appear in ascending order.  Run this Perl script against
your vmlinux, it should say 0 out of order entries detected.

#!/usr/bin/perl -w
# Verify that ia64 unwind data is valid.
# Needs readelf command from recent binutils.

use strict;
use integer;
die($0 . " takes exactly one argument, the vmlinux to be explored\n") if($#ARGV);

my ($data, $start, $size);
my @f;

open(VMLINUX, $ARGV[0]) || die("cannot open $ARGV[0] for reading");

$data = `readelf -S $ARGV[0] | fgrep -A 1 ' .IA_64.unwind '`;
chomp($data);
$data =~ s/\n/ /m;
die("$0 could not find .IA_64.unwind section in $ARGV[0]\n") if($data eq "");
print("Unwind section ", $data, "\n");
$data =~ s/[][]//g;
(@f) = split(' ', $data);
$start = hex($f[4]);
$size = hex($f[5]);

sysseek(VMLINUX, $start, 0) || die "cannot seek to offset $start in $ARGV[0]";
sysread(VMLINUX, $data, $size) || die "cannot read $size bytes from offset $start in $ARGV[0]";
close(VMLINUX);

my @unwind;
my @previous = (0, 0, 0, 0, 0, 0);
my $i;
my $error = 0;

for ($i = 0; $i < $size; $i += 24) {
	# unpack Q is optional, don't rely on it
	@unwind = unpack("LLLLLL", substr($data, $i, 24));
	if ($unwind[1] < $previous[1] ||
	    $unwind[1] = $previous[1] && $unwind[0] < $previous[0]) {
		printf("Out of order\n");
		printf("start 0x%08x%08x end 0x%08x%08x info 0x%08x%08x\n",
			$previous[1], $previous[0], $previous[3], $previous[2], $previous[5], $previous[4]);
		printf("      0x%08x%08x     0x%08x%08x      0x%08x%08x\n",
			$unwind[1], $unwind[0], $unwind[3], $unwind[2], $unwind[5], $unwind[4]);
		++$error;
	}
	@previous = @unwind;
}

printf("%d out of order entries detected\n", $error);
exit($error);



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Linux-ia64] patch for vmlinux.lds.S
  2002-01-24  2:23 [Linux-ia64] patch for vmlinux.lds.S Bill Nottingham
                   ` (3 preceding siblings ...)
  2002-01-24  5:31 ` Keith Owens
@ 2002-01-24  5:41 ` Bill Nottingham
  2002-01-25  6:38 ` David Mosberger
  5 siblings, 0 replies; 7+ messages in thread
From: Bill Nottingham @ 2002-01-24  5:41 UTC (permalink / raw)
  To: linux-ia64

Keith Owens (kaos@ocs.com.au) said: 
> Oops, wrong version of the script in previous mail.

It appears to be OK:
Unwind section   [ 6] .IA_64.unwind     IA_64_UNWIND     e00000000483fba0  0044fba0        000000000001b9f0  0000000000000000  AL       1     1     8
0 out of order entries detected

Bill


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Linux-ia64] patch for vmlinux.lds.S
  2002-01-24  2:23 [Linux-ia64] patch for vmlinux.lds.S Bill Nottingham
                   ` (4 preceding siblings ...)
  2002-01-24  5:41 ` Bill Nottingham
@ 2002-01-25  6:38 ` David Mosberger
  5 siblings, 0 replies; 7+ messages in thread
From: David Mosberger @ 2002-01-25  6:38 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Wed, 23 Jan 2002 21:23:32 -0500, Bill Nottingham <notting@redhat.com> said:

  Bill> This fixes building the kernel for me; possibly a recent
  Bill> binutils thing? (Otherwise, I'm getting dangling references to
  Bill> the text.exit code in .IA_64.unwind.text.exit sections.)

Yes, I added a similar fix.  It will be in the next patch (hopefully
next week, but with LinuxWorld happening, it may end up being the week
after).

	--david


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-01-25  6:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-24  2:23 [Linux-ia64] patch for vmlinux.lds.S Bill Nottingham
2002-01-24  2:33 ` Keith Owens
2002-01-24  2:40 ` Bill Nottingham
2002-01-24  5:23 ` Keith Owens
2002-01-24  5:31 ` Keith Owens
2002-01-24  5:41 ` Bill Nottingham
2002-01-25  6:38 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox