aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-11-08 21:24:33 +0000
committerIan Lance Taylor <ian@airs.com>1995-11-08 21:24:33 +0000
commit0bb8ff191ec9e1c54f17a0a2e3faff7ae75cadd7 (patch)
tree63a163919865fde9239a563010c7b191c03c7bf0
parent7812bf9c25192463489dfb439eb92b2fcd34f305 (diff)
downloadgdb-0bb8ff191ec9e1c54f17a0a2e3faff7ae75cadd7.zip
gdb-0bb8ff191ec9e1c54f17a0a2e3faff7ae75cadd7.tar.gz
gdb-0bb8ff191ec9e1c54f17a0a2e3faff7ae75cadd7.tar.bz2
* libbfd.c (bfd_get_file_window): Change writable parameter from
int to boolean; update all callers. Pass MAP_SHARED if not writable--it's required on Solaris. Cast fprintf argument to avoid warning. * bfd-in.h (bfd_get_file_window): Update declaration. * bfd-in2.h: Rebuild. * aoutx.h: Update calls to bfd_get_file_window.
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/aoutx.h4
-rw-r--r--bfd/bfd-in.h2
-rw-r--r--bfd/bfd-in2.h2
-rw-r--r--bfd/libbfd.c10
5 files changed, 18 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1334726..783ea82 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,13 @@
Wed Nov 8 11:31:11 1995 Ian Lance Taylor <ian@cygnus.com>
+ * libbfd.c (bfd_get_file_window): Change writable parameter from
+ int to boolean; update all callers. Pass MAP_SHARED if not
+ writable--it's required on Solaris. Cast fprintf argument to
+ avoid warning.
+ * bfd-in.h (bfd_get_file_window): Update declaration.
+ * bfd-in2.h: Rebuild.
+ * aoutx.h: Update calls to bfd_get_file_window.
+
* xcofflink.c (XCOFF_DEF_DYNAMIC): Rename from XCOFF_REF_DYNAMIC.
Change all uses.
(xcoff_swap_ldhdr_in): New static function.
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 8d7ea3a..8d36de5 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -1230,7 +1230,7 @@ aout_get_external_symbols (abfd)
if (bfd_get_file_window (abfd,
obj_sym_filepos (abfd), exec_hdr (abfd)->a_syms,
- &obj_aout_sym_window (abfd), 1) == false)
+ &obj_aout_sym_window (abfd), true) == false)
return false;
syms = (struct external_nlist *) obj_aout_sym_window (abfd).data;
@@ -1253,7 +1253,7 @@ aout_get_external_symbols (abfd)
stringsize = GET_WORD (abfd, string_chars);
if (bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize,
- &obj_aout_string_window (abfd), 1) == false)
+ &obj_aout_string_window (abfd), true) == false)
return false;
strings = (char *) obj_aout_string_window (abfd).data;
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 303ce02..de096c5 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -621,7 +621,7 @@ typedef struct _bfd_window {
extern void bfd_init_window PARAMS ((bfd_window *));
extern void bfd_free_window PARAMS ((bfd_window *));
extern boolean bfd_get_file_window
- PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, int));
+ PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, boolean));
/* XCOFF support routines for the linker. */
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 54a7c0c..3621b55 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -621,7 +621,7 @@ typedef struct _bfd_window {
extern void bfd_init_window PARAMS ((bfd_window *));
extern void bfd_free_window PARAMS ((bfd_window *));
extern boolean bfd_get_file_window
- PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, int));
+ PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, boolean));
/* XCOFF support routines for the linker. */
diff --git a/bfd/libbfd.c b/bfd/libbfd.c
index 291b1fd..c2d8b9f 100644
--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -308,7 +308,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
file_ptr offset;
bfd_size_type size;
bfd_window *windowp;
- int writable;
+ boolean writable;
{
static size_t pagesize;
bfd_window_internal *i = windowp->i;
@@ -367,7 +367,9 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
}
i->data = mmap (i->data, real_size,
writable ? PROT_WRITE | PROT_READ : PROT_READ,
- writable ? MAP_FILE | MAP_PRIVATE : MAP_FILE,
+ (writable
+ ? MAP_FILE | MAP_PRIVATE
+ : MAP_FILE | MAP_SHARED),
fd, file_offset);
if (i->data == (PTR) -1)
{
@@ -393,7 +395,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
{
if (ok_to_map)
fprintf (stderr, "not mapping: data=%x mapped=%d\n",
- i->data, i->mapped);
+ i->data, (int) i->mapped);
else
fprintf (stderr, "not mapping: env var not set\n");
}
@@ -1039,7 +1041,7 @@ _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count)
return bfd_get_section_contents (abfd, section, w->data, offset, count);
}
if ((bfd_size_type) (offset+count) > section->_raw_size
- || (bfd_get_file_window (abfd, section->filepos + offset, count, w, 1)
+ || (bfd_get_file_window (abfd, section->filepos + offset, count, w, true)
== false))
return false;
return true;