Page MenuHomePhabricator

ELF: BLOCK Keyword linker script support

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



When Linking ppc64 with lld

ld.lld: error: ./arch/powerpc/kernel/ 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

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

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.
Closing this and thanks @grimar