From: H.J. Lu Date: Fri, 4 May 2007 21:53:02 +0000 (+0000) Subject: 2007-05-04 H.J. Lu X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fc66a176eb0361280975ef844419c0c2d4e4d30c;p=binutils-gdb.git 2007-05-04 H.J. Lu * elflink.c (elf_link_sort_relocs): Return if both .rela.dyn and .rel.dyn aren't present. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f4eec5cdcbc..d136f6c35d6 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2007-05-04 H.J. Lu + + * elflink.c (elf_link_sort_relocs): Return if both .rela.dyn + and .rel.dyn aren't present. + 2007-05-04 Nick Clifton * elflink.c (elf_link_sort_relocs): If both .rela.dyn and .rel.dyn diff --git a/bfd/elflink.c b/bfd/elflink.c index 0e1dc6eab72..b58cfa6485c 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) {