[PATCH] D72968: [lld][ELF] Don't apply --fix-cortex-a53-843419 to relocatable links.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 12:09:12 PST 2020


peter.smith accepted this revision.
peter.smith added a comment.
This revision is now accepted and ready to land.

Reading the BFD source it looks like stubs (which is what errata patches like this are generated) are not added for relocatable links, I couldn't find any ld tests for them and an empirical test with:

          .section .text, "ax", %progbits
          .balign 4096
          .globl t3_ff8_ldr
          .type t3_ff8_ldr, %function
          .space 4096 - 8
  t3_ff8_ldr:
          adrp x0, dat1
          ldr x1, [x1, #0]
          ldr x0, [x0, :lo12:dat1]
          ret
  
          .data
  dat1:   .quad 1

ld.bfd will patch with a normal link and -fix-cortex-a53-843419 but will not when I add the -r.

It would be possible to make a pessimistic fix that would work during ld -r, essentially assume the worst for anything you didn't know and overalign the section to ensure the resulting alignment. However I don't think it would be practically useful due to the amount of disruption.

This same argument applies to the fix-cortex-a8 option, but that can be done in a separate patch; my fault so I'll hopefully get the time to do this tomorrow and if not, then this week.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72968/new/

https://reviews.llvm.org/D72968





More information about the llvm-commits mailing list