mirror of https://github.com/acidanthera/audk.git
BaseTools: make sure the got is empty
Add ASSERT()s that .got and .got.plt sections are empty to linker scripts for gcc and clang. Suggested-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
This commit is contained in:
parent
c1e8537690
commit
7ffc433c2e
|
@ -59,6 +59,16 @@ SECTIONS {
|
||||||
KEEP (*(.hii))
|
KEEP (*(.hii))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.got : {
|
||||||
|
*(.got)
|
||||||
|
}
|
||||||
|
ASSERT(SIZEOF(.got) == 0, "Unexpected GOT entries detected!")
|
||||||
|
|
||||||
|
.got.plt (INFO) : {
|
||||||
|
*(.got.plt)
|
||||||
|
}
|
||||||
|
ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0xc || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT entries detected!")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Retain the GNU build id but in a non-allocatable section so GenFw
|
* Retain the GNU build id but in a non-allocatable section so GenFw
|
||||||
* does not copy it into the PE/COFF image.
|
* does not copy it into the PE/COFF image.
|
||||||
|
|
|
@ -59,6 +59,16 @@ SECTIONS {
|
||||||
KEEP (*(.hii))
|
KEEP (*(.hii))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.got : {
|
||||||
|
*(.got)
|
||||||
|
}
|
||||||
|
ASSERT(SIZEOF(.got) == 0, "Unexpected GOT entries detected!")
|
||||||
|
|
||||||
|
.got.plt (INFO) : {
|
||||||
|
*(.got.plt)
|
||||||
|
}
|
||||||
|
ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0xc || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT entries detected!")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Retain the GNU build id but in a non-allocatable section so GenFw
|
* Retain the GNU build id but in a non-allocatable section so GenFw
|
||||||
* does not copy it into the PE/COFF image.
|
* does not copy it into the PE/COFF image.
|
||||||
|
|
Loading…
Reference in New Issue