+2006-10-19 Mei Ligang <ligang@sunnorth.com.cn>
+
+ * elf32-score.c (score_elf_rel_dyn_section): Replace
+ bfd_make_section with bfd_make_section_with_flags.
+ (_bfd_score_elf_create_dynamic_sections): Ditto.
+ (score_elf_create_got_section): Ditto.
+ (score_elf_final_link_relocate): Delete referrence to
+ EF_SCORE_HASENTRY.
+
2006-10-19 Richard Sandiford <richard@codesourcery.com>
* elfxx-mips.c (sort_dynamic_relocs): Sort relocations against the
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
/* 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;
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;
/* 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;
+2006-10-19 Mei Ligang <ligang@sunnorth.com.cn>
+
+ * config/tc-score.c (build_relax_frag): Compute correct
+ tc_frag_data.fixp.
+
2006-10-18 Roy Marples <uberlord@gentoo.org>
* config/tc-sparc.c (md_parse_option): Treat any target starting with
md_show_usage (stream)
FILE *stream;
{
- fprintf (stream, _("MN10300 options:\n\
+ fprintf (stream, _("MN10300 assembler options:\n\
none yet\n"));
}
int i;
char *p;
fixS *fixp = NULL;
- fixS *head_fixp = NULL;
+ fixS *cur_fixp = NULL;
long where;
struct score_it inst_main;
md_number_to_chars (p, inst_main.instruction, inst_main.size);
if (inst_main.reloc.type != BFD_RELOC_NONE)
- {
- fixp = fix_new_score (frag_now, p - frag_now->fr_literal, inst_main.size,
- &inst_main.reloc.exp, inst_main.reloc.pc_rel, inst_main.reloc.type);
- }
-
- head_fixp = xmalloc (sizeof (fixS *));
- frag_now->tc_frag_data.fixp = head_fixp;
+ fixp = fix_new_score (frag_now, p - frag_now->fr_literal, inst_main.size,
+ &inst_main.reloc.exp, inst_main.reloc.pc_rel, inst_main.reloc.type);
- if (fixp)
- {
- head_fixp->fx_next = fixp;
- head_fixp = head_fixp->fx_next;
- }
+ frag_now->tc_frag_data.fixp = fixp;
+ cur_fixp = frag_now->tc_frag_data.fixp;
#ifdef OBJ_ELF
dwarf2_emit_insn (inst_main.size);
var_insts[i].reloc.type);
if (fixp)
{
- head_fixp->fx_next = fixp;
- head_fixp = head_fixp->fx_next;
+ if (cur_fixp)
+ {
+ cur_fixp->fx_next = fixp;
+ cur_fixp = cur_fixp->fx_next;
+ }
+ else
+ {
+ frag_now->tc_frag_data.fixp = fixp;
+ cur_fixp = frag_now->tc_frag_data.fixp;
+ }
}
}
}
- head_fixp = frag_now->tc_frag_data.fixp;
- frag_now->tc_frag_data.fixp = head_fixp->fx_next;
- free (head_fixp);
-
p = frag_var (rs_machine_dependent, inst_main.relax_size + RELAX_PAD_BYTE, 0,
RELAX_ENCODE (inst_main.size, inst_main.relax_size, inst_main.type,
0, inst_main.size, 0), add_symbol, 0, NULL);
+2006-10-19 Mei Ligang <ligang@sunnorth.com.cn>
+
+ * score.h (EF_SCORE_PIC): Redefine EF_SCORE_PIC as 0x80000000.
+ (EF_SCORE_FIXDEP): Redefine EF_SCORE_FIXDEP as 0x40000000.
+ (EF_SCORE_HASENTRY): Delete.
+
2006-09-17 Mei Ligang <ligang@sunnorth.com.cn>
* score.h: New file.
#include "elf/reloc-macros.h"
#define SCORE_SIMULATOR_ACTIVE 1
-#define OPC_PTMASK 0xc0000000 /* Parity-bit Mask */
+#define OPC_PTMASK 0xc0000000 /* Parity-bit Mask. */
#define OPC16_PTMASK 0x00008000
/* The parity-bit denotes. */
-#define OPC_32 0xc0000000 /* denotes 32b instruction, (default) */
-#define OPC_16 0x00000000 /* denotes 16b instruction */
-#define OPC_PE 0x8000 /* denotes parallel-execution instructions */
-#define EF_SCORE_HASENTRY 0x02
+#define OPC_32 0xc0000000 /* Denotes 32b instruction, (default). */
+#define OPC_16 0x00000000 /* Denotes 16b instruction. */
+#define OPC_PE 0x8000 /* Denotes parallel-execution instructions. */
#define GP_DISP_LABEL "_gp_disp"
-/* Processor specific flags for the ELF header e_flags field. */
-
-/* Fix data dependency. */
-#define EF_SCORE_FIXDEP 0x00000001
+/* Processor specific flags for the ELF header e_flags field: */
/* File contains position independent code. */
-#define EF_SCORE_PIC 0x00000002
+#define EF_SCORE_PIC 0x80000000
+
+/* Fix data dependency. */
+#define EF_SCORE_FIXDEP 0x40000000
/* Defined and allocated common symbol. Value is virtual address. If
relocated, alignment must be preserved. */
@itemx --no-gc-sections
Enable garbage collection of unused input sections. It is ignored on
targets that do not support this option. This option is not compatible
-with @samp{-r}. The default behaviour (of not performing this garbage
-collection) can be restored by specifying @samp{--no-gc-sections} on
-the command line.
+with @samp{-r} or @samp{--emit-relocs}. The default behaviour (of not
+performing this garbage collection) can be restored by specifying
+@samp{--no-gc-sections} on the command line.
@kindex --print-gc-sections
@kindex --no-print-gc-sections