Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ghc/ghc
  • bgamari/ghc
  • syd/ghc
  • ggreif/ghc
  • watashi/ghc
  • RolandSenn/ghc
  • mpickering/ghc
  • DavidEichmann/ghc
  • carter/ghc
  • harpocrates/ghc
  • ethercrow/ghc
  • mijicd/ghc
  • adamse/ghc
  • alexbiehl/ghc
  • gridaphobe/ghc
  • trofi/ghc
  • supersven/ghc
  • ppk/ghc
  • ulysses4ever/ghc
  • AndreasK/ghc
  • ghuntley/ghc
  • shayne-fletcher-da/ghc
  • fgaz/ghc
  • yav/ghc
  • osa1/ghc
  • mbbx6spp/ghc
  • JulianLeviston/ghc
  • reactormonk/ghc
  • rae/ghc
  • takenobu-hs/ghc
  • michalt/ghc
  • andrewthad/ghc
  • hsyl20/ghc
  • scottgw/ghc
  • sjakobi/ghc
  • angerman/ghc
  • RyanGlScott/ghc
  • hvr/ghc
  • howtonotwin/ghc
  • chessai/ghc
  • m-renaud/ghc
  • brprice/ghc
  • stevehartdata/ghc
  • sighingnow/ghc
  • kgardas/ghc
  • ckoparkar/ghc
  • alp/ghc
  • smaeul/ghc
  • kakkun61/ghc
  • sykloid/ghc
  • newhoggy/ghc
  • toonn/ghc
  • nineonine/ghc
  • Phyx/ghc
  • ezyang/ghc
  • tweag/ghc
  • langston/ghc
  • ndmitchell/ghc
  • rockbmb/ghc
  • artempyanykh/ghc
  • mniip/ghc
  • mynguyenbmc/ghc
  • alexfmpe/ghc
  • crockeea/ghc
  • nh2/ghc
  • vaibhavsagar/ghc
  • phadej/ghc
  • Haskell-mouse/ghc
  • lolotp/ghc
  • spacekitteh/ghc
  • michaelpj/ghc
  • mgsloan/ghc
  • HPCohen/ghc
  • tmobile/ghc
  • radrow/ghc
  • simonmar/ghc
  • _deepfire/ghc
  • Ericson2314/ghc
  • leitao/ghc
  • fumieval/ghc
  • trac-isovector/ghc
  • cblp/ghc
  • xich/ghc
  • ciil/ghc
  • erthalion/ghc
  • xldenis/ghc
  • autotaker/ghc
  • haskell-wasm/ghc
  • kcsongor/ghc
  • agander/ghc
  • Baranowski/ghc
  • trac-dredozubov/ghc
  • 23Skidoo/ghc
  • iustin/ghc
  • ningning/ghc
  • josefs/ghc
  • kabuhr/ghc
  • gallais/ghc
  • dten/ghc
  • expipiplus1/ghc
  • Pluralia/ghc
  • rohanjr/ghc
  • intricate/ghc
  • kirelagin/ghc
  • Javran/ghc
  • DanielG/ghc
  • trac-mizunashi_mana/ghc
  • pparkkin/ghc
  • bollu/ghc
  • ntc2/ghc
  • jaspervdj/ghc
  • JoshMeredith/ghc
  • wz1000/ghc
  • zkourouma/ghc
  • code5hot/ghc
  • jdprice/ghc
  • tdammers/ghc
  • J-mie6/ghc
  • trac-lantti/ghc
  • ch1bo/ghc
  • cgohla/ghc
  • lucamolteni/ghc
  • acairncross/ghc
  • amerocu/ghc
  • chreekat/ghc
  • txsmith/ghc
  • trupill/ghc
  • typetetris/ghc
  • sergv/ghc
  • fryguybob/ghc
  • erikd/ghc
  • trac-roland/ghc
  • setupminimal/ghc
  • Friede80/ghc
  • SkyWriter/ghc
  • xplorld/ghc
  • abrar/ghc
  • obsidiansystems/ghc
  • Icelandjack/ghc
  • adinapoli/ghc
  • trac-matthewbauer/ghc
  • heatsink/ghc
  • dwijnand/ghc
  • Cmdv/ghc
  • alinab/ghc
  • pepeiborra/ghc
  • fommil/ghc
  • luochen1990/ghc
  • rlupton20/ghc
  • applePrincess/ghc
  • lehins/ghc
  • ronmrdechai/ghc
  • leeadam/ghc
  • harendra/ghc
  • mightymosquito1991/ghc
  • trac-gershomb/ghc
  • lucajulian/ghc
  • Rizary/ghc
  • VictorCMiraldo/ghc
  • jamesbrock/ghc
  • andrewdmeier/ghc
  • luke/ghc
  • pranaysashank/ghc
  • cocreature/ghc
  • hithroc/ghc
  • obreitwi/ghc
  • slrtbtfs/ghc
  • kaol/ghc
  • yairchu/ghc
  • Mathemagician98/ghc
  • trac-taylorfausak/ghc
  • leungbk/ghc
  • MichaWiedenmann/ghc
  • chris-martin/ghc
  • TDecki/ghc
  • adithyaov/ghc
  • trac-gelisam/ghc
  • Lysxia/ghc
  • complyue/ghc
  • bwignall/ghc
  • sternmull/ghc
  • sonika/ghc
  • leif/ghc
  • broadwaylamb/ghc
  • myszon/ghc
  • danbroooks/ghc
  • Mechachleopteryx/ghc
  • zardyh/ghc
  • trac-vdukhovni/ghc
  • OmarKhaledAbdo/ghc
  • arrowd/ghc
  • Bodigrim/ghc
  • matheus23/ghc
  • cardenaso11/ghc
  • trac-Athas/ghc
  • mb720/ghc
  • DylanZA/ghc
  • liff/ghc
  • typedrat/ghc
  • trac-claude/ghc
  • jbm/ghc
  • Gertjan423/ghc
  • PHO/ghc
  • JKTKops/ghc
  • kockahonza/ghc
  • msakai/ghc
  • Sir4ur0n/ghc
  • barambani/ghc
  • vishnu.c/ghc
  • dcoutts/ghc
  • trac-runeks/ghc
  • trac-MaxGabriel/ghc
  • lexi.lambda/ghc
  • strake/ghc
  • spavikevik/ghc
  • JakobBruenker/ghc
  • rmanne/ghc
  • gdziadkiewicz/ghc
  • ani/ghc
  • iliastsi/ghc
  • smunix/ghc
  • judah/ghc
  • blackgnezdo/ghc
  • emilypi/ghc
  • trac-bpfoley/ghc
  • muesli4/ghc
  • trac-gkaracha/ghc
  • Kleidukos/ghc
  • nek0/ghc
  • TristanCacqueray/ghc
  • dwulive/ghc
  • mbakke/ghc
  • arybczak/ghc
  • Yang123321/ghc
  • maksbotan/ghc
  • QuietMisdreavus/ghc
  • trac-olshanskydr/ghc
  • emekoi/ghc
  • samuela/ghc
  • josephcsible/ghc
  • dramforever/ghc
  • lpsmith/ghc
  • DenisFrezzato/ghc
  • michivi/ghc
  • jneira/ghc
  • jeffhappily/ghc
  • Ivan-Yudin/ghc
  • nakaji-dayo/ghc
  • gdevanla/ghc
  • galen/ghc
  • fendor/ghc
  • yaitskov/ghc
  • rcythr/ghc
  • awpr/ghc
  • jeremyschlatter/ghc
  • Aver1y/ghc
  • mitchellvitez/ghc
  • merijn/ghc
  • tomjaguarpaw1/ghc
  • trac-NoidedSuper/ghc
  • erewok/ghc
  • trac-junji.hashimoto/ghc
  • adamwespiser/ghc
  • bjaress/ghc
  • jhrcek/ghc
  • leonschoorl/ghc
  • lukasz-golebiewski/ghc
  • sheaf/ghc
  • last-g/ghc
  • carassius1014/ghc
  • eschwartz/ghc
  • dwincort/ghc
  • felixwiemuth/ghc
  • TimWSpence/ghc
  • marcusmonteirodesouza/ghc
  • WJWH/ghc
  • vtols/ghc
  • theobat/ghc
  • BinderDavid/ghc
  • ckoparkar0/ghc
  • alexander-kjeldaas/ghc
  • dme2/ghc
  • philderbeast/ghc
  • aaronallen8455/ghc
  • rayshih/ghc
  • benkard/ghc
  • mpardalos/ghc
  • saidelman/ghc
  • leiftw/ghc
  • ca333/ghc
  • bwroga/ghc
  • nmichael44/ghc
  • trac-crobbins/ghc
  • felixonmars/ghc
  • adityagupta1089/ghc
  • hgsipiere/ghc
  • treeowl/ghc
  • alexpeits/ghc
  • CraigFe/ghc
  • dnlkrgr/ghc
  • kerckhove_ts/ghc
  • cptwunderlich/ghc
  • eiais/ghc
  • hahohihu/ghc
  • sanchayan/ghc
  • lemmih/ghc
  • sehqlr/ghc
  • trac-dbeacham/ghc
  • luite/ghc
  • trac-f-a/ghc
  • vados/ghc
  • luntain/ghc
  • fatho/ghc
  • alexbiehl-gc/ghc
  • dcbdan/ghc
  • tvh/ghc
  • liam-ly/ghc
  • timbobbarnes/ghc
  • GovanifY/ghc
  • shanth2600/ghc
  • gliboc/ghc
  • duog/ghc
  • moxonsghost/ghc
  • zander/ghc
  • masaeedu/ghc
  • georgefst/ghc
  • guibou/ghc
  • nicuveo/ghc
  • mdebruijne/ghc
  • stjordanis/ghc
  • emiflake/ghc
  • wygulmage/ghc
  • frasertweedale/ghc
  • coot/ghc
  • aratamizuki/ghc
  • tsandstr/ghc
  • mrBliss/ghc
  • Anton-Latukha/ghc
  • tadfisher/ghc
  • vapourismo/ghc
  • Sorokin-Anton/ghc
  • basile-henry/ghc
  • trac-mightybyte/ghc
  • AbsoluteNikola/ghc
  • cobrien99/ghc
  • songzh/ghc
  • blamario/ghc
  • aj4ayushjain/ghc
  • trac-utdemir/ghc
  • tangcl/ghc
  • hdgarrood/ghc
  • maerwald/ghc
  • arjun/ghc
  • ratherforky/ghc
  • haskieLambda/ghc
  • EmilGedda/ghc
  • Bogicevic/ghc
  • eddiejessup/ghc
  • kozross/ghc
  • AlistairB/ghc
  • 3Rafal/ghc
  • christiaanb/ghc
  • trac-bit/ghc
  • matsumonkie/ghc
  • trac-parsonsmatt/ghc
  • chisui/ghc
  • jaro/ghc
  • trac-kmiyazato/ghc
  • davidsd/ghc
  • Tritlo/ghc
  • I-B-3/ghc
  • lykahb/ghc
  • AriFordsham/ghc
  • turion1/ghc
  • berberman/ghc
  • christiantakle/ghc
  • zyklotomic/ghc
  • trac-ocramz/ghc
  • CSEdd/ghc
  • doyougnu/ghc
  • mmhat/ghc
  • why-not-try-calmer/ghc
  • plutotulp/ghc
  • kjekac/ghc
  • Manvi07/ghc
  • teo/ghc
  • cactus/ghc
  • CarrieMY/ghc
  • abel/ghc
  • yihming/ghc
  • tsakki/ghc
  • jessicah/ghc
  • oliverbunting/ghc
  • meld/ghc
  • friedbrice/ghc
  • Joald/ghc
  • abarbu/ghc
  • DigitalBrains1/ghc
  • sterni/ghc
  • alexDarcy/ghc
  • hexchain/ghc
  • minimario/ghc
  • zliu41/ghc
  • tommd/ghc
  • jazcarate/ghc
  • peterbecich/ghc
  • alirezaghey/ghc
  • solomon/ghc
  • mikael.urankar/ghc
  • davjam/ghc
  • int-index/ghc
  • MorrowM/ghc
  • nrnrnr/ghc
  • Sonfamm/ghc-test-only
  • afzt1/ghc
  • nguyenhaibinh-tpc/ghc
  • trac-lierdakil/ghc
  • MichaWiedenmann1/ghc
  • jmorag/ghc
  • Ziharrk/ghc
  • trac-MitchellSalad/ghc
  • juampe/ghc
  • jwaldmann/ghc
  • snowleopard/ghc
  • juhp/ghc
  • normalcoder/ghc
  • ksqsf/ghc
  • trac-jberryman/ghc
  • roberth/ghc
  • 1ntEgr8/ghc
  • epworth/ghc
  • MrAdityaAlok/ghc
  • JunmingZhao42/ghc
  • jappeace/ghc
  • trac-Gabriel439/ghc
  • alt-romes/ghc
  • HugoPeters1024/ghc
  • 10ne1/ghc-fork
  • agentultra/ghc
  • Garfield1002/ghc
  • ChickenProp/ghc
  • clyring/ghc
  • MaxHearnden/ghc
  • jumper149/ghc
  • vem/ghc
  • ketzacoatl/ghc
  • Rosuavio/ghc
  • jackohughes/ghc
  • p4l1ly/ghc
  • konsumlamm/ghc
  • shlevy/ghc
  • torsten.schmits/ghc
  • andremarianiello/ghc
  • amesgen/ghc
  • googleson78/ghc
  • InfiniteVerma/ghc
  • uhbif19/ghc
  • yiyunliu/ghc
  • raehik/ghc
  • mrkun/ghc
  • telser/ghc
  • 1Jajen1/ghc
  • slotThe/ghc
  • WinstonHartnett/ghc
  • mpilgrem/ghc
  • dreamsmasher/ghc
  • schuelermine/ghc
  • trac-Viwor/ghc
  • undergroundquizscene/ghc
  • evertedsphere/ghc
  • coltenwebb/ghc
  • oberblastmeister/ghc
  • agrue/ghc
  • lf-/ghc
  • zacwood9/ghc
  • steshaw/ghc
  • high-cloud/ghc
  • SkamDart/ghc
  • PiDelport/ghc
  • maoif/ghc
  • RossPaterson/ghc
  • CharlesTaylor7/ghc
  • ribosomerocker/ghc
  • trac-ramirez7/ghc
  • daig/ghc
  • NicolasT/ghc
  • FinleyMcIlwaine/ghc
  • lawtonnichols/ghc
  • jmtd/ghc
  • ozkutuk/ghc
  • wildsebastian/ghc
  • nikshalark/ghc
  • lrzlin/ghc
  • tobias/ghc
  • fw/ghc
  • hawkinsw/ghc
  • type-dance/ghc
  • rui314/ghc
  • ocharles/ghc
  • wavewave/ghc
  • TheKK/ghc
  • nomeata/ghc
  • trac-csabahruska/ghc
  • jonathanjameswatson/ghc
  • L-as/ghc
  • Axman6/ghc
  • barracuda156/ghc
  • trac-jship/ghc
  • jake-87/ghc
  • meooow/ghc
  • rebeccat/ghc
  • hamana55/ghc
  • Enigmage/ghc
  • kokobd/ghc
  • agevelt/ghc
  • gshen42/ghc
  • chrismwendt/ghc
  • MangoIV/ghc
  • teto/ghc
  • Sookr1/ghc
  • trac-thomasjm/ghc
  • barci2/ghc-dev
  • trac-m4dc4p/ghc
  • dixonary/ghc
  • breakerzirconia/ghc
  • alexsio27444/ghc
  • glocq/ghc
  • sourabhxyz/ghc
  • ryantrinkle/ghc
  • Jade/ghc
  • scedfaliako/ghc
  • martijnbastiaan/ghc
  • trac-george.colpitts/ghc
  • ammarbinfaisal/ghc
  • mimi.vx/ghc
  • lortabac/ghc
  • trac-zyla/ghc
  • benbellick/ghc
  • aadaa-fgtaa/ghc
  • jvanbruegge/ghc
  • archbung/ghc
  • gilmi/ghc
  • mfonism/ghc
  • alex-mckenna/ghc
  • Ei30metry/ghc
  • DiegoDiverio/ghc
  • jorgecunhamendes/ghc
  • liesnikov/ghc
  • akrmn/ghc
  • trac-simplifierticks/ghc
  • jacco/ghc
  • rhendric/ghc
  • damhiya/ghc
  • ryndubei/ghc
  • DaveBarton/ghc
  • trac-Profpatsch/ghc
  • GZGavinZhao/ghc
  • ncfavier/ghc
  • jameshaydon/ghc
  • ajccosta/ghc
  • dschrempf/ghc
  • cydparser/ghc
  • LinuxUserGD/ghc
  • elodielander/ghc
  • facundominguez/ghc
  • psilospore/ghc
  • lachrimae/ghc
  • dylan-thinnes/ghc-type-errors-plugin
  • hamishmack/ghc
  • Leary/ghc
  • lzszt/ghc
  • lyokha/ghc
  • trac-glaubitz/ghc
  • Rewbert/ghc
  • andreabedini/ghc
  • Jasagredo/ghc
  • sol/ghc
  • OlegAlexander/ghc
  • trac-sthibaul/ghc
  • avdv/ghc
  • Wendaolee/ghc
  • ur4t/ghc
  • daylily/ghc
  • boltzmannrain/ghc
  • mmzk1526/ghc
  • trac-fizzixnerd/ghc
  • soulomoon/ghc
  • rwmjones/ghc
  • j14i/ghc
  • tracsis/ghc
  • gesh/ghc
  • flip101/ghc
  • eldritch-cookie/ghc
  • LemonjamesD/ghc
  • pgujjula/ghc
  • skeuchel/ghc
  • noteed/ghc
  • gulin.serge/ghc
  • Torrekie/ghc
  • jlwoodwa/ghc
  • ayanamists/ghc
  • husong998/ghc
  • trac-edmundnoble/ghc
  • josephf/ghc
  • contrun/ghc
  • baulig/ghc
  • edsko/ghc
  • mzschr/ghc-issue-24732
  • ulidtko/ghc
  • Arsen/ghc
  • trac-sjoerd_visscher/ghc
  • crumbtoo/ghc
  • L0neGamer/ghc
  • DrewFenwick/ghc
  • benz0li/ghc
  • MaciejWas/ghc
  • jordanrule/ghc
  • trac-qqwy/ghc
  • LiamGoodacre/ghc
  • isomorpheme/ghc
  • trac-danidiaz/ghc
  • Kariim/ghc
  • MTaimoorZaeem/ghc
  • hololeap/ghc
  • ticat-fp/ghc
  • meritamen/ghc
  • criskell/ghc
  • trac-kraai/ghc
  • aergus/ghc
  • jdral/ghc
  • SamB/ghc
  • Tristian/ghc
  • ywgrit/ghc
  • KatsuPatrick/ghc
  • OsePedro/ghc
  • mpscholten/ghc
  • fp/ghc
  • zaquest/ghc
  • fangyi-zhou/ghc
  • augyg/ghc
