From: Ken Raeburn Date: Tue, 8 Aug 1995 06:54:30 +0000 (+0000) Subject: * write.c (relax_align): Add extra padding for linkrelax only if X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d4083e293a41b03d62c8e8f5a9d3c16766f58e70;p=binutils-gdb.git * write.c (relax_align): Add extra padding for linkrelax only if LINKER_RELAXING_SHRINKS_ONLY is defined. * config/tc-i960.h (LINKER_RELAXING_SHRINKS_ONLY): Define it. * doc/internals.texi (Relaxation): Write up some stuff on linker relaxing and LINKER_RELAXING_SHRINKS_ONLY. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 633bada58d4..786da1a975c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +Tue Aug 8 02:31:38 1995 Ken Raeburn + + * write.c (relax_align): Add extra padding for linkrelax only if + LINKER_RELAXING_SHRINKS_ONLY is defined. + * config/tc-i960.h (LINKER_RELAXING_SHRINKS_ONLY): Define it. + * doc/internals.texi (Relaxation): Write up some stuff on linker + relaxing and LINKER_RELAXING_SHRINKS_ONLY. + Mon Aug 7 17:18:10 1995 Ian Lance Taylor * config/m68k-parse.y: New file: bison grammar for m68k operands, diff --git a/gas/write.c b/gas/write.c index 8e5015b7a61..df8f66e984d 100644 --- a/gas/write.c +++ b/gas/write.c @@ -413,8 +413,9 @@ cvt_frag_to_fill (sec, fragP) fragS *fragP; #else static void -cvt_frag_to_fill (headersP, fragP) +cvt_frag_to_fill (headersP, sec, fragP) object_headers *headersP; + segT sec; fragS *fragP; #endif { @@ -446,7 +447,7 @@ cvt_frag_to_fill (headersP, fragP) #ifdef BFD_ASSEMBLER md_convert_frag (stdoutput, sec, fragP); #else - md_convert_frag (headersP, fragP); + md_convert_frag (headersP, sec, fragP); #endif assert (fragP->fr_next == NULL || (fragP->fr_next->fr_address - fragP->fr_address == fragP->fr_fix)); @@ -639,6 +640,13 @@ adjust_reloc_syms (abfd, sec, xxx) || bfd_is_com_section (symsec)) { fixp->fx_addsy->sy_used_in_reloc = 1; +#ifdef UNDEFINED_DIFFERENCE_OK + /* We have the difference of an undefined symbol and some + other symbol. Make sure to mark the other symbol as used + in a relocation so that it will always be output. */ + if (fixp->fx_subsy) + fixp->fx_subsy->sy_used_in_reloc = 1; +#endif goto done; } @@ -1309,7 +1317,7 @@ write_object_file () for (fragP = text_frag_root; fragP; fragP = fragP->fr_next) { - cvt_frag_to_fill (&headers, fragP); + cvt_frag_to_fill (&headers, SEG_TEXT, fragP); /* Some assert macros don't work with # directives mixed in. */ #ifndef NDEBUG @@ -1725,10 +1733,12 @@ relax_align (address, alignment) mask = ~((~0) << alignment); new_address = (address + mask) & (~mask); +#ifdef LINKER_RELAXING_SHRINKS_ONLY if (linkrelax) /* We must provide lots of padding, so the linker can discard it when needed. The linker will not add extra space, ever. */ new_address += (1 << alignment); +#endif return (new_address - address); } @@ -2223,6 +2233,15 @@ fixup_segment (fixP, this_segment_type) fixP->fx_subsy = 0; } #endif +#ifdef UNDEFINED_DIFFERENCE_OK + /* The PA needs this for PIC code generation. We basically + don't want to do anything if we have the difference of two + symbols at this point. */ + else if (1) + { + /* Leave it alone. */ + } +#endif #ifdef BFD_ASSEMBLER else if (fixP->fx_r_type == BFD_RELOC_GPREL32 || fixP->fx_r_type == BFD_RELOC_GPREL16)