Commit e44cba9
authored
fixes the address size computation in the llvm backend (#1330)
The `getBytesInAddress` virutal member-function for ELF files is
implemented incorrectly in LLVM,
```
template <class ELFT>
uint8_t ELFObjectFile<ELFT>::getBytesInAddress() const {
return ELFT::Is64Bits ? 8 : 4;
}
```
It is actually a static file that returns 32 for ELF32 and 64 for
ELF64, which has nothing to do with the actual bitness of the target
architecture address.
The if is using the information obtained from the target (triple) and
falls back to `getBytesInAddress` only if the target is not 16, 32, or
64 bit (the target interface is also strange as it doesn't allow any
other values).1 parent 1f632b2 commit e44cba9
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
101 | 113 | | |
102 | 114 | | |
103 | 115 | | |
| |||
106 | 118 | | |
107 | 119 | | |
108 | 120 | | |
109 | | - | |
| 121 | + | |
110 | 122 | | |
111 | 123 | | |
112 | 124 | | |
| |||
0 commit comments