summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rix <trix@redhat.com>2001-09-06 15:20:00 +0000
committerTom Rix <trix@redhat.com>2001-09-06 15:20:00 +0000
commit40a964c7a4f51248a1244df49f34667de953b50c (patch)
tree3ebd33b648408bf79b5309264b3ab95e689c49ae
parent4b9f58a7f467b0cd0da6edd9fcd7585ccf7af39e (diff)
downloadgdb-40a964c7a4f51248a1244df49f34667de953b50c.tar.gz
Fix import symbols for AIX.
-rw-r--r--bfd/ChangeLog11
-rw-r--r--bfd/bfd-in.h5
-rw-r--r--bfd/bfd-in2.h5
-rw-r--r--bfd/libxcoff.h5
-rw-r--r--bfd/xcofflink.c36
-rw-r--r--include/coff/ChangeLog4
-rw-r--r--include/coff/xcoff.h10
7 files changed, 61 insertions, 15 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ffc81da2cbc..8e056f93813 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,14 @@
+2001-09-05 Tom Rix <trix@redhat.com>
+
+ * xcofflink.c (bfd_xcoff_import_symbol): Handle import file XMC_XO
+ and syscall symbols.
+ (write_global_symbol) : Same.
+ (bfd_xcoff_export_symbol): Remove unused syscall param.
+ * libxcoff.h: Change prototype of bfd_xcoff_export symbol and
+ bfd_xcoff_import_symbol.
+ * bfd-in.h: Same.
+ * bfd-in2.h : Regenerate.
+
2001-09-04 Richard Henderson <rth@redhat.com>
* elf64-alpha.c (SKIP_HOWTO): New.
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 6d4293ee982..079761fc279 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -722,10 +722,9 @@ extern boolean bfd_xcoff_link_record_set
bfd_size_type));
extern boolean bfd_xcoff_import_symbol
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
- bfd_vma, const char *, const char *, const char *));
+ bfd_vma, const char *, const char *, const char *, unsigned int));
extern boolean bfd_xcoff_export_symbol
- PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
- boolean));
+ PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *));
extern boolean bfd_xcoff_link_count_reloc
PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_xcoff_record_link_assignment
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 148fcaa272f..b725dd42adb 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -722,10 +722,9 @@ extern boolean bfd_xcoff_link_record_set
bfd_size_type));
extern boolean bfd_xcoff_import_symbol
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
- bfd_vma, const char *, const char *, const char *));
+ bfd_vma, const char *, const char *, const char *, unsigned int));
extern boolean bfd_xcoff_export_symbol
- PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
- boolean));
+ PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *));
extern boolean bfd_xcoff_link_count_reloc
PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_xcoff_record_link_assignment
diff --git a/bfd/libxcoff.h b/bfd/libxcoff.h
index 83a65924c64..cbc0bfca948 100644
--- a/bfd/libxcoff.h
+++ b/bfd/libxcoff.h
@@ -248,10 +248,9 @@ extern boolean bfd_xcoff_link_record_set
bfd_size_type));
extern boolean bfd_xcoff_import_symbol
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
- bfd_vma, const char *, const char *, const char *));
+ bfd_vma, const char *, const char *, const char *, unsigned int));
extern boolean bfd_xcoff_export_symbol
- PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
- boolean));
+ PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *));
extern boolean bfd_xcoff_link_count_reloc
PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_xcoff_record_link_assignment
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index ec4257c91b5..6f70a32bd62 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -2514,7 +2514,7 @@ bfd_xcoff_link_record_set (output_bfd, info, harg, size)
boolean
bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile,
- impmember)
+ impmember, syscall_flag)
bfd *output_bfd;
struct bfd_link_info *info;
struct bfd_link_hash_entry *harg;
@@ -2522,6 +2522,7 @@ bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile,
const char *imppath;
const char *impfile;
const char *impmember;
+ unsigned int syscall_flag;
{
struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg;
@@ -2564,7 +2565,7 @@ bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile,
h = hds;
}
- h->flags |= XCOFF_IMPORT;
+ h->flags |= (XCOFF_IMPORT | syscall_flag);
if (val != (bfd_vma) -1)
{
@@ -2631,11 +2632,10 @@ bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile,
/* Export a symbol. */
boolean
-bfd_xcoff_export_symbol (output_bfd, info, harg, syscall)
+bfd_xcoff_export_symbol (output_bfd, info, harg)
bfd *output_bfd;
struct bfd_link_info *info;
struct bfd_link_hash_entry *harg;
- boolean syscall ATTRIBUTE_UNUSED;
{
struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg;
@@ -5334,7 +5334,10 @@ xcoff_write_global_symbol (h, p)
if (((h->flags & XCOFF_DEF_REGULAR) == 0 &&
(h->flags & XCOFF_DEF_DYNAMIC) != 0) ||
(h->flags & XCOFF_IMPORT) != 0) {
- ldsym->l_smtype |= L_IMPORT;
+ /* Clear l_smtype
+ Import symbols are defined so the check above will make the l_smtype
+ XTY_SD. But this is not correct, it should be cleared. */
+ ldsym->l_smtype = L_IMPORT;
}
if (((h->flags & XCOFF_DEF_REGULAR) != 0 &&
@@ -5353,6 +5356,29 @@ xcoff_write_global_symbol (h, p)
ldsym->l_smclas = h->smclas;
+ if (ldsym->l_smtype & L_IMPORT)
+ {
+ if ((h->root.type == bfd_link_hash_defined ||
+ h->root.type == bfd_link_hash_defweak) &&
+ (h->root.u.def.value != 0))
+ {
+ ldsym->l_smclas = XMC_XO;
+ }
+ else if ((h->flags & (XCOFF_SYSCALL32 | XCOFF_SYSCALL64)) ==
+ (XCOFF_SYSCALL32 | XCOFF_SYSCALL64))
+ {
+ ldsym->l_smclas = XMC_SV3264;
+ }
+ else if (h->flags & XCOFF_SYSCALL32)
+ {
+ ldsym->l_smclas = XMC_SV;
+ }
+ else if (h->flags & XCOFF_SYSCALL64)
+ {
+ ldsym->l_smclas = XMC_SV64;
+ }
+ }
+
if (ldsym->l_ifile == (bfd_size_type) -1) {
ldsym->l_ifile = 0;
diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog
index 498cb265b81..6577b5b6798 100644
--- a/include/coff/ChangeLog
+++ b/include/coff/ChangeLog
@@ -1,3 +1,7 @@
+2001-09-05 Tom Rix <trix@redhat.com>
+
+ * xcoff.h : Add XCOFF_SYSCALL32 and XCOFF_SYSCALL64 hash table flags.
+
2001-08-27 Andreas Jaeger <aj@suse.de>
* xcoff.h (struct __rtinit): Make proper prototype for rtl.
diff --git a/include/coff/xcoff.h b/include/coff/xcoff.h
index 508ddfaa214..b25c2945c5b 100644
--- a/include/coff/xcoff.h
+++ b/include/coff/xcoff.h
@@ -122,6 +122,8 @@
/* 14 ??? */
#define XMC_TC0 15 /* Read-write TOC anchor */
#define XMC_TD 16 /* Read-write data in TOC */
+#define XMC_SV64 17 /* Read-only 64 bit supervisor call */
+#define XMC_SV3264 18 /* Read-only 32 or 64 bit supervisor call */
/* The ldhdr structure. This appears at the start of the .loader
section. */
@@ -305,6 +307,11 @@ struct xcoff_link_hash_entry
* XCOFF_RTINIT
* Symbol is the __rtinit symbol
*
+ * XCOFF_SYSCALL32
+ * Symbol is an imported 32 bit syscall
+ *
+ * XCOFF_SYSCALL64
+ * Symbol is an imported 64 bit syscall
*/
#define XCOFF_REF_REGULAR 0x00000001
@@ -322,7 +329,8 @@ struct xcoff_link_hash_entry
#define XCOFF_DESCRIPTOR 0x00001000
#define XCOFF_MULTIPLY_DEFINED 0x00002000
#define XCOFF_RTINIT 0x00004000
-
+#define XCOFF_SYSCALL32 0x00008000
+#define XCOFF_SYSCALL64 0x00010000
/* The XCOFF linker hash table. */