[llvm] [llvm-objcopy] Add change-section-lma *+/-offset (PR #95431)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 14 02:39:35 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:
----------------
jh7370 wrote:
If I'm not mistaken, I think the sections are actually irrelevant to the test case and code behaviour (you can explicitly set the p_filesz of the segment in the YAML, without needing sections to drive it). If so, let's omit them.
https://github.com/llvm/llvm-project/pull/95431
More information about the llvm-commits
mailing list