Skip to content

ARM: AT expected, but got NOCROSSREFS #1609

@nathanchance

Description

@nathanchance

After commit b9baf5c8c5c3 ("ARM: Spectre-BHB workaround"):

$ make -skj"$(nproc)" ARCH=arm LLVM=1 mrproper defconfig all
...
ld.lld: error: ./arch/arm/kernel/vmlinux.lds:34: AT expected, but got NOCROSSREFS
>>>  __vectors_lma = .; OVERLAY 0xffff0000 : NOCROSSREFS AT(__vectors_lma) { .vectors { *(.vectors) } .vectors.bhb.loop8 { *(.vectors.bhb.loop8) } .vectors.bhb.bpiall { *(.vectors.bhb.bpiall) } } __vectors_start = LOADADDR(.vectors); __vectors_end = LOADADDR(.vectors) + SIZEOF(.vectors); __vectors_bhb_loop8_start = LOADADDR(.vectors.bhb.loop8); __vectors_bhb_loop8_end = LOADADDR(.vectors.bhb.loop8) + SIZEOF(.vectors.bhb.loop8); __vectors_bhb_bpiall_start = LOADADDR(.vectors.bhb.bpiall); __vectors_bhb_bpiall_end = LOADADDR(.vectors.bhb.bpiall) + SIZEOF(.vectors.bhb.bpiall); . = __vectors_lma + SIZEOF(.vectors) + SIZEOF(.vectors.bhb.loop8) + SIZEOF(.vectors.bhb.bpiall); __stubs_lma = .; .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_lma) { *(.stubs) } __stubs_start = LOADADDR(.stubs); __stubs_end = LOADADDR(.stubs) + SIZEOF(.stubs); . = __stubs_lma + SIZEOF(.stubs); PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors));
>>>
...

From the GNU ld documentation:

NOCROSSREFS(section section …)

This command may be used to tell ld to issue an error about any
references among certain output sections.

In certain types of programs, particularly on embedded systems when
using overlays, when one section is loaded into memory, another section
will not be. Any direct references between the two sections would be
errors. For example, it would be an error if code in one section called
a function defined in the other section.

The NOCROSSREFS command takes a list of output section names. If ld
detects any cross references between the sections, it reports an error
and returns a non-zero exit status. Note that the NOCROSSREFS command
uses output section names, not input section names.

The link succeeds with ld.bfd.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Reported upstreamThis bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list.[ARCH] arm32This bug impacts ARCH=arm[BUG] llvmA bug that should be fixed in upstream LLVM[TOOL] lldThe issue is relevant to LLD linker[WORKAROUND] AppliedThis bug has an applied workaroundfeature-requestNot a bug per-se

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions