* Problem with objdump -x on sparc32
@ 2001-08-22 4:47 Andreas Jaeger
2001-08-22 11:47 ` H . J . Lu
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Jaeger @ 2001-08-22 4:47 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: binutils
HJ,
with binutils 2.11.90.0.27 on sparc32 I get the following running
objdump -x:
[...]
SYMBOL TABLE:
0000000000000000 l d .text 0000000000000000
0000000000000000 l d *ABS* 0000000000000000
[...]
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
00000018 R_SPARC_WDISP22 sun4c_fault
00000024 R_SPARC_WDISP22 bad_instruction
[...]
00000280 R_SPARC_32 .text+0x0001788c
00000284 R_SPARC_32 .text+0x000178b0
This means a symbol table output with 64 bit symbols but a relocation
table with 32 bits. This seems to have been caused by a recent patch
by you.
This breaks compilation of the sparc32 kernel. The btfixupprep.c
program (part of the Linux kernel in arch/sparc/boot/) expects that
both symbol table and offset have the same size. I can hack
btfixupprep.c but looking at the output I do wonder why we're not
consistent, it looks really broken now to me.
IMO we should use the same width for printing of both symbol table and
relocation records.
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Problem with objdump -x on sparc32
2001-08-22 4:47 Problem with objdump -x on sparc32 Andreas Jaeger
@ 2001-08-22 11:47 ` H . J . Lu
0 siblings, 0 replies; 2+ messages in thread
From: H . J . Lu @ 2001-08-22 11:47 UTC (permalink / raw)
To: Andreas Jaeger; +Cc: Jakub Jelinek, binutils
On Wed, Aug 22, 2001 at 01:47:14PM +0200, Andreas Jaeger wrote:
>
> HJ,
>
> with binutils 2.11.90.0.27 on sparc32 I get the following running
> objdump -x:
>
> [...]
> SYMBOL TABLE:
> 0000000000000000 l d .text 0000000000000000
> 0000000000000000 l d *ABS* 0000000000000000
> [...]
>
> RELOCATION RECORDS FOR [.text]:
> OFFSET TYPE VALUE
> 00000018 R_SPARC_WDISP22 sun4c_fault
> 00000024 R_SPARC_WDISP22 bad_instruction
> [...]
> 00000280 R_SPARC_32 .text+0x0001788c
> 00000284 R_SPARC_32 .text+0x000178b0
>
>
> This means a symbol table output with 64 bit symbols but a relocation
> table with 32 bits. This seems to have been caused by a recent patch
> by you.
Please try this patch. I will check in this patch if it fixes your
problem. But it won't be in 2.11.90.0.28. 2.11.90.0.29 should be ok.
H.J.
---
2001-08-22 H.J. Lu <hjl@gnu.org>
* syms.c (bfd_print_symbol_vandf): Add abfd to arg.
* bfd-in2.h (bfd_print_symbol_vandf): Likewise.
* aoutx.h (NAME(aout,print_symbol)): Pass abfd to
bfd_print_symbol_vandf.
* coffgen.c (coff_print_symbol): Likewise.
* elf.c (bfd_elf_print_symbol): Likewise.
* ieee.c (ieee_print_symbol): Likewise.
* nlmcode.h (nlm_print_symbol): Likewise.
* oasys.c (oasys_print_symbol): Likewise.
* pdp11.c (NAME(aout,print_symbol)): Likewise.
* som.c (som_print_symbol): Likewise.
* srec.c (srec_print_symbol): Likewise.
* tekhex.c (tekhex_print_symbol): Likewise.
* versados.c (versados_print_symbol): Likewise.
* vms.c (vms_print_symbol): Likewise.
* elf.c (_bfd_elf_print_private_bfd_data): Replace fprintf_vma
with bfd_fprintf_vma.
(bfd_elf_print_symbol): Likewise.
* syms.c (bfd_print_symbol_vandf): Likewise.
Index: aoutx.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/aoutx.h,v
retrieving revision 1.16
diff -u -p -r1.16 aoutx.h
--- aoutx.h 2001/08/17 17:56:16 1.16
+++ aoutx.h 2001/08/22 18:36:53
@@ -2590,8 +2590,8 @@ NAME(aout,get_symbol_info) (ignore_abfd,
}
void
-NAME(aout,print_symbol) (ignore_abfd, afile, symbol, how)
- bfd *ignore_abfd ATTRIBUTE_UNUSED;
+NAME(aout,print_symbol) (abfd, afile, symbol, how)
+ bfd *abfd;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -2612,7 +2612,7 @@ NAME(aout,print_symbol) (ignore_abfd, af
{
CONST char *section_name = symbol->section->name;
- bfd_print_symbol_vandf((PTR)file,symbol);
+ bfd_print_symbol_vandf (abfd, (PTR)file, symbol);
fprintf (file," %-5s %04x %02x %02x",
section_name,
Index: bfd-in2.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/bfd-in2.h,v
retrieving revision 1.76
diff -u -p -r1.76 bfd-in2.h
--- bfd-in2.h 2001/08/17 17:56:17 1.76
+++ bfd-in2.h 2001/08/22 18:36:53
@@ -2945,7 +2945,7 @@ boolean
bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count));
void
-bfd_print_symbol_vandf PARAMS ((PTR file, asymbol *symbol));
+bfd_print_symbol_vandf PARAMS ((bfd *abfd, PTR file, asymbol *symbol));
#define bfd_make_empty_symbol(abfd) \
BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
Index: coffgen.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/coffgen.c,v
retrieving revision 1.20
diff -u -p -r1.20 coffgen.c
--- coffgen.c 2001/08/17 17:56:17 1.20
+++ coffgen.c 2001/08/22 18:36:53
@@ -2151,7 +2151,7 @@ coff_print_symbol (abfd, filep, symbol,
}
else
{
- bfd_print_symbol_vandf ((PTR) file, symbol);
+ bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
fprintf (file, " %-5s %s %s %s",
symbol->section->name,
coffsymbol (symbol)->native ? "n" : "g",
Index: elf.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf.c,v
retrieving revision 1.61
diff -u -p -r1.61 elf.c
--- elf.c 2001/08/21 16:13:07 1.61
+++ elf.c 2001/08/22 18:36:54
@@ -612,16 +612,16 @@ _bfd_elf_print_private_bfd_data (abfd, f
default: sprintf (buf, "0x%lx", p->p_type); s = buf; break;
}
fprintf (f, "%8s off 0x", s);
- fprintf_vma (f, p->p_offset);
+ bfd_fprintf_vma (abfd, f, p->p_offset);
fprintf (f, " vaddr 0x");
- fprintf_vma (f, p->p_vaddr);
+ bfd_fprintf_vma (abfd, f, p->p_vaddr);
fprintf (f, " paddr 0x");
- fprintf_vma (f, p->p_paddr);
+ bfd_fprintf_vma (abfd, f, p->p_paddr);
fprintf (f, " align 2**%u\n", bfd_log2 (p->p_align));
fprintf (f, " filesz 0x");
- fprintf_vma (f, p->p_filesz);
+ bfd_fprintf_vma (abfd, f, p->p_filesz);
fprintf (f, " memsz 0x");
- fprintf_vma (f, p->p_memsz);
+ bfd_fprintf_vma (abfd, f, p->p_memsz);
fprintf (f, " flags %c%c%c",
(p->p_flags & PF_R) != 0 ? 'r' : '-',
(p->p_flags & PF_W) != 0 ? 'w' : '-',
@@ -830,7 +830,7 @@ bfd_elf_print_symbol (abfd, filep, symbo
break;
case bfd_print_symbol_more:
fprintf (file, "elf ");
- fprintf_vma (file, symbol->value);
+ bfd_fprintf_vma (abfd, file, symbol->value);
fprintf (file, " %lx", (long) symbol->flags);
break;
case bfd_print_symbol_all:
@@ -849,7 +849,7 @@ bfd_elf_print_symbol (abfd, filep, symbo
if (name == NULL)
{
name = symbol->name;
- bfd_print_symbol_vandf ((PTR) file, symbol);
+ bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
}
fprintf (file, " %s\t", section_name);
@@ -857,10 +857,10 @@ bfd_elf_print_symbol (abfd, filep, symbo
we've already printed the size; now print the alignment.
For other symbols, we have no specified alignment, and
we've printed the address; now print the size. */
- fprintf_vma (file,
- (bfd_is_com_section (symbol->section)
- ? ((elf_symbol_type *) symbol)->internal_elf_sym.st_value
- : ((elf_symbol_type *) symbol)->internal_elf_sym.st_size));
+ bfd_fprintf_vma (abfd, file,
+ (bfd_is_com_section (symbol->section)
+ ? ((elf_symbol_type *) symbol)->internal_elf_sym.st_value
+ : ((elf_symbol_type *) symbol)->internal_elf_sym.st_size));
/* If we have version information, print it. */
if (elf_tdata (abfd)->dynversym_section != 0
Index: ieee.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/ieee.c,v
retrieving revision 1.1.1.13
diff -u -p -r1.1.1.13 ieee.c
--- ieee.c 2001/08/17 16:02:47 1.1.1.13
+++ ieee.c 2001/08/22 18:36:54
@@ -1745,8 +1745,8 @@ ieee_get_symbol_info (ignore_abfd, symbo
}
static void
-ieee_print_symbol (ignore_abfd, afile, symbol, how)
- bfd *ignore_abfd ATTRIBUTE_UNUSED;
+ieee_print_symbol (abfd, afile, symbol, how)
+ bfd *abfd;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -1777,7 +1777,7 @@ ieee_print_symbol (ignore_abfd, afile, s
}
else
{
- bfd_print_symbol_vandf ((PTR) file, symbol);
+ bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
fprintf (file, " %-5s %04x %02x %s",
section_name,
Index: nlmcode.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/nlmcode.h,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 nlmcode.h
--- nlmcode.h 2001/03/09 19:16:04 1.1.1.4
+++ nlmcode.h 2001/08/22 18:36:54
@@ -981,7 +981,7 @@ nlm_get_symbol_info (ignore_abfd, symbol
void
nlm_print_symbol (abfd, afile, symbol, how)
- bfd *abfd ATTRIBUTE_UNUSED;
+ bfd *abfd;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -996,7 +996,7 @@ nlm_print_symbol (abfd, afile, symbol, h
fprintf (file, "%s", symbol->name);
break;
case bfd_print_symbol_all:
- bfd_print_symbol_vandf ((PTR) file, symbol);
+ bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
fprintf (file, " %-5s", symbol->section->name);
if (symbol->name)
fprintf (file, " %s", symbol->name);
Index: oasys.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/oasys.c,v
retrieving revision 1.1.1.6
diff -u -p -r1.1.1.6 oasys.c
--- oasys.c 2001/08/21 15:13:43 1.1.1.6
+++ oasys.c 2001/08/22 18:36:54
@@ -517,8 +517,8 @@ oasys_get_symbol_info (ignore_abfd, symb
}
static void
-oasys_print_symbol (ignore_abfd, afile, symbol, how)
- bfd *ignore_abfd ATTRIBUTE_UNUSED;
+oasys_print_symbol (abfd, afile, symbol, how)
+ bfd *abfd;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -536,7 +536,7 @@ oasys_print_symbol (ignore_abfd, afile,
CONST char *section_name = symbol->section == (asection *) NULL ?
(CONST char *) "*abs" : symbol->section->name;
- bfd_print_symbol_vandf ((PTR) file, symbol);
+ bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
fprintf (file, " %-5s %s",
section_name,
Index: pdp11.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/pdp11.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 pdp11.c
--- pdp11.c 2001/04/13 18:18:48 1.1.1.3
+++ pdp11.c 2001/08/22 18:36:54
@@ -2461,7 +2461,7 @@ NAME(aout,get_symbol_info) (abfd, symbol
/*ARGSUSED*/
void
NAME(aout,print_symbol) (abfd, afile, symbol, how)
- bfd * abfd ATTRIBUTE_UNUSED;
+ bfd * abfd;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -2483,7 +2483,7 @@ NAME(aout,print_symbol) (abfd, afile, sy
{
CONST char *section_name = symbol->section->name;
- bfd_print_symbol_vandf ((PTR)file,symbol);
+ bfd_print_symbol_vandf (abfd, (PTR)file, symbol);
fprintf (file," %-5s %04x %02x %02x",
section_name,
Index: som.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/som.c,v
retrieving revision 1.1.1.15
diff -u -p -r1.1.1.15 som.c
--- som.c 2001/05/12 07:05:36 1.1.1.15
+++ som.c 2001/08/22 18:36:55
@@ -4499,8 +4499,8 @@ som_make_empty_symbol (abfd)
/* Print symbol information. */
static void
-som_print_symbol (ignore_abfd, afile, symbol, how)
- bfd *ignore_abfd ATTRIBUTE_UNUSED;
+som_print_symbol (abfd, afile, symbol, how)
+ bfd *abfd;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -4520,7 +4520,7 @@ som_print_symbol (ignore_abfd, afile, sy
{
CONST char *section_name;
section_name = symbol->section ? symbol->section->name : "(*none*)";
- bfd_print_symbol_vandf ((PTR) file, symbol);
+ bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
fprintf (file, " %s\t%s", section_name, symbol->name);
break;
}
Index: srec.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/srec.c,v
retrieving revision 1.1.1.10
diff -u -p -r1.1.1.10 srec.c
--- srec.c 2001/05/12 07:05:37 1.1.1.10
+++ srec.c 2001/08/22 18:36:55
@@ -1217,8 +1217,8 @@ srec_get_symbol_info (ignore_abfd, symbo
}
static void
-srec_print_symbol (ignore_abfd, afile, symbol, how)
- bfd *ignore_abfd ATTRIBUTE_UNUSED;
+srec_print_symbol (abfd, afile, symbol, how)
+ bfd *abfd;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -1230,7 +1230,7 @@ srec_print_symbol (ignore_abfd, afile, s
fprintf (file, "%s", symbol->name);
break;
default:
- bfd_print_symbol_vandf ((PTR) file, symbol);
+ bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
fprintf (file, " %-5s %s",
symbol->section->name,
symbol->name);
Index: syms.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/syms.c,v
retrieving revision 1.1.1.11
diff -u -p -r1.1.1.11 syms.c
--- syms.c 2001/08/10 16:48:00 1.1.1.11
+++ syms.c 2001/08/22 18:36:55
@@ -433,14 +433,15 @@ FUNCTION
bfd_print_symbol_vandf
SYNOPSIS
- void bfd_print_symbol_vandf(PTR file, asymbol *symbol);
+ void bfd_print_symbol_vandf(bfd *abfd, PTR file, asymbol *symbol);
DESCRIPTION
Print the value and flags of the @var{symbol} supplied to the
stream @var{file}.
*/
void
-bfd_print_symbol_vandf (arg, symbol)
+bfd_print_symbol_vandf (abfd, arg, symbol)
+ bfd *abfd;
PTR arg;
asymbol *symbol;
{
@@ -448,11 +449,12 @@ bfd_print_symbol_vandf (arg, symbol)
flagword type = symbol->flags;
if (symbol->section != (asection *) NULL)
{
- fprintf_vma (file, symbol->value + symbol->section->vma);
+ bfd_fprintf_vma (abfd, file,
+ symbol->value + symbol->section->vma);
}
else
{
- fprintf_vma (file, symbol->value);
+ bfd_fprintf_vma (abfd, file, symbol->value);
}
/* This presumes that a symbol can not be both BSF_DEBUGGING and
Index: tekhex.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/tekhex.c,v
retrieving revision 1.1.1.6
diff -u -p -r1.1.1.6 tekhex.c
--- tekhex.c 2001/05/12 07:05:38 1.1.1.6
+++ tekhex.c 2001/08/22 18:36:55
@@ -957,8 +957,8 @@ tekhex_get_symbol_info (ignore_abfd, sym
}
static void
-tekhex_print_symbol (ignore_abfd, filep, symbol, how)
- bfd *ignore_abfd ATTRIBUTE_UNUSED;
+tekhex_print_symbol (abfd, filep, symbol, how)
+ bfd *abfd;
PTR filep;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -977,7 +977,7 @@ tekhex_print_symbol (ignore_abfd, filep,
{
CONST char *section_name = symbol->section->name;
- bfd_print_symbol_vandf ((PTR) file, symbol);
+ bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
fprintf (file, " %-5s %s",
section_name,
Index: versados.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/versados.c,v
retrieving revision 1.1.1.7
diff -u -p -r1.1.1.7 versados.c
--- versados.c 2001/05/12 07:05:38 1.1.1.7
+++ versados.c 2001/08/22 18:36:55
@@ -742,8 +742,8 @@ versados_get_symbol_info (ignore_abfd, s
}
void
-versados_print_symbol (ignore_abfd, afile, symbol, how)
- bfd *ignore_abfd ATTRIBUTE_UNUSED;
+versados_print_symbol (abfd, afile, symbol, how)
+ bfd *abfd;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -755,7 +755,7 @@ versados_print_symbol (ignore_abfd, afil
fprintf (file, "%s", symbol->name);
break;
default:
- bfd_print_symbol_vandf ((PTR) file, symbol);
+ bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
fprintf (file, " %-5s %s",
symbol->section->name,
symbol->name);
Index: vms.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/vms.c,v
retrieving revision 1.1.1.10
diff -u -p -r1.1.1.10 vms.c
--- vms.c 2001/05/12 07:05:39 1.1.1.10
+++ vms.c 2001/08/22 18:36:55
@@ -1170,7 +1170,7 @@ _bfd_vms_make_empty_symbol (abfd)
static void
vms_print_symbol (abfd, file, symbol, how)
- bfd *abfd ATTRIBUTE_UNUSED;
+ bfd *abfd;
PTR file;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -1190,7 +1190,7 @@ vms_print_symbol (abfd, file, symbol, ho
{
CONST char *section_name = symbol->section->name;
- bfd_print_symbol_vandf((PTR)file,symbol);
+ bfd_print_symbol_vandf (abfd, (PTR)file, symbol);
fprintf ((FILE *)file," %-8s %s", section_name, symbol->name);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-08-22 11:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-22 4:47 Problem with objdump -x on sparc32 Andreas Jaeger
2001-08-22 11:47 ` H . J . Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).