scripts/gen_ldelf_hex.py: do not use f-strings
f-strings were introduced in Python 3.6 [1] and will therefore
cause an error with prior versions:
| File "scripts/gen_ldelf_hex.py", line 68
| print(f'RO load segment found after RW one(s) (m={n})')
| ^
| SyntaxError: invalid syntax
For better compatibility use .format() instead.
Link: [1] https://docs.python.org/3/whatsnew/3.6.html#pep-498-formatted-string-literals
Fixes: c706c2449b50 ("scripts/gen_ldelf_hex.py: relax rules for PT_LOAD segments")
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
diff --git a/scripts/gen_ldelf_hex.py b/scripts/gen_ldelf_hex.py
index 79f96b2..a6123b2 100755
--- a/scripts/gen_ldelf_hex.py
+++ b/scripts/gen_ldelf_hex.py
@@ -65,7 +65,7 @@
w_found = True
else:
if w_found:
- print(f'RO load segment found after RW one(s) (m={n})')
+ print('RO load segment found after RW one(s) (m={})'.format(n))
sys.exit(1)
if prev_segment:
if pad > 31:
@@ -73,8 +73,8 @@
# efficiency. 31 is an arbitrary, "sounds reasonable" value
# which might need to be adjusted -- who knows what the
# compiler/linker can do.
- print(f'Warning: suspiciously large padding ({pad}) after '
- f'load segment {n-1}, please check')
+ print('Warning: suspiciously large padding ({}) after load '
+ 'segment {}, please check'.format(pad, n-1))
pad_size.append(pad)
prev_segment = segment
n = n + 1