Page MenuHomePhabricator

ELF: BLOCK Keyword linker script support
Needs ReviewPublic

Authored by martell on Sun, Dec 23, 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.Sun, Dec 23, 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.Mon, Dec 24, 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?