aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-05-04 21:53:02 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-05-04 21:53:02 +0000
commitfc66a176eb0361280975ef844419c0c2d4e4d30c (patch)
tree2038f353f46faee11976a1224ab8d87f674ad916 /bfd/elflink.c
parent1bc5dc87121d332679c5663f89abc6960ab4e6a6 (diff)
downloadgdb-fc66a176eb0361280975ef844419c0c2d4e4d30c.zip
gdb-fc66a176eb0361280975ef844419c0c2d4e4d30c.tar.gz
gdb-fc66a176eb0361280975ef844419c0c2d4e4d30c.tar.bz2
2007-05-04 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (elf_link_sort_relocs): Return if both .rela.dyn and .rel.dyn aren't present.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 0e1dc6e..b58cfa6 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -7221,8 +7221,8 @@ static size_t
elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec)
{
asection *dynamic_relocs;
- asection * rela_dyn;
- asection * rel_dyn;
+ asection *rela_dyn;
+ asection *rel_dyn;
bfd_size_type count, size;
size_t i, ret, sort_elt, ext_size;
bfd_byte *sort, *s_non_relative, *p;
@@ -7361,10 +7361,12 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec)
/* Make a guess. */
use_rela = TRUE;
}
- else if (rela_dyn == NULL || rela_dyn->size == 0)
+ else if (rela_dyn != NULL && rela_dyn->size > 0)
+ use_rela = TRUE;
+ else if (rel_dyn != NULL && rel_dyn->size > 0)
use_rela = FALSE;
else
- use_rela = TRUE;
+ return 0;
if (use_rela)
{