Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ld.lld: error: ./arch/powerpc/kernel/vmlinux.lds:73: unknown section directive: 0 #253

Closed
shenki opened this Issue Oct 31, 2018 · 10 comments

Comments

Projects
None yet
6 participants
@shenki
Copy link
Member

shenki commented Oct 31, 2018

Building Linus tree with clang trunk, powernv_defconfig:

make CC=/scratch/joel/llvm-build/bin/clang-8  HOSTCC=/scratch/joel/llvm-build/bin/clang-8 LD=/scratch/joel/llvm-build/bin/ld.lld -j176
...
ld.lld -EL -m elf64lppc -Bstatic --orphan-handling=warn --build-id -o .tmp_vmlinux1 -T ./arch/powerpc/kernel/vmlinux.lds --whole-archive built-in.a --no-whole-archive --start-group lib/lib.a --end-group
ld.lld: error: ./arch/powerpc/kernel/vmlinux.lds:73: unknown section directive: 0
>>>  .text BLOCK(0) : AT(ADDR(.text) - (0xc000000000000000 -0x00000000)) {
>>>        ^
@shenki

This comment has been minimized.

Copy link
Member Author

shenki commented Oct 31, 2018

arch/powerpc/kernel/vmlinux.lds.S:

        /*
         * BLOCK(0) overrides the default output section alignment because
         * this needs to start right after .head.text in order for fixed
         * section placement to work.
         */
        .text BLOCK(0) : AT(ADDR(.text) - LOAD_OFFSET) {

@tpimh tpimh added the low priority label Oct 31, 2018

@martell

This comment has been minimized.

Copy link

martell commented Dec 23, 2018

@shenki I'm not sure if we would want to either
A. enable block support as an alias for align in lld
or
B. change the linker script to use align.

Anyway here is the lld patch.
https://reviews.llvm.org/D56060

@GeorgiiR

This comment has been minimized.

Copy link

GeorgiiR commented Dec 24, 2018

I suggested changing the script at the LLD patch page. I think BLOCK does not sound as clear as ALIGN so I would try to avoid supporting it, given the fact that documentation implicitly says its deprecated.

@shenki

This comment has been minimized.

Copy link
Member Author

shenki commented Dec 29, 2018

There is some use of the BLOCK syntax in the wild, but we probably don't have to care about supporting them.

I have written a patch that I will submit to the upstream kernel:

http://ozlabs.org/~joel/0001-powerpc-Use-ALIGN-instead-of-BLOCK.patch

@nickdesaulniers

This comment has been minimized.

Copy link
Member

nickdesaulniers commented Jan 7, 2019

@shenki LGTM, did you send that patch yet?

mpe added a commit to linuxppc/linux that referenced this issue Jan 14, 2019

powerpc: Use ALIGN instead of BLOCK
In the ld documentation under Builtin Functions:

  BLOCK(exp)

    This is a synonym for ALIGN, for compatibility with older linker scripts.

Clang's linker (lld) doesn't know about BLOCK so remove this use of it.

Link: ClangBuiltLinux#253
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
@nickdesaulniers

This comment has been minimized.

@martell

This comment has been minimized.

Copy link

martell commented Feb 6, 2019

What do we do from here?
@shenki can you get the patch backported to LTS and co?

@nathanchance

This comment has been minimized.

Copy link
Member

nathanchance commented Feb 6, 2019

It needs to be merged into mainline first before it can get backported. It is queued up for 5.1 so we'll see it merged into a few weeks.

@nathanchance

This comment has been minimized.

Copy link
Member

nathanchance commented Mar 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.