diff options
author | Alan Modra <amodra@gmail.com> | 2011-04-11 04:08:13 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2011-04-11 04:08:13 +0000 |
commit | e57278ef9d811d78f6db04a11ea4810ca6ae2575 (patch) | |
tree | 5d4cef8d28e53b1531921e76c259b68618281c52 /bfd/elfxx-ia64.c | |
parent | 6edcf5b8e0d9b18f11019d87bf217924abbe3322 (diff) | |
download | gdb-e57278ef9d811d78f6db04a11ea4810ca6ae2575.zip gdb-e57278ef9d811d78f6db04a11ea4810ca6ae2575.tar.gz gdb-e57278ef9d811d78f6db04a11ea4810ca6ae2575.tar.bz2 |
* bfd-in.h (bfd_get_section_limit): Don't use rawsize with output
sections.
* libbfd.c (_bfd_generic_get_section_contents): Likewise.
(_bfd_generic_get_section_contents_in_window): Likewise.
* section.c (bfd_get_section_contents): Likewise.
* compress.c (bfd_get_full_section_contents): Likewise.
* elf32-rx.c (rx_final_link): Ignore rawsize.
* elf32-microblaze.c (microblaze_elf_relocate_section): Use correct
bfd with bfd_get_section_limit.
* elfxx-ia64.c (elfNN_ia64_choose_gp): Add "final" parameter. Use
os->size during final link. Update callers.
* bfd-in2.h: Regenerate.
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r-- | bfd/elfxx-ia64.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index bd73d28..ca0a3bc 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -1,6 +1,6 @@ /* IA-64 support for 64-bit ELF Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008, 2009, 2010 Free Software Foundation, Inc. + 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by David Mosberger-Tang <davidm@hpl.hp.com> This file is part of BFD, the Binary File Descriptor library. @@ -215,7 +215,7 @@ static bfd_boolean elfNN_ia64_dynamic_symbol_p static bfd_reloc_status_type elfNN_ia64_install_value (bfd_byte *hit_addr, bfd_vma val, unsigned int r_type); static bfd_boolean elfNN_ia64_choose_gp - (bfd *abfd, struct bfd_link_info *info); + (bfd *abfd, struct bfd_link_info *info, bfd_boolean final); static void elfNN_ia64_relax_ldxmov (bfd_byte *contents, bfd_vma off); static void elfNN_ia64_dyn_sym_traverse @@ -1221,7 +1221,7 @@ elfNN_ia64_relax_section (bfd *abfd, asection *sec, gp = _bfd_get_gp_value (obfd); if (gp == 0) { - if (!elfNN_ia64_choose_gp (obfd, link_info)) + if (!elfNN_ia64_choose_gp (obfd, link_info, FALSE)) goto error_return; gp = _bfd_get_gp_value (obfd); } @@ -4298,7 +4298,7 @@ elfNN_ia64_unwind_entry_compare (const PTR a, const PTR b) /* Make sure we've got ourselves a nice fat __gp value. */ static bfd_boolean -elfNN_ia64_choose_gp (bfd *abfd, struct bfd_link_info *info) +elfNN_ia64_choose_gp (bfd *abfd, struct bfd_link_info *info, bfd_boolean final) { bfd_vma min_vma = (bfd_vma) -1, max_vma = 0; bfd_vma min_short_vma = min_vma, max_short_vma = 0; @@ -4321,7 +4321,12 @@ elfNN_ia64_choose_gp (bfd *abfd, struct bfd_link_info *info) continue; lo = os->vma; - hi = os->vma + (os->rawsize ? os->rawsize : os->size); + /* When this function is called from elfNN_ia64_final_link + the correct value to use is os->size. When called from + elfNN_ia64_relax_section we are in the middle of section + sizing; some sections will already have os->size set, others + will have os->size zero and os->rawsize the previous size. */ + hi = os->vma + (!final && os->rawsize ? os->rawsize : os->size); if (hi < lo) hi = (bfd_vma) -1; @@ -4462,7 +4467,7 @@ elfNN_ia64_final_link (bfd *abfd, struct bfd_link_info *info) /* We assume after gp is set, section size will only decrease. We need to adjust gp for it. */ _bfd_set_gp_value (abfd, 0); - if (! elfNN_ia64_choose_gp (abfd, info)) + if (! elfNN_ia64_choose_gp (abfd, info, TRUE)) return FALSE; gp_val = _bfd_get_gp_value (abfd); |