This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: Fwd: [PATCH, ARM]An accurate way to calculate the target arch attribute
- From: "Terry Guo" <terry dot guo at arm dot com>
- To: "'Richard Earnshaw'" <rearnsha at arm dot com>
- Cc: <binutils at sourceware dot org>
- Date: Wed, 19 Nov 2014 18:33:20 +0800
- Subject: RE: Fwd: [PATCH, ARM]An accurate way to calculate the target arch attribute
- Authentication-results: sourceware.org; auth=none
- References: <CAGbRaL6UWMfTY7kHoFM7ihvVhCdR9gjD3O2G_wFB8ZKWw3QbCA at mail dot gmail dot com> <CAGbRaL7UEBv0ZC2N1SSQjV4p8-hOwMWyhA5KnOOrHtzk3yYjEw at mail dot gmail dot com> <546C6DD3 dot 5030806 at arm dot com>
> -----Original Message-----
> From: binutils-owner@sourceware.org [mailto:binutils-
> owner@sourceware.org] On Behalf Of Richard Earnshaw
> Sent: Wednesday, November 19, 2014 6:16 PM
> To: Terry Guo; binutils@sourceware.org
> Subject: Re: Fwd: [PATCH, ARM]An accurate way to calculate the target arch
> attribute
>
> On 29/09/14 04:10, Terry Guo wrote:
> > Hi there,
> >
> > When target isn't specified from either command line or .arch/.cpu
> > directive, current gas will calculate the target arch before
> > relaxation step and assume that a possible relaxation will happen
> > anyway even this relaxation doesn't happen in late relaxation step.
> > This causes a overly assumption to target arch e.g. set target arch to
> > armv6t2 where armv4t is good enough.
> >
> > The attached patch intends to do an accurate calculation of target
> > arch by considering the target arch in relaxation step.
> >
> > Tested with Binutils regression test. Is it OK?
> >
> > BR,
> > Terry
> >
> > gas/
> > 2014-09-29 Terry Guo <terry.guo@arm.com>
> >
> > * config/tc-arm.c (md_assemble): Do not consider relaxation.
> > (md_convert_frag): Test and set target arch attribute
accordingly.
> > (aeabi_set_attribute_string): Turn it into a global function.
> > * config/tc-arm.h (md_post_relax_hook): Enable it for ARM
target.
> > (aeabi_set_public_attributes): Declare it.
> >
> > gas/testsuite/
> > 2014-09-29 Terry Guo <terry.guo@arm.com>
> >
> > * gas/arm/attr-arch-assumption.d: New file.
> > * gas/arm/attr-arch-assumption.s: Likewise.
> >
>
> These bits seem essentially OK, but ...
>
> > ld/testsuite/
> > 2014-09-29 Terry Guo <terry.guo@arm.com>
> >
> > * ld-arm/tls-longplt-lib.d: Updated.
> > * ld-arm/tls-longplt-lib.s: Likewise.
> > * ld-arm/tls-longplt.d: Likewise.
> > * ld-arm/tls-longplt.s: Likewise.
>
> Why is this needed? This code doesn't look like it needs to assume v6t2
as a
> baseline.
>
> R.
Thanks for review. Before my patch, the target arch for those .s files are
calculated in an inaccurate way, the armv6t2 is assumed here. Hence the
content of .d files are for armv6t2. Now with my patch, the arch for those
files are calculated in an accurate way, the armv4t is assumed here, so the
existing .d files can't be matched. There are two ways to avoid such
mismatch, one is to explicitly set arch to armv6t2 in .s files, then no need
to change the .d files. Another is to update the .d files without touching
the .s files. Which way is better in your opinion?
BR,
Terry