Line
Link Here
|
0 |
-- systemd-stable-255.4.old/tools/elf2efi.py 2024-02-27 17:26:04.000000000 -0000 |
0 |
++ systemd-stable-255.4/tools/elf2efi.py 2024-04-01 11:30:04.080806734 -0000 |
Lines 26-31
Link Here
|
26 |
import io |
26 |
import io |
27 |
import os |
27 |
import os |
28 |
import pathlib |
28 |
import pathlib |
|
|
29 |
import sys |
29 |
import time |
30 |
import time |
30 |
import typing |
31 |
import typing |
31 |
from ctypes import ( |
32 |
from ctypes import ( |
Lines 212-217
Link Here
|
212 |
".eh_frame", |
213 |
".eh_frame", |
213 |
".eh_frame_hdr", |
214 |
".eh_frame_hdr", |
214 |
".ARM.exidx", |
215 |
".ARM.exidx", |
|
|
216 |
".relro_padding", |
215 |
] |
217 |
] |
216 |
|
218 |
|
217 |
IGNORE_SECTION_TYPES = [ |
219 |
IGNORE_SECTION_TYPES = [ |
Lines 270-279
Link Here
|
270 |
elf_s["sh_flags"] & SH_FLAGS.SHF_ALLOC == 0 |
272 |
elf_s["sh_flags"] & SH_FLAGS.SHF_ALLOC == 0 |
271 |
or elf_s["sh_type"] in IGNORE_SECTION_TYPES |
273 |
or elf_s["sh_type"] in IGNORE_SECTION_TYPES |
272 |
or elf_s.name in IGNORE_SECTIONS |
274 |
or elf_s.name in IGNORE_SECTIONS |
|
|
275 |
or elf_s["sh_size"] == 0 |
273 |
): |
276 |
): |
274 |
continue |
277 |
continue |
275 |
if elf_s["sh_type"] not in ["SHT_PROGBITS", "SHT_NOBITS"]: |
278 |
if elf_s["sh_type"] not in ["SHT_PROGBITS", "SHT_NOBITS"]: |
276 |
raise RuntimeError(f"Unknown section {elf_s.name}.") |
279 |
raise RuntimeError(f"Unknown section {elf_s.name}.") |
|
|
280 |
if elf_s.name == '.got': |
281 |
# FIXME: figure out why those sections are inserted |
282 |
print("WARNING: Non-empty .got section", file=sys.stderr) |
277 |
|
283 |
|
278 |
if elf_s["sh_flags"] & SH_FLAGS.SHF_EXECINSTR: |
284 |
if elf_s["sh_flags"] & SH_FLAGS.SHF_EXECINSTR: |
279 |
rwx = PE_CHARACTERISTICS_RX |
285 |
rwx = PE_CHARACTERISTICS_RX |