- asection *sec = PRIV (image_section);
- file_ptr off = PRIV (image_offset);
-
- /* Check bounds. */
- if (off > (file_ptr)sec->size
- || size > (file_ptr)sec->size
- || off + size > (file_ptr)sec->size)
- {
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
-
- memcpy (sec->contents + off, ptr, size);