Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Dec 2019 10:13:38 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD ports <freebsd-ports@freebsd.org>
Subject:   devel/binutils@powerpc64 ( powerpc64-unknown-freebsd13.0-ld ) unbounded loop in bfd/elf64-ppc.c : the source code and values
Message-ID:  <89FF670E-3C97-44F6-9B16-FE1B68B304E9@yahoo.com>
References:  <89FF670E-3C97-44F6-9B16-FE1B68B304E9.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I ran into the following ubounded loop
(via the continue) in bfd/elf64-ppc.c
while trying to do a
devel/freebsd-gcc9@powerpc64 based
buildworld buildkernel :

            /* Read the relocations.  */
            relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL,
                                                  info->keep_memory);
            if (relstart == NULL)
              return FALSE;

            relend = relstart + sec->reloc_count;
            for (rel = relstart; rel < relend; )
              {
                enum elf_ppc64_reloc_type r_type;
                unsigned long r_symndx;
                asection *sym_sec;
                struct elf_link_hash_entry *h;
                Elf_Internal_Sym *sym;
                unsigned char *tls_maskp;

                r_type = ELF64_R_TYPE (rel->r_info);
                if (r_type != R_PPC64_PLTCALL
                    && r_type != R_PPC64_PLTCALL_NOTOC)
                  continue;

Nothing is done before the continue to make rel
progress towards relend (or relend towards
relstart). It just repeats the same activity
over and over on the same rel value.

This was in:

devel/binutils/work-powerpc64/binutils-2.33.1/bfd/elf64-ppc.c

The 1st line quoted above was line 7455 according to vi.

Ref reference, both of the stuck links (clang.full and
lld.full) have:

(gdb) print r_type
$1 = R_PPC64_REL16_HA
(gdb) print/x *rel
$3 = {r_offset = 0x2, r_info = 0x18000000fc, r_addend = 0x2}


===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?89FF670E-3C97-44F6-9B16-FE1B68B304E9>