Reduce #ifs by weeding out some cross-chunk function definitions.

Reduce the need for placing #if guards around functions that are
marked as VISIBLE in another code chunk by declaring the functions as
"weak" when they are not needed.

It's still necessary to ensure that no C code references the data from
a different chunk (or an -fwhole-program compile might try to keep a
local reference).
diff --git a/src/apm.c b/src/apm.c
index 479d47c..1b151e9 100644
--- a/src/apm.c
+++ b/src/apm.c
@@ -224,11 +224,9 @@
     handle_1553(regs);
 }
 
-#if MODE16 == 0 && MODESEGMENT == 1
 void VISIBLE32SEG
 handle_apm32(struct bregs *regs)
 {
     debug_enter(regs, DEBUG_HDL_apm);
     handle_1553(regs);
 }
-#endif
diff --git a/src/pcibios.c b/src/pcibios.c
index 2e44c01..a23248b 100644
--- a/src/pcibios.c
+++ b/src/pcibios.c
@@ -202,7 +202,6 @@
  * 32bit interface
  ****************************************************************/
 
-#if MODE16 == 0 && MODESEGMENT == 1
 // Entry point for 32bit pci bios functions.
 void VISIBLE32SEG
 handle_pcibios32(struct bregs *regs)
@@ -210,7 +209,6 @@
     debug_enter(regs, DEBUG_HDL_pcibios32);
     handle_1ab1(regs);
 }
-#endif
 
 struct bios32_s {
     u32 signature;
diff --git a/src/resume.c b/src/resume.c
index 6cdfc69..e9115d0 100644
--- a/src/resume.c
+++ b/src/resume.c
@@ -93,7 +93,6 @@
     panic("Unimplemented shutdown status: %02x\n", status);
 }
 
-#if MODESEGMENT == 0
 void VISIBLE32FLAT
 s3_resume(void)
 {
@@ -123,4 +122,3 @@
     }
     call16big(&br);
 }
-#endif
diff --git a/src/types.h b/src/types.h
index 7b87b86..5da299d 100644
--- a/src/types.h
+++ b/src/types.h
@@ -44,9 +44,9 @@
 // Notes a function as externally visible in the 16bit code chunk.
 # define VISIBLE16 __VISIBLE
 // Notes a function as externally visible in the 32bit flat code chunk.
-# define VISIBLE32FLAT __section(".discard.func32flat." UNIQSEC) noinline
+# define VISIBLE32FLAT __section(".discard.func32flat." UNIQSEC) noinline __weak
 // Notes a function as externally visible in the 32bit segmented code chunk.
-# define VISIBLE32SEG __section(".discard.func32seg." UNIQSEC) noinline
+# define VISIBLE32SEG __section(".discard.func32seg." UNIQSEC) noinline __weak
 // Designate a variable as (only) visible to 16bit code.
 # define VAR16 __section(".data16." UNIQSEC)
 // Designate a variable as visible to 16bit, 32bit, and assembler code.
@@ -68,8 +68,8 @@
 # define ASSERT32SEG() __force_link_error__only_in_32bit_segmented()
 # define ASSERT32FLAT() __force_link_error__only_in_32bit_flat()
 #elif MODESEGMENT == 1
-# define VISIBLE16 __section(".discard.func16." UNIQSEC) noinline
-# define VISIBLE32FLAT __section(".discard.func32flat." UNIQSEC) noinline
+# define VISIBLE16 __section(".discard.func16." UNIQSEC) noinline __weak
+# define VISIBLE32FLAT __section(".discard.func32flat." UNIQSEC) noinline __weak
 # define VISIBLE32SEG __VISIBLE
 # define VAR16 __section(".discard.var16." UNIQSEC)
 # define VAR16VISIBLE VAR16 __VISIBLE __weak
@@ -83,9 +83,9 @@
 # define ASSERT32SEG() do { } while (0)
 # define ASSERT32FLAT() __force_link_error__only_in_32bit_flat()
 #else
-# define VISIBLE16 __section(".discard.func16." UNIQSEC) noinline
+# define VISIBLE16 __section(".discard.func16." UNIQSEC) noinline __weak
 # define VISIBLE32FLAT __VISIBLE
-# define VISIBLE32SEG __section(".discard.func32seg." UNIQSEC) noinline
+# define VISIBLE32SEG __section(".discard.func32seg." UNIQSEC) noinline __weak
 # define VAR16 __section(".discard.var16." UNIQSEC)
 # define VAR16VISIBLE VAR16 __VISIBLE __weak
 # define VAR16EXPORT VAR16VISIBLE