This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: s390 fix for fix_adjustable.


>> the fix to prevent adjustments for pc-relative symbols in merge sections
>> got lost with the gas reloc rewrite. I have readded it.
>
>Hmm, it wasn't accidental.  I removed it because
>
 >/* Never adjust a reloc against local symbol in a merge section
    >with non-zero addend.  */
 >if ((symsec->flags & SEC_MERGE) != 0 && fixp->fx_offset != 0)
   >continue;
 >
>in write.c should be all that is required.  What did I miss?

The reason for this are our lovely literal pool entries for symbols in read
only sections, e.g.:

      .file "merge.c"
      .section    .rodata.str1.2,"aMS",@progbits,1
      .align      2
.LC0:
      .string     "some string"
.text
      .align      4
.globl main
      .type main,@function
main:
      stm   %r12,%r15,48(%r15)
      bras  %r13,.LTN0
.LT0:
.LC1:
      .long puts@PLT-.LT0
.LC2:
      .long .LC0-.LT0
.LC3:
      .long _GLOBAL_OFFSET_TABLE_-.LT0
.LTN0:
      lr    %r14,%r15
      l     %r12,.LC3-.LT0(%r13)
      ahi   %r15,-96
      l     %r2,.LC2-.LT0(%r13)
      l     %r1,.LC1-.LT0(%r13)
      la    %r12,0(%r12,%r13)
      st    %r14,0(%r15)
      la    %r2,0(%r13,%r2)
      bas   %r14,0(%r13,%r1)
      lhi   %r2,0
      l     %r4,152(%r15)
      lm    %r12,%r15,144(%r15)
      br    %r4
.Lfe1:
      .size main,.Lfe1-main
      .ident      "GCC: (GNU) 3.2"

The ".long .LC0 - .LT0" relocation gets converted to a pc-relative relocation
with an offset (R_390_PC32 .LC0+4). The "fixp->fx_offset != 0" is the culprit.

blue skies,
   Martin

Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH
Schönaicherstr. 220, D-71032 Böblingen, Telefon: 49 - (0)7031 - 16-2247
E-Mail: schwidefsky@de.ibm.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]