640 results
Show changes
Commits on Source (4)
  • Ben Gamari's avatar
    rts/m32: Refactor handling of allocator seeding · 3fdad956
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    Previously, in an attempt to reduce fragmentation, each new allocator
    would map a region of M32_MAX_PAGES fresh pages to seed itself. However,
    this ends up being extremely wasteful since it turns out that we often
    use fewer than this.  Consequently, these pages end up getting freed
    which, ends up fragmenting our address space more than than we would
    have if we had naively allocated pages on-demand.
    
    Here we refactor m32 to avoid this waste while achieving the
    fragmentation mitigation previously desired. In particular, we move all
    page allocation into the global m32_alloc_page, which will pull a page
    from the free page pool. If the free page pool is empty we then refill
    it by allocating a region of M32_MAP_PAGES and adding them to the pool.
    
    Furthermore, we do away with the initial seeding entirely. That is, the
    allocator starts with no active pages: pages are rather allocated on an
    as-needed basis.
    
    On the whole this ends up being a pleasingly simple change,
    simultaneously making m32 more efficient, more robust, and simpler.
    
    Fixes #18980.
    3fdad956
  • Ben Gamari's avatar
    rts: Use CHECK instead of assert · ab14de08
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    Use the GHC wrappers instead of <assert.h>.
    ab14de08
  • Ben Gamari's avatar
    rts/linker: Replace some ASSERTs with CHECK · 738bb286
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    In the past some people have confused ASSERT, which is for checking
    internal invariants, which CHECK, which should be used when checking
    things that might fail due to bad input (and therefore should be enabled
    even in the release compiler). Change some of these cases in the linker
    to use CHECK.
    738bb286
  • Ryan Scott's avatar
    Allow deploy:pages job to fail · be04dc9b
    Ryan Scott authored and Marge Bot's avatar Marge Bot committed
    See #18973.
    be04dc9b
