This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Relaxing a h8300 target debugging information.
- To: Paul Clarke <paulc at senet dot com dot au>
- Subject: Re: Relaxing a h8300 target debugging information.
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sun, 23 Jul 2000 16:36:26 -0600
- cc: binutils at sourceware dot cygnus dot com
- Reply-To: law at cygnus dot com
In message <3970720F.356948E0@senet.com.au>you write:
>
> When relaxing a h8300 target the code is relaxed but the debugging
> information
> is not. The following is my attempt to fix the problem BUT it does
> not
> work. Is the idea right but implemented wrong or what?
>
> bfd/reloc16.c
>
> void
> bfd_perform_slip (abfd, slip, input_section, value)
> bfd *abfd;
> unsigned int slip;
> asection *input_section;
> bfd_vma value;
> {
> asymbol **s;
>
> s = _bfd_generic_link_get_symbols (abfd);
> BFD_ASSERT (s != (asymbol **) NULL);
>
> /* Find all symbols past this point, and make them know
> what's happened. */
> while (*s)
> {
> asymbol *p = *s;
> if (p->section == input_section)
> {
> /* This was pointing into this section, so mangle it. */
> if (p->value > value)
> {
> + alent *line;
> +
> + p->value -= slip;
> + line = coff_get_lineno(abfd, p);
> + if (line) line->u.offset -= slip;
> +
Well, I havne't looked at this code in a long long time, but the first thing
that comes to mind is that you've twiddled p->value before calling
coff_get_lineno.
You want to get the line number for the original address, subtract the slip,
then scribble out the new line table. Or something like that.
Are the offsets for line numbers even set at this point in the link process?
Another approach would be to have the assembler emit relocs for the line
# table, then you can adjust the related symbols just like any other
symbol and it might 'just work'.
Though in general we've never bothered to try and make debugging work with
code that is relaxed by the linker.
jeff
jeff