summaryrefslogtreecommitdiff
path: root/rts/linker
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2018-11-02 14:25:27 -0400
committerBen Gamari <ben@smart-cactus.org>2018-11-02 17:13:03 -0400
commit6bb8aaa3b4fcebf8f0de2f81f00dcc20b857c4f5 (patch)
tree09eaa82c607421240ba01ff0b312b804f44bab5e /rts/linker
parent5f81952e230fef1f65ae473e09d44101c489c483 (diff)
downloadhaskell-6bb8aaa3b4fcebf8f0de2f81f00dcc20b857c4f5.tar.gz
rts: Add FALLTHROUGH macro
Instead of using the GCC `/* fallthrough */` syntax we now use the `__attribute__((fallthrough))`, which Phyx says should be more portable than the former. Also adds a missing fallthrough annotation in the MachO linker, fixing #14613. Reviewers: erikd, simonmar Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #14613 Differential Revision: https://phabricator.haskell.org/D5292
Diffstat (limited to 'rts/linker')
-rw-r--r--rts/linker/Elf.c2
-rw-r--r--rts/linker/MachO.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c
index fd24a92630..8df7e54729 100644
--- a/rts/linker/Elf.c
+++ b/rts/linker/Elf.c
@@ -1536,7 +1536,7 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
case R_PPC_PLTREL24:
value -= 0x8000; /* See Note [.LCTOC1 in PPC PIC code] */
- /* fallthrough */
+ FALLTHROUGH;
case R_PPC_REL24:
delta = value - P;
diff --git a/rts/linker/MachO.c b/rts/linker/MachO.c
index 5812e89cda..e28d1730fa 100644
--- a/rts/linker/MachO.c
+++ b/rts/linker/MachO.c
@@ -1530,6 +1530,7 @@ ocGetNames_MachO(ObjectCode* oc)
secArray[i].info->macho_section = section;
secArray[i].info->relocation_info
= (MachORelocationInfo*)(oc->image + section->reloff);
+ FALLTHROUGH;
}
default: {
// just set the pointer to the loaded image.