This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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: [RFA] MIPS_TEXT symbols should be associated to .text section?


Hello Thiemo,


> Right, that appears to be some leftover of earlier code. Looks like
> elf_tdata()->elf_text_section replaced it.
> 
> Joel, can you try the appended (untested) patch and tell me if it
> works for you?

I tried your patch, but unfortunately it doesn't work :-(. The reason
is that elf_tdata (abfd)->elf_text_section is NULL. I looked at the
code, and elf-bfd.h tells me that this field is IRIX-specific. Then
searching for the places where this field is set only turns up one
location: _bfd_mips_elf_add_symbol_hook(). And according to the comment
above it, it's only used for linking...

So this leaves us with 2 options:

  1. Do a search for the .text and .data sections by name

  2. Find a place somewhere where we can set these fields before we
     need to use them. If we have a hook for instance after we've
     read the ELF header, or while iterating over the different sections
     (I don't know the code, so I'm just tossing ideas).
     
     Or another approach would be to check that field, and if null
     then do the lookup by name and store it in elf_tdata
     (abfd)->elf_text_section for all the following symbols.
     This is just an optimized variation of 1, really.

What do you think?

Thanks,
-- 
Joel


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