Commit 845f2c28 authored by Loïc Minier's avatar Loïc Minier Committed by Aurelien Jarno
Browse files

Fix missing symbols in .rel/.rela.plt sections



Fix .rel.plt sections in the output to not only include .rel.plt
sections from the input but also the .rel.iplt sections and to define
the hidden symbols __rel_iplt_start and __rel_iplt_end around
.rel.iplt as otherwise we get undefined references to these when
linking statically to a multilib libc.a.  This fixes the static build
under i386.

Apply similar logic to rela.plt/.iplt and __rela_iplt/_plt_start/_end to
fix the static build under amd64.

Signed-off-by: default avatarLoïc Minier <lool@dooz.org>
Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>
parent 02ecd9fc
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -39,8 +39,20 @@ SECTIONS
  .rela.fini     : { *(.rela.fini)	}
  .rel.bss       : { *(.rel.bss)		}
  .rela.bss      : { *(.rela.bss)		}
  .rel.plt       : { *(.rel.plt)		}
  .rela.plt      : { *(.rela.plt)		}
  .rel.plt      :
  {
    *(.rel.plt)
    PROVIDE_HIDDEN (__rel_iplt_start = .);
    *(.rel.iplt)
    PROVIDE_HIDDEN (__rel_iplt_end = .);
  }
  .rela.plt       :
  {
    *(.rela.plt)
    PROVIDE_HIDDEN (__rela_iplt_start = .);
    *(.rela.iplt)
    PROVIDE_HIDDEN (__rela_iplt_end = .);
  }
  .init          : { *(.init)	} =0x47ff041f
  .text      :
  {
+14 −2
Original line number Diff line number Diff line
@@ -35,8 +35,20 @@ SECTIONS
  .rela.got       : { *(.rela.got) }
  .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
  .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  .rel.plt        : { *(.rel.plt) }
  .rela.plt       : { *(.rela.plt) }
  .rel.plt      :
  {
    *(.rel.plt)
    PROVIDE_HIDDEN (__rel_iplt_start = .);
    *(.rel.iplt)
    PROVIDE_HIDDEN (__rel_iplt_end = .);
  }
  .rela.plt       :
  {
    *(.rela.plt)
    PROVIDE_HIDDEN (__rela_iplt_start = .);
    *(.rela.iplt)
    PROVIDE_HIDDEN (__rela_iplt_end = .);
  }
  .init           :
  {
    KEEP (*(.init))