You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
/* This file is based on a preliminary PowerPC ELF ABI.
But its been hacked on for the IBM 360/370 architectures.
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
| SEC_LINKER_CREATED);
- s = bfd_make_section (abfd, ".dynsbss");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, SEC_ALLOC))
+ s = bfd_make_section_with_flags (abfd, ".dynsbss",
+ SEC_ALLOC | SEC_LINKER_CREATED);
+ if (s == NULL)
return FALSE;
if (! info->shared)
{
- s = bfd_make_section (abfd, ".rela.sbss");
+ s = bfd_make_section_with_flags (abfd, ".rela.sbss",
+ flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
|| ! bfd_set_section_alignment (abfd, s, 2))
return FALSE;
}
/* xxx beats me, seem to need a rela.text ... */
- s = bfd_make_section (abfd, ".rela.text");
+ s = bfd_make_section_with_flags (abfd, ".rela.text",
+ flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
|| ! bfd_set_section_alignment (abfd, s, 2))
return FALSE;
return TRUE;
if (s->size == 0)
{
/* Strip this section if we don't need it; see the
- comment below. */
+ comment below. */
strip = TRUE;
}
else
{
flagword flags;
- sreloc = bfd_make_section (dynobj, name);
flags = (SEC_HAS_CONTENTS | SEC_READONLY
| SEC_IN_MEMORY | SEC_LINKER_CREATED);
if ((sec->flags & SEC_ALLOC) != 0)
flags |= SEC_ALLOC | SEC_LOAD;
+ sreloc = bfd_make_section_with_flags (dynobj, name,
+ flags);
if (sreloc == NULL
- || ! bfd_set_section_flags (dynobj, sreloc, flags)
|| ! bfd_set_section_alignment (dynobj, sreloc, 2))
return FALSE;
}
}
}
- /* Add a blrl instruction at _GLOBAL_OFFSET_TABLE_-4 so that a function can
- easily find the address of the _GLOBAL_OFFSET_TABLE_. */
-/* XXX this is clearly very wrong for the 370 arch */
if (sgot)
{
unsigned char *contents = sgot->contents;
- bfd_put_32 (output_bfd, (bfd_vma) 0x4e800021 /* blrl */, contents);
if (sdyn == NULL)
- bfd_put_32 (output_bfd, (bfd_vma) 0, contents+4);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, contents);
else
bfd_put_32 (output_bfd,
sdyn->output_section->vma + sdyn->output_offset,
- contents+4);
+ contents);
elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
}
}
/* Set the sh_info field of the output .dynsym section to the
- index of the first global symbol. */
+ index of the first global symbol. */
elf_section_data (sdynsym->output_section)->this_hdr.sh_info =
maxdindx + 1;
}
|| r_type == R_I370_RELATIVE))
{
/* In these cases, we don't need the relocation
- value. We check specially because in some
- obscure cases sec->output_section will be NULL. */
+ value. We check specially because in some
+ obscure cases sec->output_section will be NULL. */
relocation = 0;
}
else
continue;
/* Relocations that may need to be propagated if this is a shared
- object. */
+ object. */
case (int)R_I370_REL31:
/* If these relocations are not to a named symbol, they can be
handled right here, no need to bother the dynamic linker. */
/* fall through */
/* Relocations that always need to be propagated if this is a shared
- object. */
+ object. */
case (int)R_I370_ADDR31:
case (int)R_I370_ADDR16:
if (info->shared
#endif
/* When generating a shared object, these relocations
- are copied into the output file to be resolved at run
- time. */
+ are copied into the output file to be resolved at run
+ time. */
if (sreloc == NULL)
{
if (skip)
memset (&outrel, 0, sizeof outrel);
/* h->dynindx may be -1 if this symbol was marked to
- become local. */
+ become local. */
else if (h != NULL
&& ((! info->symbolic && h->dynindx != -1)
|| !h->def_regular))
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
/* This reloc will be computed at runtime, so there's no
- need to do anything now, unless this is a RELATIVE
- reloc in an unallocated section. */
+ need to do anything now, unless this is a RELATIVE
+ reloc in an unallocated section. */
if (skip == -1
|| (input_section->flags & SEC_ALLOC) != 0
|| ELF32_R_TYPE (outrel.r_info) != R_I370_RELATIVE)
#define elf_info_to_howto i370_elf_info_to_howto
#define elf_backend_plt_not_loaded 1
-#define elf_backend_got_symbol_offset 4
#define elf_backend_rela_normal 1
#define bfd_elf32_bfd_reloc_type_lookup i370_elf_reloc_type_lookup