diff options
author | Richard Sandiford <rsandifo@nildram.co.uk> | 2009-04-01 20:09:02 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@nildram.co.uk> | 2009-04-01 20:09:02 +0000 |
commit | 6bc1281be79a0301af5975312d6041b26f5f0d09 (patch) | |
tree | 3f94ee4d5252447d7cc6f1936d1dc69ae9ea0870 /bfd/xcofflink.c | |
parent | 1c942a12c392ccb841d10d152dd8a75ba0f8c58b (diff) | |
download | gdb-6bc1281be79a0301af5975312d6041b26f5f0d09.tar.gz |
bfd/
* xcofflink.c (bfd_link_input_bfd): Treat __rtinit as C_HIDEXT
rather than C_EXT.
ld/testsuite/
* ld-powerpc/aix-gc-1.nd: New test.
* ld-powerpc/aix52.exp: Run it.
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r-- | bfd/xcofflink.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 97c051a2b9f..cb1da9eb6ae 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -4289,6 +4289,7 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *finfo, esym = (bfd_byte *) obj_coff_external_syms (input_bfd); esym_end = esym + obj_raw_syment_count (input_bfd) * isymesz; + sym_hash = obj_xcoff_sym_hashes (input_bfd); isymp = finfo->internal_syms; indexp = finfo->sym_indices; csectpp = xcoff_data (input_bfd)->csects; @@ -4336,6 +4337,16 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *finfo, } } + /* Make __rtinit C_HIDEXT rather than C_EXT. This avoids + multiple definition problems when linking a shared object + statically. (The native linker doesn't enter __rtinit into + the normal table at all, but having a local symbol can make + the objdump output easier to read.) */ + if (isym.n_sclass == C_EXT + && *sym_hash + && ((*sym_hash)->flags & XCOFF_RTINIT) != 0) + isym.n_sclass = C_HIDEXT; + /* The value of a C_FILE symbol is the symbol index of the next C_FILE symbol. The value of the last C_FILE symbol is -1. We try to get this right, below, just before we @@ -4664,6 +4675,7 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *finfo, } } + sym_hash += add; indexp += add; isymp += add; csectpp += add; |