* hpux-core.c (hpux_core_core_file_p): Use offsetof macro in calls to
[deliverable/binutils-gdb.git] / bfd / hpux-core.c
index 347de2170f38aa8dd9b48cb8fb618113f5dde538..e19dcf5e3cecc535ac0e306181314c6d46fb335b 100644 (file)
@@ -244,10 +244,11 @@ hpux_core_core_file_p (abfd)
             if (core_kernel_thread_id (abfd) == 0)
               {
                 if (!make_bfd_asection (abfd, ".reg",
-                                        SEC_HAS_CONTENTS,
-                                        core_header.len,
-                                        (int) &proc_info - (int) & proc_info.hw_regs,
-                                        2))
+                                       SEC_HAS_CONTENTS,
+                                       core_header.len,
+                                       (bfd_vma) offsetof (struct proc_info,
+                                                           hw_regs),
+                                       2))
                  goto fail;
               }
             else
@@ -259,17 +260,19 @@ hpux_core_core_file_p (abfd)
                    if (!make_bfd_asection (abfd, ".reg",
                                            SEC_HAS_CONTENTS,
                                            core_header.len,
-                                           (int) &proc_info - (int) & proc_info.hw_regs,
+                                           (bfd_vma)offsetof (struct proc_info,
+                                                              hw_regs),
                                            2))
                      goto fail;
                   }
                 /* We always make one of these sections, for every thread. */
                 sprintf (secname, ".reg/%d", core_kernel_thread_id (abfd));
                 if (!make_bfd_asection (abfd, secname,
-                                        SEC_HAS_CONTENTS,
-                                        core_header.len,
-                                        (int) &proc_info - (int) & proc_info.hw_regs,
-                                        2))
+                                       SEC_HAS_CONTENTS,
+                                       core_header.len,
+                                       (bfd_vma) offsetof (struct proc_info,
+                                                           hw_regs),
+                                       2))
                  goto fail;
               }
            core_signal (abfd) = proc_info.sig;
This page took 0.024231 seconds and 4 git commands to generate.