From 2df91af910aa3f4e127837b907395758c3e5be14 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 8 Jul 2009 16:29:35 -0700 Subject: syslinux.ld: add support for .ctors and .dtors We're going to need at least constructors when we start linking in com32 library code in a serious way. Signed-off-by: H. Peter Anvin --- core/syslinux.ld | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/core/syslinux.ld b/core/syslinux.ld index 23f74b2f..4906ce4a 100644 --- a/core/syslinux.ld +++ b/core/syslinux.ld @@ -240,12 +240,32 @@ SECTIONS . = ALIGN(4); + __ctors_vma = .; + __ctors_lma = __ctors_vma + __text_lma - __text_vma; + .ctors : AT(__ctors_lma) { + __ctors_start = .; + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + __ctors_end = .; + } + + __dtors_vma = .; + __dtors_lma = __dtors_vma + __text_lma - __text_vma; + .dtors : AT(__dtors_lma) { + __dtors_start = .; + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + __dtors_end = .; + } + + . = ALIGN(4); + __got_vma = .; __got_lma = __got_vma + __text_lma - __text_vma; .got : AT(__got_lma) { __got_start = .; - *(.got.plt) - *(.got) + KEEP (*(.got.plt)) + KEEP (*(.got)) __got_end = .; } -- cgit v1.2.1