aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-s390.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2003-11-13 15:56:50 +0000
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2003-11-13 15:56:50 +0000
commitb5727d755eafbcbadac67832172c6aa3f311ba6d (patch)
tree3eda2090745deaf57205900bc30b3599f99c84b5 /bfd/elf32-s390.c
parenta50d3602e04dcfd5167f89b080abcdfabf272595 (diff)
downloadgdb-b5727d755eafbcbadac67832172c6aa3f311ba6d.zip
gdb-b5727d755eafbcbadac67832172c6aa3f311ba6d.tar.gz
gdb-b5727d755eafbcbadac67832172c6aa3f311ba6d.tar.bz2
* elf32-s390.c (elf_s390_relocate_section): Only convert R_390_32
to R_390_RELAVITE. Convert the other relocations against local symbols to relocations against the start of the section. * elf64-s390.c (elf_s390_relocate_section): Only convert R_390_64 to R_390_RELAVITE. Convert the other relocations against local symbols to relocations against the start of the section.
Diffstat (limited to 'bfd/elf32-s390.c')
-rw-r--r--bfd/elf32-s390.c40
1 files changed, 37 insertions, 3 deletions
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 80a753a..61b1cbf 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -2626,9 +2626,43 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
else
{
/* This symbol is local, or marked to become local. */
- relocate = TRUE;
- outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE);
- outrel.r_addend = relocation + rel->r_addend;
+ if (r_type == R_390_32)
+ {
+ relocate = TRUE;
+ outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE);
+ outrel.r_addend = relocation + rel->r_addend;
+ }
+ else
+ {
+ long sindx;
+
+ if (h == NULL)
+ sec = local_sections[r_symndx];
+ else
+ {
+ BFD_ASSERT (h->root.type == bfd_link_hash_defined
+ || (h->root.type
+ == bfd_link_hash_defweak));
+ sec = h->root.u.def.section;
+ }
+ if (sec != NULL && bfd_is_abs_section (sec))
+ sindx = 0;
+ else if (sec == NULL || sec->owner == NULL)
+ {
+ bfd_set_error(bfd_error_bad_value);
+ return FALSE;
+ }
+ else
+ {
+ asection *osec;
+
+ osec = sec->output_section;
+ sindx = elf_section_data (osec)->dynindx;
+ BFD_ASSERT (sindx > 0);
+ }
+ outrel.r_info = ELF32_R_INFO (sindx, r_type);
+ outrel.r_addend = relocation + rel->r_addend;
+ }
}
sreloc = elf_section_data (input_section)->sreloc;