This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] gold: Fix _GLOBAL_OFFSET_TABLE_ value for large GOTs
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Stephen Crane <sjc at immunant dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 10 May 2018 00:20:29 -0700
- Subject: Re: [PATCH] gold: Fix _GLOBAL_OFFSET_TABLE_ value for large GOTs
- References: <CAB7K5r4psCAC3ioYtgDWUcFD5aOVe7DjyFDm4hYVjF3Gi=7z7A@mail.gmail.com> <CAB7K5r5FOfFrWZwg7pqDJ1zYs0QXR7d9dcFoy=mBSZ2FYgUK1A@mail.gmail.com> <CAB7K5r5TW6G9p87FCBtEuJYfS6kjx0oqDk2FpgM+MmZ5ctOhyg@mail.gmail.com>
I've committed the patch on your behalf. Thanks!
-cary
On Tue, May 8, 2018 at 12:00 PM, Stephen Crane <sjc@immunant.com> wrote:
> Ping. This seems to be a pretty simple copy+paste error that we should get
> fixed.
>
> On Wed, Apr 11, 2018 at 1:05 PM Stephen Crane <sjc@immunant.com> wrote:
>
> > Apologies, gold/Changelog should actually be:
>
> > * aarch64.cc (Target_aarch64::do_finalize_sections): Use size of
> > .got section for the _GLOBAL_OFFSET_TABLE_ symbol computation.
>
>
> > - Stephen
>
> > On Wed, Apr 11, 2018 at 1:02 PM, Stephen Crane <sjc@immunant.com> wrote:
> > > If this looks ok, could someone with commit access commit this for me?
> Thanks.
> > >
> > >
> > > [GOLD] Fix _GLOBAL_OFFSET_TABLE_ value for large GOTs
> > >
> > > Gold resolves GOT-relative relocs relative to the GOT base +
> > > 0x8000 when the GOT
> > > is larger than 0x8000. However, previously the
> > > _GLOBAL_OFFSET_TABLE_ symbol was
> > > set to GOT base + 0x8000 when the .got.plt was larger than 0x8000.
> > > This patch
> > > makes both checks use the size of the .got section so that they
> > > agree when to
> > > add 0x8000.
> > >
> > >
> > > * aarch64.cc (do_finalize_sections): Use size of .got section for
> > > the _GLOBAL_OFFSET_TABLE_ symbol computation.
> > >
> > >
> > > diff --git a/gold/aarch64.cc b/gold/aarch64.cc
> > > index 8de9a26765..67f210876d 100644
> > > --- a/gold/aarch64.cc
> > > +++ b/gold/aarch64.cc
> > > @@ -6965,11 +6965,11 @@ Target_aarch64<size,
> big_endian>::do_finalize_sections(
> > > }
> > >
> > > // Set the size of the _GLOBAL_OFFSET_TABLE_ symbol to the size of
> > > - // the .got.plt section.
> > > + // the .got section.
> > > Symbol* sym = this->global_offset_table_;
> > > if (sym != NULL)
> > > {
> > > - uint64_t data_size = this->got_plt_->current_data_size();
> > > + uint64_t data_size = this->got_->current_data_size();
> > > symtab->get_sized_symbol<size>(sym)->set_symsize(data_size);
> > >
> > > // If the .got section is more than 0x8000 bytes, we add
>