public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@gcc.gnu.org>
To: Julian Brown <julian@codesourcery.com>
Cc: binutils@sources.redhat.com
Subject: Re: [PATCH] Fix type and alignment of ARM/Thumb EABI mapping symbols
Date: Tue, 29 Mar 2005 16:54:00 -0000	[thread overview]
Message-ID: <1112111047.12337.7.camel@pc960.cambridge.arm.com> (raw)
In-Reply-To: <424716CD.5030909@codesourcery.com>

On Sun, 2005-03-27 at 21:25, Julian Brown wrote:
> Hi,
> 
> This patch fixes two problems: the type of mapping symbols is made 
> STT_NOTYPE (from STT_FUNC or STT_OBJECT from ARM/Thumb or data 
> respectively), and the alignment is corrected to not have the low bit 
> set for Thumb mapping symbols, in accordance with the latest version of 
> the ARM AAELF spec.
> 
> Unfortunately altering the symbol type to STT_NOTYPE for mapping symbols 
> affects the output of disassembly from objdump. $a and $t were 
> previously treated as functions. When objdump tried to find the closest 
> symbol for possibly-symbol-relative offsets previously, it found those 
> mapping symbols since compare_symbols places functions first in a sorted 
> version of the symbol table. They were then rejected by the 
> symbol_is_valid hook (arm_symbol_is_valid) from the disassemble_info 
> struct, and the section name was printed instead.
> 
> When the type of mapping symbols is changed to STT_NOTYPE, they are no 
> longer placed first in the sorted symbol list, so another symbol is used 
> instead. This causes test regressions, e.g. a symbol-offset address 
> which was previously output as:
> 
>    bl      8224 <.text-0xc>
> 
> was output instead as:
> 
>    bl      8224 <_start-0xc>
> 
> In the interest of preserving existing behaviour, I have fixed this by 
> adding a new disassemble_info hook which allows the symbol table used 
> for disassembly to have a target-specific hook for altering each symbol 
> (or remove it) in the remove_useless_symbols function. This sets the 
> BSF_FUNCTION flag for mapping symbols, which makes things behave the way 
> they used to, and possibly provides useful functionality for other 
> platforms as well.
> 
> It may be better to just change the expected test output instead. Thoughts?
> 

I think the tests should be fixed.  Other targets (those that don't have
mapping symbols) would almost certainly output _start in the example
above, so the existing behaviour should be considered undesirable at
best and probably just buggy.

That should allow you to simplify your patch so that you don't need to
touch MI parts.

R.

  parent reply	other threads:[~2005-03-29 15:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-28  8:41 Julian Brown
2005-03-28 10:17 ` Daniel Jacobowitz
2005-03-28 10:36   ` Julian Brown
2005-03-29 16:54 ` Richard Earnshaw [this message]
2005-03-29 17:25   ` Daniel Jacobowitz
2005-03-30 15:31   ` Julian Brown
2005-03-30 17:05     ` Richard Earnshaw
2005-03-30 21:08       ` Paul Brook
2005-03-30 21:11         ` Julian Brown
2005-03-31  0:27           ` Richard Earnshaw
2005-03-31  0:34             ` Julian Brown
2005-03-31  0:58               ` Richard Earnshaw
2005-03-31  2:17                 ` Julian Brown
2005-03-31 15:25                   ` Richard Earnshaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1112111047.12337.7.camel@pc960.cambridge.arm.com \
    --to=rearnsha@gcc.gnu.org \
    --cc=binutils@sources.redhat.com \
    --cc=julian@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).