]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/cofflink.c
bfd: strip symbols not representable in COFF/PE symbol table
[thirdparty/binutils-gdb.git] / bfd / cofflink.c
index 4b0aab2a4ce491edab43557f7194d8ad8460322a..874354a70d00c06579072cb9dfa3e689228c9e1e 100644 (file)
@@ -2602,6 +2602,17 @@ _bfd_coff_write_global_sym (struct bfd_hash_entry *bh, void *data)
                        + h->root.u.def.section->output_offset);
        if (! obj_pe (flaginfo->output_bfd))
          isym.n_value += sec->vma;
+#ifdef BFD64
+       if (isym.n_value > (bfd_vma) 0xffffffff)
+         {
+           if (! h->root.linker_def)
+             _bfd_error_handler
+               (_("%pB: stripping non-representable symbol '%s' (value "
+                  "%" BFD_VMA_FMT "x)"),
+                output_bfd, h->root.root.string, isym.n_value);
+           return TRUE;
+         }
+#endif
       }
       break;