[PATCH] D19190: [ELF] - Implemented PROVIDE linker script command.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 06:55:43 PDT 2016


grimar added inline comments.

================
Comment at: test/ELF/linkerscript-provide.s:49
@@ +48,3 @@
+# CHECK-NEXT:      Other: 0
+# CHECK-NEXT:      Section: Absolute
+# CHECK-NEXT:    }
----------------
rafael wrote:
> Are these symbols produced as absolute by bfd and gold?
> 
> It would be really nice if they could be produced with an output section and offset.  The advantaged is that offsets can be computed earlier. With that some day we could cleanup relocation processing further by representing relocation target as OutputSection + Offset. That way we would not need enums just to select getVA, getGotVA, getPltVA, etc.
> 
bfd and gold disagree here:


```
 PROVIDE (begin_ext = .);
 .plus : 
 {
  PROVIDE (begin_sec = .);
  *(.plus) 
  PROVIDE (end_sec = .);
 }
 PROVIDE (end_ext = .);
```
 
bfd:
```
   Symbol {
    Name: begin_ext (1)
    Value: 0x1000
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: .plus (0x1)
  }
  Symbol {
    Name: end_ext (18)
    Value: 0x1008
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: .plus (0x1)
  }
  Symbol {
    Name: end_sec (26)
    Value: 0x1008
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: .plus (0x1)
  }
  Symbol {
    Name: begin_sec (34)
    Value: 0x1000
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: .plus (0x1)
  }
```

gold:

```
    Symbol {
    Name: begin_ext (8)
    Value: 0x1000
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: Absolute (0xFFF1)
  }
  Symbol {
    Name: begin_sec (18)
    Value: 0x1000
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: .plus (0x1)
  }
  Symbol {
    Name: end_ext (28)
    Value: 0x1008
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: Absolute (0xFFF1)
  }
  Symbol {
    Name: end_sec (36)
    Value: 0x1008
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: .plus (0x1)
  }
```


http://reviews.llvm.org/D19190





More information about the llvm-commits mailing list