Issue 168720
Summary [LLD] lld does not add the entry size for the `.plt` and `.plt.sec` sections.
Labels lld
Assignees
Reporter da-viper
    ```c
// main.c
#include <stdio.h>

int main() {
    puts("hello\n");
 printf("hello\n");
    return 0;
}
``` 

lld output of the .plt section 

from `llvm-readobj --sections main`  
lld output compiled with `clang main.c -fuse-ld=lld -o main`
```sh
  Section {
    Index: 17
 Name: .plt (161)
    Type: SHT_PROGBITS (0x1)
    Flags [ (0x6)
 SHF_ALLOC (0x2)
      SHF_EXECINSTR (0x4)
    ]
    Address: 0x17E0
 Offset: 0x7E0
    Size: 64
    Link: 0
    Info: 0
    AddressAlignment: 16
    EntrySize: 0
  }
```

bfd output compiled with `clang main.c -fuse-ld=bfd -o main`

```sh
  Section {
    Index: 10
    Name: plt (104)
    Type: SHT_PROGBITS (0x1)
    Flags [ (0x6)
      SHF_ALLOC (0x2)
      SHF_EXECINSTR (0x4)
    ]
    Address: 0x1020
    Offset: 0x1020
    Size: 48
    Link: 0
    Info: 0
    AddressAlignment: 16
 EntrySize: 16
  }
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to