summaryrefslogtreecommitdiff
path: root/bfd/elf32-score.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-10-19 15:47:34 +0000
committerNick Clifton <nickc@redhat.com>2006-10-19 15:47:34 +0000
commit03f6d7b8a11022ba8d63ae879670f290a0774a02 (patch)
treecb91de44d8346995614f42a56d95d6e992130a34 /bfd/elf32-score.c
parent217c0698e8e545d0041d4d7a109f98fc7d3b5f3f (diff)
downloadbinutils-redhat-03f6d7b8a11022ba8d63ae879670f290a0774a02.tar.gz
Fix score bugs
Diffstat (limited to 'bfd/elf32-score.c')
-rw-r--r--bfd/elf32-score.c39
1 files changed, 14 insertions, 25 deletions
diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c
index 60a1a20027..ab697ff3b3 100644
--- a/bfd/elf32-score.c
+++ b/bfd/elf32-score.c
@@ -1141,20 +1141,19 @@ score_elf_rel_dyn_section (bfd *dynobj, bfd_boolean create_p)
sreloc = bfd_get_section_by_name (dynobj, dname);
if (sreloc == NULL && create_p)
{
- sreloc = bfd_make_section (dynobj, dname);
+ sreloc = bfd_make_section_with_flags (dynobj, dname,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY));
if (sreloc == NULL
- || ! bfd_set_section_flags (dynobj, sreloc,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY))
- || ! bfd_set_section_alignment (dynobj, sreloc, SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
+ || ! bfd_set_section_alignment (dynobj, sreloc,
+ SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
return NULL;
}
-
- return sreloc;
+ return sreloc;
}
static void
@@ -1350,9 +1349,8 @@ score_elf_create_got_section (bfd *abfd,
/* We have to use an alignment of 2**4 here because this is hardcoded
in the function stub generation and in the linker script. */
- s = bfd_make_section (abfd, ".got");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags)
+ s = bfd_make_section_with_flags (abfd, ".got", flags);
+ if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, 4))
return FALSE;
@@ -1929,15 +1927,6 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
r_type = ELF32_R_TYPE (rel->r_info);
rel_addr = (input_section->output_section->vma + input_section->output_offset + rel->r_offset);
- /* If the start address has been set, then set the EF_SCORE_HASENTRY
- flag. Setting this more than once is redundant, but the cost is
- not too high, and it keeps the code simple.
- The test is done here, rather than somewhere else, because the
- start address is only set just before the final link commences.
- Note - if the user deliberately sets a start address of 0, the flag will not be set. */
- if (bfd_get_start_address (output_bfd) != 0)
- elf_elfheader (output_bfd)->e_flags |= EF_SCORE_HASENTRY;
-
if (r_type == R_SCORE_GOT15)
{
const Elf_Internal_Rela *relend;
@@ -3173,9 +3162,9 @@ _bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
/* Create .stub section. */
if (bfd_get_section_by_name (abfd, SCORE_ELF_STUB_SECTION_NAME) == NULL)
{
- s = bfd_make_section (abfd, SCORE_ELF_STUB_SECTION_NAME);
+ s = bfd_make_section_with_flags (abfd, SCORE_ELF_STUB_SECTION_NAME,
+ flags | SEC_CODE);
if (s == NULL
- || !bfd_set_section_flags (abfd, s, flags | SEC_CODE)
|| !bfd_set_section_alignment (abfd, s, 2))
return FALSE;