bfd_vma base = value, limit = value + size;
unsigned align = 0;
- if (!bounds_ok && !c64_valid_cap_range (&base, &limit, &align))
- {
- /* Just warn about this. It's not a requirement that bounds on
- objects should be precise, so there's no reason to error out on
- such an object. */
- /* xgettext:c-format */
- _bfd_error_handler
- (_("%pB: capability range for '%s' may exceed object bounds"),
- input_bfd, sym_name);
- }
-
if (perm_sec && perm_sec->flags & SEC_CODE)
{
/* Any symbol pointing into an executable section gets bounds according
data or jump to other functions. */
size = pcc_high - pcc_low;
}
+ else if (!bounds_ok && !c64_valid_cap_range (&base, &limit, &align))
+ {
+ /* Just warn about this. It's not a requirement that bounds on
+ objects should be precise, so there's no reason to error out on
+ such an object. */
+ /* xgettext:c-format */
+ _bfd_error_handler
+ (_("%pB: capability range for '%s' may exceed object bounds"),
+ input_bfd, sym_name);
+ }
if (perm_sec != NULL)
{
run_dump_test_lp64 "morello-illegal-tls-pie"
run_dump_test_lp64 "morello-illegal-tls-shared"
+run_dump_test_lp64 "morello-large-function"
+
run_dump_test "no-morello-syms-static"
run_dump_test "reloc-overflow-bad"
--- /dev/null
+# Mainly here to check that this actually links.
+# This testcase used to complain that the function capability may have
+# imprecise bounds, but since such capabilities are given PCC bounds that error
+# was invalid.
+#
+# Even though the only point is to check that the testcase links, we still
+# ensure that the dump of the .data section contains a relocation with the
+# correct permissions.
+#as: -march=morello+c64
+#ld: -pie -static
+#objdump: -DR -j .data
+
+.*: file format .*
+
+
+Disassembly of section \.data:
+
+[0-9a-f]+ <__data_start>:
+ *[0-9a-f]+: .*
+ .*: R_MORELLO_RELATIVE \*ABS\*\+.*
+ *[0-9a-f]+: .* udf #0
+ *[0-9a-f]+: .*
+ *[0-9a-f]+: 04000000 .*