}
}
-static void
+static void
obj_elf_local (ignore)
int ignore;
{
demand_empty_rest_of_line ();
}
-static void
+static void
obj_elf_weak (ignore)
int ignore;
{
static int previous_subsection;
/* Handle the .section pseudo-op. This code supports two different
- syntaxes.
+ syntaxes.
The first is found on Solaris, and looks like
.section ".sec1",#alloc,#execinstr,#write
demand_empty_rest_of_line ();
}
-void
+void
obj_read_begin_hook ()
{
#ifdef NEED_ECOFF_DEBUG
#endif
}
-void
+void
obj_symbol_new_hook (symbolP)
symbolS *symbolP;
{
#endif
}
-void
+void
obj_elf_version (ignore)
int ignore;
{
#endif
}
-void
+void
elf_frob_file ()
{
bfd_map_over_sections (stdoutput, adjust_stab_sections, (PTR) 0);
#ifdef elf_tc_final_processing
elf_tc_final_processing ();
#endif
+}
+
+/* It is required that we let write_relocs have the opportunity to
+ optimize away fixups before output has begun, since it is possible
+ to eliminate all fixups for a section and thus we never should
+ have generated the relocation section. */
+void
+elf_frob_file_after_relocs ()
+{
#ifdef NEED_ECOFF_DEBUG
if (ECOFF_DEBUGGING)
/* Generate the ECOFF debugging information. */
#define SET(ptr, offset, type) \
debug.ptr = (type) (buf + debug.symbolic_header.offset)
- SET (line, cbLineOffset, unsigned char *);
+ SET (line, cbLineOffset, unsigned char *);
SET (external_dnr, cbDnOffset, PTR);
SET (external_pdr, cbPdOffset, PTR);
SET (external_sym, cbSymOffset, PTR);
SET (external_rfd, cbRfdOffset, PTR);
/* ssext and external_ext are set up just below. */
-#undef SET
+#undef SET
/* Set up the external symbols. */
debug.ssext = debug.ssext_end = NULL;
case O_constant:
off = exp->X_add_number;
break;
-
+
default:
as_bad ("expression too complex for fixup");
}
*charPP += length;
}
-#ifndef BFD_ASSEMBLER
+#ifndef BFD_ASSEMBLER
int section_alignment[SEG_MAXIMUM_ORDINAL];
#endif
* boundary, all of the other alignments within it will work. At
* least one object format really uses this info.
*/
-void
+void
record_alignment (seg, align)
/* Segment to which alignment pertains */
segT seg;
#if !defined (BFD) && !defined (BFD_ASSEMBLER)
-void
+void
remove_subsegs (head, seg, root, last)
frchainS *head;
int seg;
#endif
/* Is there some other (target cpu dependent) reason we can't adjust
- this one? (E.g. relocations involving function addresses on
+ this one? (E.g. relocations involving function addresses on
the PA. */
#ifdef tc_fix_adjustable
if (! tc_fix_adjustable (fixp))
/* If the section symbol isn't going to be output, the relocs
at least should still work. If not, figure out what to do
- when we run into that case. */
+ when we run into that case.
+
+ We refetch the segment when calling section_symbol, rather
+ than using symsec, because S_GET_VALUE may wind up changing
+ the section when it calls resolve_symbol_value. */
fixp->fx_offset += S_GET_VALUE (sym);
- fixp->fx_addsy = section_symbol (symsec);
+ fixp->fx_addsy = section_symbol (S_GET_SEGMENT (sym));
fixp->fx_addsy->sy_used_in_reloc = 1;
done:
n--;
continue;
}
+
+#if 0
+ /* This test is triggered inappropriately for the SH. */
if (fixp->fx_where + fixp->fx_size
> fixp->fx_frag->fr_fix + fixp->fx_frag->fr_offset)
abort ();
+#endif
s = bfd_install_relocation (stdoutput, reloc,
fixp->fx_frag->fr_literal,
}
#endif
-void
+void
write_object_file ()
{
struct frchain *frchainP; /* Track along all frchains. */
#else
fix_new_exp (lie->frag,
lie->word_goes_here - lie->frag->fr_literal,
- 2, &exp, 0, BFD_RELOC_NONE);
+ 2, &exp, 0, BFD_RELOC_16);
#endif
#else
#if defined(TC_SPARC) || defined(TC_A29K) || defined(NEED_FX_R_TYPE)
PROGRESS (1);
+#ifdef tc_frob_file_before_adjust
+ tc_frob_file_before_adjust ();
+#endif
+#ifdef obj_frob_file_before_adjust
+ obj_frob_file_before_adjust ();
+#endif
+
bfd_map_over_sections (stdoutput, adjust_reloc_syms, (char *)0);
/* Set up symbol table, and write it out. */
bfd_map_over_sections (stdoutput, write_relocs, (char *) 0);
+#ifdef tc_frob_file_after_relocs
+ tc_frob_file_after_relocs ();
+#endif
+#ifdef obj_frob_file_after_relocs
+ obj_frob_file_after_relocs ();
+#endif
+
bfd_map_over_sections (stdoutput, write_contents, (char *) 0);
#endif /* BFD_ASSEMBLER */
}
#ifdef TC_GENERIC_RELAX_TABLE
/* Subroutines of relax_segment. */
-static int
+static int
is_dnrange (f1, f2)
struct frag *f1;
struct frag *f2;
return (new_address - address);
}
-void
+void
relax_segment (segment_frag_root, segment)
struct frag *segment_frag_root;
segT segment;
int pcrel, plt;
fragS *fragP;
segT add_symbol_segment = absolute_section;
-
+
/* If the linker is doing the relaxing, we must not do any fixups.
Well, strictly speaking that's not true -- we could do any that are
if (add_symbolP)
add_symbol_segment = S_GET_SEGMENT (add_symbolP);
-
+
if (sub_symbolP)
{
resolve_symbol_value (sub_symbolP);
add_number += S_GET_VALUE (add_symbolP);
add_number -= MD_PCREL_FROM_SECTION (fixP, this_segment_type);
pcrel = 0; /* Lie. Don't want further pcrel processing. */
-
+
/* Let the target machine make the final determination
as to whether or not a relocation will be needed to
handle this fixup. */
/* Let the target machine make the final determination
as to whether or not a relocation will be needed to
handle this fixup. */
-
+
if (!TC_FORCE_RELOCATION (fixP))
{
fixP->fx_addsy = NULL;
continue;
} /* COBR */
#endif /* TC_I960 */
-
+
#ifdef OBJ_COFF
#ifdef TE_I386AIX
if (S_IS_COMMON (add_symbolP))