This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add .set arch=FOO support to MIPS gas.


[ alex: cc'd you because IIRC you'd seen some of this... ]

At 30 Jun 2003 13:05:25 -0700, Chris G. Demetriou wrote:
> Hmm.  it looks like upon hitting <text_label>, the dissassembler
> options get changed?!
> 
> OK, this is exceeding my pre-lunch ability to deal with alien
> behaviour.  anybody have a clue what's going on here?

OK, it looks like prior to text_labe, info->symbols is NULL and so the
disassembler doesn't know how to look for the ELF header, and
therefore loses.

That's ... exceedingly lame.

Is there any reason that the section isn't checked and used to access
the BFD, instead of symbols?

e.g. the following.

The only drawback that I can see is that there's currently no
bfd_section_owner() macro, but that's easy enough to address.  8-)



chris
--

Index: opcodes/mips-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/mips-dis.c,v
retrieving revision 1.43
diff -u -p -r1.43 mips-dis.c
--- opcodes/mips-dis.c	8 Apr 2003 07:14:47 -0000	1.43
+++ opcodes/mips-dis.c	30 Jun 2003 21:12:59 -0000
@@ -495,11 +495,11 @@ set_default_mips_dis_options (info)
   mips_hwr_names = mips_hwr_names_numeric;
 
   /* If an ELF "newabi" binary, use the n32/(n)64 GPR names.  */
-  if (info->flavour == bfd_target_elf_flavour && info->symbols != NULL)
+  if (info->flavour == bfd_target_elf_flavour && info->section != NULL)
     {
       Elf_Internal_Ehdr *header;
 
-      header = elf_elfheader (bfd_asymbol_bfd (*(info->symbols)));
+      header = elf_elfheader (info->section->owner);
       if (is_newabi (header))
 	mips_gpr_names = mips_gpr_names_newabi;
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]