This is an archive of the discontinued LLVM Phabricator instance.

ELF: BLOCK Keyword linker script support
AbandonedPublic

Authored by martell on Dec 23 2018, 8:48 AM.

Details

Summary

When Linking ppc64 with lld

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

/*

  • 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) {

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

martell created this revision.Dec 23 2018, 8:48 AM

I'm not sure if we should change the linker script or add BLOCK

https://github.com/ClangBuiltLinux/linux/issues/253

grimar added a subscriber: grimar.Dec 24 2018, 1:58 AM

In according to the documentation, BLOCK is a synonym for ALIGN for compatibility with the older linker scripts. Given that its name sounds meaningless/confusing,
I would prefer to see the ALIGN in the scripts. Hence I suggest not to add this to LLD but fix the script. How does it sound?

martell abandoned this revision.Jan 24 2019, 2:43 PM

Sorry for the delay.
The change from BLOCK to ALIGN is now accepted upstream.
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=a652758ac1475f69d28d11b3528c4f48
Closing this and thanks @grimar