summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/scripts
diff options
context:
space:
mode:
authorMichael Brown2006-12-20 21:28:20 +0100
committerMichael Brown2006-12-20 21:28:20 +0100
commit43d976edd03df9321e528624ba61c40bca64a87c (patch)
treedffa040f527aa387b0f4fddb690647147082fba6 /src/arch/i386/scripts
parentReturn -EIO when verification fails, instead of -EINVAL. (diff)
downloadipxe-43d976edd03df9321e528624ba61c40bca64a87c.tar.gz
ipxe-43d976edd03df9321e528624ba61c40bca64a87c.tar.xz
ipxe-43d976edd03df9321e528624ba61c40bca64a87c.zip
Prevent NULL from ever pointing to some real code or data. (This was
causing the serial console to ignore input, because it happened to end up linked with serial_ischar() at address 0, which core/console.c decided was invalid).
Diffstat (limited to 'src/arch/i386/scripts')
-rw-r--r--src/arch/i386/scripts/i386-kir.lds4
-rw-r--r--src/arch/i386/scripts/i386.lds6
2 files changed, 10 insertions, 0 deletions
diff --git a/src/arch/i386/scripts/i386-kir.lds b/src/arch/i386/scripts/i386-kir.lds
index 3095b311..401298c9 100644
--- a/src/arch/i386/scripts/i386-kir.lds
+++ b/src/arch/i386/scripts/i386-kir.lds
@@ -64,6 +64,8 @@ SECTIONS {
. = _text16_link_addr;
_text16 = .;
+ . += 1; /* Prevent NULL being valid */
+
.text16 : AT ( _text16_load_offset + __text16 ) {
__text16 = .;
*(.text.null_trap)
@@ -80,6 +82,8 @@ SECTIONS {
. = _data16_link_addr;
_data16 = .;
+ . += 1; /* Prevent NULL being valid */
+
.rodata16 : AT ( _data16_load_offset + __rodata16 ) {
__rodata16 = .;
*(.rodata16)
diff --git a/src/arch/i386/scripts/i386.lds b/src/arch/i386/scripts/i386.lds
index 30776092..6adb6b99 100644
--- a/src/arch/i386/scripts/i386.lds
+++ b/src/arch/i386/scripts/i386.lds
@@ -65,6 +65,8 @@ SECTIONS {
. = _text16_link_addr;
_text16 = .;
+ . += 1; /* Prevent NULL being valid */
+
.text16 : AT ( _text16_load_offset + __text16 ) {
__text16 = .;
*(.text16)
@@ -78,6 +80,8 @@ SECTIONS {
. = _data16_link_addr;
_data16 = .;
+ . += 1; /* Prevent NULL being valid */
+
.rodata16 : AT ( _data16_load_offset + __rodata16 ) {
__rodata16 = .;
*(.rodata16)
@@ -115,6 +119,8 @@ SECTIONS {
_text = .;
+ . += 1; /* Prevent NULL being valid */
+
.text : AT ( _textdata_load_offset + __text ) {
__text = .;
*(.text.null_trap)