[PATCH] D49557: [ELF] Fix handling of FDE negative relative PC addr

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 20 01:05:03 PDT 2018


grimar added a comment.

Nice catch! Few comments/suggestions are below.



================
Comment at: test/ELF/eh-frame-negative-relative-pcaddr.s:1
+# REQUIRES: x86
+
----------------
Should this test case be in a `linkerscript` sub-folder? Since it relies on LS.


================
Comment at: test/ELF/eh-frame-negative-relative-pcaddr.s:4
+# Tests that FDE pc negative relative addressing does not trigger overflow error.
+# This situation can arise when .eh_frame is placed after .text.
+
----------------
Maybe it worth to check the `.eh_frame_hdr` section content like eh-frame-value-format8.s/eh-frame-value-format7.s
tests do? To demonstrate that we encoded the address correctly and were able to build a valid `eh_frame_hdr` entry.


================
Comment at: test/ELF/eh-frame-negative-relative-pcaddr.s:10
+# RUN:   .eh_frame : { *(.eh_frame) } \
+# RUN: }" > %t.script
+# RUN: ld.lld --eh-frame-hdr --script %t.script %t.o -o /dev/null
----------------
I think this can be a single line:

`SECTIONS { .text : { *(.text) } .eh_frame : { *(.eh_frame) } }`


https://reviews.llvm.org/D49557





More information about the llvm-commits mailing list