Skip to content

Commit d4b6cb2

Browse files
committed
added ldrsw fix
1 parent c6d0748 commit d4b6cb2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

util/fipstools/delocate/delocate.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,8 @@ func (d *delocation) processAarch64Instruction(statement, instruction *node32) (
640640

641641
if parts != nil {
642642
if parts.pegRule == ruleARMGOTLow12 {
643-
if instructionName != "ldr" {
644-
panic("Symbol reference outside of ldr instruction")
643+
if instructionName != "ldr" && instructionName != "ldrsw" {
644+
panic("Symbol reference outside of ldr/ldrsw instruction")
645645
}
646646

647647
if skipWS(parts.next) != nil || parts.up.next != nil {
@@ -656,8 +656,8 @@ func (d *delocation) processAarch64Instruction(statement, instruction *node32) (
656656
}
657657
return statement, nil
658658
} else if parts.pegRule == ruleLow12BitsSymbolRef {
659-
if instructionName != "ldr" {
660-
panic("Symbol reference outside of ldr instruction")
659+
if instructionName != "ldr" && instructionName != "ldrsw" {
660+
panic("Symbol reference outside of ldr/ldrsw instruction")
661661
}
662662

663663
// The check for "parts.up.next != nil" was removed because gcc/release appends an

0 commit comments

Comments
 (0)