This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] MIPS/BFD: Fix n64 GOT header size in the ELF backend
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "Maciej W. Rozycki" <macro at linux-mips dot org>
- Cc: binutils at sourceware dot org
- Date: Tue, 08 May 2012 18:45:07 +0100
- Subject: Re: [PATCH] MIPS/BFD: Fix n64 GOT header size in the ELF backend
- References: <alpine.LFD.2.00.1205071031030.3701@eddie.linux-mips.org>
"Maciej W. Rozycki" <macro@linux-mips.org> writes:
> I've noticed the MIPS backend does not set the size of the GOT header
> correctly in the ELF backend structure for the n64 ABI. This is mostly
> harmless because the MIPS backend does not use the value from the
> structure and hardcoded the header size to twice the GOT entry size.
> Furthermore the MIPS backend does not use the generic GOT creation
> function (_bfd_elf_create_got_section) so it escapes damage there too.
>
> However the size from the ELF backend structure is still used in linker
> garbage collection (bfd_elf_gc_common_finalize_got_offsets) that the MIPS
> backend does use, although GC is not on by default. Therefore I propose
> to fix it as below and make the MIPS backend use the GOT header size from
> the ELF backend structure too so that there is a central place everything
> depends on and any breakage is easily noticed.
Definitely. Less hard-coded stuff == good.
> bfd/
> * elf64-mips.c (elf_backend_got_header_size): Correct definition.
> * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Use the ELF
> backend's GOT header size instead of hardcoding it.
OK, thanks.
Richard