This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: The elflink.c changes of today cause severe cris-elf ld regressions
On Fri, May 04, 2007 at 10:18:19AM -0700, H. J. Lu wrote:
> On Fri, May 04, 2007 at 05:38:32PM +0200, Hans-Peter Nilsson wrote:
> > With nothing but the elflink.c changes different from the time
> > the tests ran successfully, my autotester now sees:
> >
> > Running /h/hp/binutils/cvs_latest/src/ld/testsuite/ld-cris/cris.exp ...
> > FAIL: ld-cris/libdso-1
> > FAIL: ld-cris/libdso-10
> > FAIL: ld-cris/libdso-11
> > FAIL: ld-cris/libdso-14
> > FAIL: ld-cris/libdso-3
> > FAIL: ld-cris/libdso-4
> > FAIL: ld-cris/expdyn1
> > FAIL: ld-cris/expdyn2
> > FAIL: ld-cris/expdyn3
> > FAIL: ld-cris/expdyn4
> > FAIL: ld-cris/expdyn5
> > FAIL: ld-cris/expdyn6
> > FAIL: ld-cris/expdyn7
> > FAIL: ld-cris/gotplt1
> > FAIL: ld-cris/undef1
> > FAIL: ld-cris/weakref1
> > FAIL: ld-cris/weakref2
> >
> > Where the ld.log says like:
> > Running /h/hp/binutils/cvs_latest/src/ld/testsuite/ld-cris/cris.exp ...
> > /n/asic_slask/hp/autobinutest/ld/../gas/as-new --pic --no-underscore --em=criself -o tmpdir/dump0.o /h/hp/binutils/cvs_latest/src/ld/testsuite/ld-cris/dso-1.s
> > ./ld-new -L/h/hp/binutils/cvs_latest/src/ld/testsuite/ld-cris --shared -m crislinux -o tmpdir/dump tmpdir/dump0.o
> > failed with: <child killed: segmentation violation>, expected: <>
> >
>
> It also breaks Linux/x86-64 in the similar fashion. I will revert it
> if it isn't fixed within 12 hours.
>
>
I am checking this one in.
H.J.
----
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.
--- bfd/elflink.c.bad 2007-05-04 14:36:38.000000000 -0700
+++ bfd/elflink.c 2007-05-04 14:47:42.000000000 -0700
@@ -7278,8 +7278,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;
@@ -7418,10 +7418,12 @@ elf_link_sort_relocs (bfd *abfd, struct
/* 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)
{