......@@ -1237,6 +1237,8 @@ pages:
dependencies:
- doc-tarball
image: ghcci/x86_64-linux-deb9:0.2
# See #18973
allow_failure: true
tags:
- x86_64-linux
script:
......
......@@ -49,7 +49,6 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <fs_rts.h>
#if defined(HAVE_SYS_STAT_H)
......@@ -885,12 +884,11 @@ SymbolAddr* lookupDependentSymbol (SymbolName* lbl, ObjectCode *dependent)
*/
IF_DEBUG(linker, debugBelch("lookupSymbol: looking up %s with dlsym\n",
lbl));
ASSERT(lbl[0] == '_');
CHECK(lbl[0] == '_');
return internal_dlsym(lbl + 1);
# else
ASSERT(false);
return NULL;
# error No OBJFORMAT_* macro set
# endif
} else {
if (dependent) {
......@@ -2112,7 +2110,7 @@ HsInt unloadNativeObj (void *handle)
n_unloaded_objects += 1;
// dynamic objects have no symbols
ASSERT(nc->symbols == NULL);
CHECK(nc->symbols == NULL);
freeOcStablePtrs(nc);
// Remove object code from root set
......
......@@ -416,7 +416,7 @@ ocVerifyImage_ELF ( ObjectCode* oc )
"\nSection header table: start %ld, n_entries %d, ent_size %d\n",
(long)ehdr->e_shoff, shnum, ehdr->e_shentsize ));
ASSERT(ehdr->e_shentsize == sizeof(Elf_Shdr));
CHECK(ehdr->e_shentsize == sizeof(Elf_Shdr));
shdr = (Elf_Shdr*) (ehdrC + ehdr->e_shoff);
......@@ -537,7 +537,7 @@ ocVerifyImage_ELF ( ObjectCode* oc )
#if defined(SHN_XINDEX)
/* See Note [Many ELF Sections] */
if (secno == SHN_XINDEX) {
ASSERT(shndxTable);
CHECK(shndxTable);
secno = shndxTable[j];
}
#endif
......@@ -864,7 +864,7 @@ ocGetNames_ELF ( ObjectCode* oc )
PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE,
-1, 0);
ASSERT(common_mem != NULL);
CHECK(common_mem != NULL);
}
//TODO: we ignore local symbols anyway right? So we can use the
......@@ -893,7 +893,7 @@ ocGetNames_ELF ( ObjectCode* oc )
secno = shndx;
#if defined(SHN_XINDEX)
if (shndx == SHN_XINDEX) {
ASSERT(shndxTable);
CHECK(shndxTable);
secno = shndxTable[j];
}
#endif
......@@ -902,11 +902,11 @@ ocGetNames_ELF ( ObjectCode* oc )
if (shndx == SHN_COMMON) {
isLocal = false;
ASSERT(common_used < common_size);
ASSERT(common_mem);
CHECK(common_used < common_size);
CHECK(common_mem);
symbol->addr = (void*)((uintptr_t)common_mem + common_used);
common_used += symbol->elf_sym->st_size;
ASSERT(common_used <= common_size);
CHECK(common_used <= common_size);
IF_DEBUG(linker,
debugBelch("COMMON symbol, size %ld name %s allocated at %p\n",
......@@ -935,7 +935,7 @@ ocGetNames_ELF ( ObjectCode* oc )
)
) {
/* Section 0 is the undefined section, hence > and not >=. */
ASSERT(secno > 0 && secno < shnum);
CHECK(secno > 0 && secno < shnum);
/*
if (shdr[secno].sh_type == SHT_NOBITS) {
debugBelch(" BSS symbol, size %d off %d name %s\n",
......@@ -945,7 +945,7 @@ ocGetNames_ELF ( ObjectCode* oc )
symbol->addr = (SymbolAddr*)(
(intptr_t) oc->sections[secno].start +
(intptr_t) symbol->elf_sym->st_value);
ASSERT(symbol->addr != 0x0);
CHECK(symbol->addr != 0x0);
if (ELF_ST_BIND(symbol->elf_sym->st_info) == STB_LOCAL) {
isLocal = true;
isWeak = false;
......@@ -962,7 +962,7 @@ ocGetNames_ELF ( ObjectCode* oc )
/* And the decision is ... */
if (symbol->addr != NULL) {
ASSERT(nm != NULL);
CHECK(nm != NULL);
/* Acquire! */
if (!isLocal) {
......@@ -1045,7 +1045,7 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
break;
}
}
ASSERT(stab != NULL);
CHECK(stab != NULL);
targ = (Elf_Word*)oc->sections[target_shndx].start;
IF_DEBUG(linker,debugBelch(
......@@ -1251,7 +1251,7 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
result = ((S + A) | T) - P;
result &= ~1; // Clear thumb indicator bit
ASSERT(isInt(26, result)); /* X in range */
CHECK(isInt(26, result)); /* X in range */
}
// Update the branch target
......@@ -1426,7 +1426,7 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
case COMPAT_R_ARM_GOT_PREL: {
int32_t A = *pP;
void* GOT_S = symbol->got_addr;
ASSERT(GOT_S);
CHECK(GOT_S);
*(uint32_t *)P = (uint32_t) GOT_S + A - P;
break;
}
......@@ -1552,21 +1552,21 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
case R_SPARC_WDISP30:
w1 = *pP & 0xC0000000;
w2 = (Elf_Word)((value - P) >> 2);
ASSERT((w2 & 0xC0000000) == 0);
CHECK((w2 & 0xC0000000) == 0);
w1 |= w2;
*pP = w1;
break;
case R_SPARC_HI22:
w1 = *pP & 0xFFC00000;
w2 = (Elf_Word)(value >> 10);
ASSERT((w2 & 0xFFC00000) == 0);
CHECK((w2 & 0xFFC00000) == 0);
w1 |= w2;
*pP = w1;
break;
case R_SPARC_LO10:
w1 = *pP & ~0x3FF;
w2 = (Elf_Word)(value & 0x3FF);
ASSERT((w2 & ~0x3FF) == 0);
CHECK((w2 & ~0x3FF) == 0);
w1 |= w2;
*pP = w1;
break;
......@@ -1866,13 +1866,13 @@ ocResolve_ELF ( ObjectCode* oc )
Elf_Word secno = symbol->elf_sym->st_shndx;
#if defined(SHN_XINDEX)
if (secno == SHN_XINDEX) {
ASSERT(shndxTable);
CHECK(shndxTable);
secno = shndxTable[i];
}
#endif
ASSERT(symbol->elf_sym->st_name == 0);
ASSERT(symbol->elf_sym->st_value == 0);
ASSERT(0x0 != oc->sections[ secno ].start);
CHECK(symbol->elf_sym->st_name == 0);
CHECK(symbol->elf_sym->st_value == 0);
CHECK(0x0 != oc->sections[ secno ].start);
symbol->addr = oc->sections[ secno ].start;
}
}
......@@ -1946,7 +1946,7 @@ int ocRunInit_ELF( ObjectCode *oc )
init_start = (init_t*)init_startC;
init_end = (init_t*)(init_startC + shdr[i].sh_size);
for (init = init_start; init < init_end; init++) {
ASSERT(0x0 != *init);
CHECK(0x0 != *init);
(*init)(argc, argv, envv);
}
}
......
......@@ -81,6 +81,7 @@ The allocator manages two kinds of allocations:
* small allocations, which are allocated into a set of "nursery" pages
(recorded in m32_allocator_t.pages; the size of the set is <= M32_MAX_PAGES)
* large allocations are those larger than a page and are mapped directly
Each page (or the first page of a large allocation) begins with a m32_page_t
......@@ -126,7 +127,9 @@ code accordingly).
To avoid unnecessary mapping/unmapping we maintain a global list of free pages
(which can grow up to M32_MAX_FREE_PAGE_POOL_SIZE long). Pages on this list
have the usual m32_page_t header and are linked together with
m32_page_t.free_page.next.
m32_page_t.free_page.next. When run out of free pages we allocate a chunk of
M32_MAP_PAGES to both avoid fragmenting our address space and amortize the
runtime cost of the mapping.
The allocator is *not* thread-safe.
......@@ -139,7 +142,12 @@ The allocator is *not* thread-safe.
* M32 ALLOCATOR (see Note [M32 Allocator]
***************************************************************************/
/* How many open pages each allocator will keep around? */
#define M32_MAX_PAGES 32
/* How many pages should we map at once when re-filling the free page pool? */
#define M32_MAP_PAGES 32
/* Upper bound on the number of pages to keep in the free page pool */
#define M32_MAX_FREE_PAGE_POOL_SIZE 64
/**
* Page header
......@@ -204,7 +212,6 @@ struct m32_allocator_t {
*
* We keep a small pool of free pages around to avoid fragmentation.
*/
#define M32_MAX_FREE_PAGE_POOL_SIZE 16
struct m32_page_t *m32_free_page_pool = NULL;
unsigned int m32_free_page_pool_size = 0;
// TODO
......@@ -250,18 +257,33 @@ m32_release_page(struct m32_page_t *page)
static struct m32_page_t *
m32_alloc_page(void)
{
if (m32_free_page_pool_size > 0) {
struct m32_page_t *page = m32_free_page_pool;
m32_free_page_pool = page->free_page.next;
m32_free_page_pool_size --;
return page;
} else {
struct m32_page_t *page = mmapForLinker(getPageSize(), PROT_READ | PROT_WRITE, MAP_ANONYMOUS, -1, 0);
if (page > (struct m32_page_t *) 0xffffffff) {
if (m32_free_page_pool_size == 0) {
/*
* Free page pool is empty; refill it with a new batch of M32_MAP_PAGES
* pages.
*/
const size_t pgsz = getPageSize();
char *chunk = mmapForLinker(pgsz * M32_MAP_PAGES, PROT_READ | PROT_WRITE, MAP_ANONYMOUS, -1, 0);
if (chunk > (char *) 0xffffffff) {
barf("m32_alloc_page: failed to get allocation in lower 32-bits");
}
return page;
#define GET_PAGE(i) ((struct m32_page_t *) (chunk + (i) * pgsz))
for (int i=0; i < M32_MAP_PAGES; i++) {
struct m32_page_t *page = GET_PAGE(i);
page->free_page.next = GET_PAGE(i+1);
}
GET_PAGE(M32_MAP_PAGES-1)->free_page.next = m32_free_page_pool;
m32_free_page_pool = (struct m32_page_t *) chunk;
m32_free_page_pool_size += M32_MAP_PAGES;
#undef GET_PAGE
}
struct m32_page_t *page = m32_free_page_pool;
m32_free_page_pool = page->free_page.next;
m32_free_page_pool_size --;
return page;
}
/**
......@@ -276,19 +298,6 @@ m32_allocator_new(bool executable)
stgMallocBytes(sizeof(m32_allocator), "m32_new_allocator");
memset(alloc, 0, sizeof(struct m32_allocator_t));
alloc->executable = executable;
// Preallocate the initial M32_MAX_PAGES to ensure that they don't
// fragment the memory.
size_t pgsz = getPageSize();
char* bigchunk = mmapForLinker(pgsz * M32_MAX_PAGES, PROT_READ | PROT_WRITE, MAP_ANONYMOUS,-1,0);
if (bigchunk == NULL)
barf("m32_allocator_init: Failed to map");
int i;
for (i=0; i<M32_MAX_PAGES; i++) {
alloc->pages[i] = (struct m32_page_t *) (bigchunk + i*pgsz);
alloc->pages[i]->current_size = sizeof(struct m32_page_t);
}
return alloc;
}
......@@ -350,7 +359,9 @@ m32_allocator_push_filled_list(struct m32_page_t **head, struct m32_page_t *page
void
m32_allocator_flush(m32_allocator *alloc) {
for (int i=0; i<M32_MAX_PAGES; i++) {
if (alloc->pages[i]->current_size == sizeof(struct m32_page_t)) {
if (alloc->pages[i] == NULL) {
continue;
} else if (alloc->pages[i]->current_size == sizeof(struct m32_page_t)) {
// the page is empty, free it
m32_release_page(alloc->pages[i]);
} else {
......
......@@ -252,7 +252,6 @@ resolveImports(
"%s: unknown symbol `%s'", oc->fileName, symbol->name);
return 0;
}
ASSERT(addr);
checkProddableBlock(oc,
((void**)(oc->image + sect->offset)) + i,
......@@ -847,7 +846,7 @@ relocateSection(ObjectCode* oc, int curSection)
IF_DEBUG(linker, debugBelch(" : value = %p\n", (void *)symbol->nlist->n_value));
if ((symbol->nlist->n_type & N_TYPE) == N_SECT) {
ASSERT(symbol->addr != NULL);
CHECK(symbol->addr != NULL);
value = (uint64_t) symbol->addr;
IF_DEBUG(linker, debugBelch("relocateSection, defined external symbol %s, relocated address %p\n",
nm, (void *)value));
......@@ -949,29 +948,29 @@ relocateSection(ObjectCode* oc, int curSection)
{
if((int32_t)(value - baseValue) != (int64_t)(value - baseValue))
{
ASSERT(reloc->r_extern);
CHECK(reloc->r_extern);
value = (uint64_t) &makeSymbolExtra(oc, reloc->r_symbolnum, value)
-> jumpIsland;
}
ASSERT((int32_t)(value - baseValue) == (int64_t)(value - baseValue));
CHECK((int32_t)(value - baseValue) == (int64_t)(value - baseValue));
type = X86_64_RELOC_SIGNED;
}
switch(type)
{
case X86_64_RELOC_UNSIGNED:
ASSERT(!reloc->r_pcrel);
CHECK(!reloc->r_pcrel);
thing += value;
break;
case X86_64_RELOC_SIGNED:
case X86_64_RELOC_SIGNED_1:
case X86_64_RELOC_SIGNED_2:
case X86_64_RELOC_SIGNED_4:
ASSERT(reloc->r_pcrel);
CHECK(reloc->r_pcrel);
thing += value - baseValue;
break;
case X86_64_RELOC_SUBTRACTOR:
ASSERT(!reloc->r_pcrel);
CHECK(!reloc->r_pcrel);
thing -= value;
break;
default:
......
......@@ -1594,7 +1594,7 @@ ocGetNames_PEi386 ( ObjectCode* oc )
barf ("Could not allocate any heap memory from private heap.");
}
ASSERT(section.size == 0 || section.info->virtualSize == 0);
CHECK(section.size == 0 || section.info->virtualSize == 0);
sz = section.size;
if (sz < section.info->virtualSize) sz = section.info->virtualSize;
......@@ -2032,7 +2032,7 @@ ocRunInit_PEi386 ( ObjectCode *oc )
getProgEnvv(&envc, &envv);
Section section = *oc->info->init;
ASSERT(SECTIONKIND_INIT_ARRAY == section.kind);
CHECK(SECTIONKIND_INIT_ARRAY == section.kind);
uint8_t *init_startC = section.start;
init_t *init_start = (init_t*)init_startC;
......
......@@ -136,10 +136,10 @@ verifyGot(ObjectCode * oc) {
for(size_t i=0; i < symTab->n_symbols; i++) {
ElfSymbol * symbol = &symTab->symbols[i];
if(symbol->got_addr) {
ASSERT((void*)(*(void**)symbol->got_addr)
== (void*)symbol->addr);
CHECK((void*)(*(void**)symbol->got_addr)
== (void*)symbol->addr);
}
ASSERT(0 == ((uintptr_t)symbol->addr & 0xffff000000000000));
CHECK(0 == ((uintptr_t)symbol->addr & 0xffff000000000000));
}
}
return EXIT_SUCCESS;
......
......@@ -6,7 +6,6 @@
#include "elf_plt.h"
#include <stdlib.h>
#include <assert.h>
#if defined(aarch64_HOST_ARCH)
......@@ -71,15 +70,15 @@ encodeAddendAarch64(Section * section, Elf_Rel * rel, int64_t addend) {
*(uint64_t*)P = (uint64_t)addend;
break;
case COMPAT_R_AARCH64_ABS32:
assert(isInt64(32, addend));
CHECK(isInt64(32, addend));
case COMPAT_R_AARCH64_PREL32:
assert(isInt64(32, addend));
CHECK(isInt64(32, addend));
*(uint32_t*)P = (uint32_t)addend;
break;
case COMPAT_R_AARCH64_ABS16:
assert(isInt64(16, addend));
CHECK(isInt64(16, addend));
case COMPAT_R_AARCH64_PREL16:
assert(isInt64(16, addend));
CHECK(isInt64(16, addend));
*(uint16_t*)P = (uint16_t)addend;
break;
/* static aarch64 relocations */
......@@ -95,8 +94,8 @@ encodeAddendAarch64(Section * section, Elf_Rel * rel, int64_t addend) {
// imm64 = SignExtend(hi:lo:0x000,64)
// Range is 21 bits + the 12 page relative bits
// known to be 0. -2^32 <= X < 2^32
assert(isInt64(21+12, addend));
assert((addend & 0xfff) == 0); /* page relative */
CHECK(isInt64(21+12, addend));
CHECK((addend & 0xfff) == 0); /* page relative */
*(inst_t *)P = (*(inst_t *)P & 0x9f00001f)
| (inst_t) (((uint64_t) addend << 17) & 0x60000000)
......@@ -106,7 +105,7 @@ encodeAddendAarch64(Section * section, Elf_Rel * rel, int64_t addend) {
/* - control flow relocations */
case COMPAT_R_AARCH64_JUMP26: /* relocate b ... */
case COMPAT_R_AARCH64_CALL26: { /* relocate bl ... */
assert(isInt64(26+2, addend)); /* X in range */
CHECK(isInt64(26+2, addend)); /* X in range */
*(inst_t *)P = (*(inst_t *)P & 0xfc000000) /* keep upper 6 (32-6)
* bits */
| ((uint32_t)(addend >> 2) & 0x03ffffff);
......@@ -114,8 +113,8 @@ encodeAddendAarch64(Section * section, Elf_Rel * rel, int64_t addend) {
}
case COMPAT_R_AARCH64_ADR_GOT_PAGE: {
/* range is -2^32 <= X < 2^32 */
assert(isInt64(21+12, addend)); /* X in range */
assert((addend & 0xfff) == 0); /* page relative */
CHECK(isInt64(21+12, addend)); /* X in range */
CHECK((addend & 0xfff) == 0); /* page relative */
*(inst_t *)P = (*(inst_t *)P & 0x9f00001f)
| (inst_t)(((uint64_t)addend << 17) & 0x60000000) // lo
......@@ -149,10 +148,10 @@ encodeAddendAarch64(Section * section, Elf_Rel * rel, int64_t addend) {
FALLTHROUGH;
case COMPAT_R_AARCH64_LD64_GOT_LO12_NC: {
if(exp_shift == -1) {
assert( (addend & 7) == 0 );
CHECK( (addend & 7) == 0 );
exp_shift = 3;
}
assert((addend & 0xfff) == addend);
CHECK((addend & 0xfff) == addend);
int shift = 0;
if(isLoadStore(P)) {
/* bits 31, 30 encode the size. */
......@@ -161,7 +160,7 @@ encodeAddendAarch64(Section * section, Elf_Rel * rel, int64_t addend) {
shift = 4;
}
}
assert(addend == 0 || exp_shift == shift);
CHECK(addend == 0 || exp_shift == shift);
*(inst_t *)P = (*(inst_t *)P & 0xffc003ff)
| ((inst_t)(addend >> shift << 10) & 0x003ffc00);
break;
......@@ -188,12 +187,12 @@ computeAddend(Section * section, Elf_Rel * rel,
/* Position where something is relocated */
addr_t P = (addr_t)((uint8_t*)section->start + rel->r_offset);
assert(0x0 != P);
assert((uint64_t)section->start <= P);
assert(P <= (uint64_t)section->start + section->size);
CHECK(0x0 != P);
CHECK((uint64_t)section->start <= P);
CHECK(P <= (uint64_t)section->start + section->size);
/* Address of the symbol */
addr_t S = (addr_t) symbol->addr;
assert(0x0 != S);
CHECK(0x0 != S);
/* GOT slot for the symbol */
addr_t GOT_S = (addr_t) symbol->got_addr;
......@@ -243,16 +242,16 @@ computeAddend(Section * section, Elf_Rel * rel,
}
}
assert(0 == (0xffff000000000000 & S));
CHECK(0 == (0xffff000000000000 & S));
V = S + A - P;
assert(isInt64(26+2, V)); /* X in range */
CHECK(isInt64(26+2, V)); /* X in range */
}
return V;
}
case COMPAT_R_AARCH64_LDST128_ABS_LO12_NC: assert(0 == ((S+A) & 0x0f));
case COMPAT_R_AARCH64_LDST64_ABS_LO12_NC: assert(0 == ((S+A) & 0x07));
case COMPAT_R_AARCH64_LDST32_ABS_LO12_NC: assert(0 == ((S+A) & 0x03));
case COMPAT_R_AARCH64_LDST16_ABS_LO12_NC: assert(0 == ((S+A) & 0x01));
case COMPAT_R_AARCH64_LDST128_ABS_LO12_NC: CHECK(0 == ((S+A) & 0x0f));
case COMPAT_R_AARCH64_LDST64_ABS_LO12_NC: CHECK(0 == ((S+A) & 0x07));
case COMPAT_R_AARCH64_LDST32_ABS_LO12_NC: CHECK(0 == ((S+A) & 0x03));
case COMPAT_R_AARCH64_LDST16_ABS_LO12_NC: CHECK(0 == ((S+A) & 0x01));
case COMPAT_R_AARCH64_LDST8_ABS_LO12_NC:
/* type: static, class: aarch64, op: S + A */
return (S + A) & 0xfff;
......@@ -266,12 +265,12 @@ computeAddend(Section * section, Elf_Rel * rel,
// TODO: fix this story proper, so that the transformation
// makes sense without resorting to: everyone else
// does it like this as well.
assert(0x0 != GOT_S);
CHECK(0x0 != GOT_S);
return Page(GOT_S+A) - Page(P);
}
case COMPAT_R_AARCH64_LD64_GOT_LO12_NC: {
// G(GDAT(S+A))
assert(0x0 != GOT_S);
CHECK(0x0 != GOT_S);
return (GOT_S + A) & 0xfff;
}
default:
......@@ -297,7 +296,7 @@ relocateObjectCodeAarch64(ObjectCode * oc) {
relTab->sectionHeader->sh_link,
ELF64_R_SYM((Elf64_Xword)rel->r_info));
assert(0x0 != symbol);
CHECK(0x0 != symbol);
/* decode implicit addend */
int64_t addend = decodeAddendAarch64(targetSection, rel);
......@@ -323,8 +322,8 @@ relocateObjectCodeAarch64(ObjectCode * oc) {
relaTab->sectionHeader->sh_link,
ELF64_R_SYM((Elf64_Xword)rel->r_info));
assert(0x0 != symbol);
assert(0x0 != symbol->addr);
CHECK(0x0 != symbol);
CHECK(0x0 != symbol->addr);
/* take explicit addend */
int64_t addend = rel->r_addend;
......
......@@ -10,7 +10,6 @@
#include "ghcconfig.h"
#include "veh_excn.h"
#include "LinkerInternals.h"
#include <assert.h>
#include <stdbool.h>
#include <dbghelp.h>
#include <shellapi.h>
......@@ -195,7 +194,7 @@ void __register_hs_exception_handler( void )
__hs_handle = AddVectoredContinueHandler(CALL_LAST,
__hs_exception_handler);
// should the handler not be registered this will return a null.
assert(__hs_handle);
CHECK(__hs_handle);
// Register for an exception filter to ensure the continue handler gets
// hit if no one handled the exception.
......