[llvm] [llvm-objcopy] Add change-section-lma *+/-offset (PR #95431)
Eleanor Bonnici via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 18 08:56:44 PDT 2024
================
@@ -0,0 +1,52 @@
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-objcopy --change-section-lma *+0x20 %t %t2
+# RUN: llvm-readelf -l %t2 | FileCheck %s --check-prefix=CHECK-PLUS
+# RUN: llvm-objcopy --change-section-lma *-0x10 %t2 %t3
+# RUN: llvm-readelf -l %t3 | FileCheck %s --check-prefix=CHECK-MINUS
+# RUN: not llvm-objcopy --change-section-lma .text3=0x5000 %t 2>&1 | FileCheck %s --check-prefix=ERR
+
+!ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+ Machine: EM_AARCH64
+Sections:
----------------
eleanor-arm wrote:
When I removed the sections the executable generated by yaml2obj was not usable by llvm-objcopy, although it looked quite similar.
` error: program header with offset 0x1000 and file size 0x2000 goes past the end of the file`
https://github.com/llvm/llvm-project/pull/95431
More information about the llvm-commits
mailing list