[PATCH] D58892: [ELF] Split RW PT_LOAD on the PT_GNU_RELRO boundary

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 19:55:21 PDT 2019


MaskRay marked an inline comment as done.
MaskRay added a comment.

> Is there a test that shows that the behavior is correct if a .bss.rel.ro is large enough to require another page?

See https://reviews.llvm.org/D59404



================
Comment at: lld/trunk/test/ELF/pack-dyn-relocs-loop.s:12
 
 // This test is very sensitive to the exact section sizes and offsets,
 // so check that they don't change.
----------------
pcc wrote:
> I think you need to change the size of `x` here so that this test continues to test what it is intended to test.
I think you mean https://reviews.llvm.org/D53003

As the description says, it is very sensitive to exact sizes and offsets. Now with the layout change, I'm not sure how to reproduce the oscillation after deleting `  if (RelocData.size() < OldSize) RelocData.append(OldSize - RelocData.size(), 0);`...

I checked the following layout but it didn't fail.

```
  [ 6] .text             PROGBITS        0000000000010000 010000 000000 00  AX  0   0  4                        
  [ 7] .dynamic          DYNAMIC         0000000000010000 010000 0000b0 10  WA  4   0  8                        
  [ 8] .data             PROGBITS        0000000000020000 020000 000004 00  WA  0   0  1                        
  [ 9] x                 PROGBITS        0000000000020004 020004 00fff6 00  WA  0   0  1                        
  [10] barr              PROGBITS        000000000002fffa 02fffa 00000a 00  WA  0   0  2                        
  [11] foo               PROGBITS        0000000000030004 030004 00000c 00  WA  0   0  1   
```


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58892





More information about the llvm-commits mailing list