1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039 |
- /*++
- Copyright (c) 2014 Minoca Corp.
- This file is licensed under the terms of the GNU Lesser General Public
- License version 3. Alternative licensing terms are available. Contact
- info@minocacorp.com for details.
- Module Name:
- elf.h
- Abstract:
- This header contains definitions for the ELF image format.
- Author:
- Evan Green 7-Mar-2014
- --*/
- #ifndef _ELF_H
- #define _ELF_H
- //
- // ------------------------------------------------------------------- Includes
- //
- #include <stdint.h>
- //
- // --------------------------------------------------------------------- Macros
- //
- #define IS_ELF(_ElfHeader) ((_ElfHeader).e_ident[EI_MAG0] == ELFMAG0 && \
- (_ElfHeader).e_ident[EI_MAG1] == ELFMAG1 && \
- (_ElfHeader).e_ident[EI_MAG2] == ELFMAG2 && \
- (_ElfHeader).e_ident[EI_MAG3] == ELFMAG3)
- //
- // Define macros for accessing the fields of r_info.
- //
- #define ELF32_R_SYM(_Info) ((_Info) >> 8)
- #define ELF32_R_TYPE(_Info) ((unsigned char)(_Info))
- #define ELF64_R_SYM(_Info) ((_Info) >> 32)
- #define ELF64_R_TYPE(_Info) ((_Info) & 0xffffffffL)
- //
- // This macro constructs an r_info value from field values.
- //
- #define ELF32_R_INFO(_Symbol, _Type) \
- (((_Symbol) << 8) + (unsigned char)(_Type))
- #define ELF64_R_INFO(_Symbol, _Type) \
- (((_Symbol) << 32) + ((_Type) & 0xffffffffL))
- #define ELF64_R_TYPE_DATA(_Info) (((Elf64_Xword)(_Info) << 32) >> 40)
- #define ELF64_R_TYPE_ID(_Info) (((Elf64_Xword)(_Info) << 56) >> 56)
- #define ELF64_R_TYPE_INFO(_Data, _Type) \
- (((Elf64_Xword)(_Data) << 8) + (Elf64_Xword)(_Type))
- //
- // These macros compose and decompose values for Move.r_info.
- //
- #define ELF32_M_SYM(_Info) ((_Info) >> 8)
- #define ELF32_M_SIZE(_Info) ((unsigned char)(_Info))
- #define ELF32_M_INFO(_Symbol, _Size) (((_Symbol) << 8) + (unsigned char)(_Size))
- #define ELF64_M_SYM(_Info) ((_Info) >> 8)
- #define ELF64_M_SIZE(_Info) ((unsigned char)(_Info))
- #define ELF64_M_INFO(_Symbol, _Size) (((_Symbol) << 8) + (unsigned char)(_Size))
- //
- // Define macros for accessing the fields of st_info.
- //
- #define ELF_ST_BIND(_Info) ((_Info) >> 4)
- #define ELF_ST_TYPE(_Info) ((_Info) & 0xf)
- #define ELF32_ST_BIND(_Info) ELF_ST_BIND(_Info)
- #define ELF32_ST_TYPE(_Info) ELF_ST_TYPE(_Info)
- #define ELF64_ST_BIND(_Info) ELF_ST_BIND(_Info)
- #define ELF64_ST_TYPE(_Info) ELF_ST_TYPE(_Info)
- //
- // This macro constructs an st_info value from its components.
- //
- #define ELF32_ST_INFO(_Bind, _Type) (((_Bind) << 4) + ((_Type) & 0xf))
- #define ELF64_ST_INFO(_Bind, _Type) (((_Bind) << 4) + ((_Type) & 0xf))
- //
- // This macro accesses the visibility field of the st_other member.
- //
- #define ELF32_ST_VISIBILITY(_Other) ((_Other) & 0x3)
- #define ELF64_ST_VISIBILITY(_Other) ((_Other) & 0x3)
- //
- // ---------------------------------------------------------------- Definitions
- //
- //
- // Indexes into the e_ident array.
- //
- //
- // Magic numbers.
- //
- #define EI_MAG0 0
- #define EI_MAG1 1
- #define EI_MAG2 2
- #define EI_MAG3 3
- //
- // Class of machine
- //
- #define EI_CLASS 4
- //
- // Data format
- //
- #define EI_DATA 5
- //
- // ELF format version
- //
- #define EI_VERSION 6
- //
- // Operating system / ABI identification
- //
- #define EI_OSABI 7
- //
- // ABI version
- //
- #define EI_ABIVERSION 8
- //
- // Start of architecture identification
- //
- #define OLD_EI_BRAND 8
- //
- // Start of padding (SVR4 ABI).
- //
- #define EI_PAD 9
- //
- // Size of the e_ident array
- //
- #define EI_NIDENT 16
- //
- // Values for the magic number bytes
- //
- #define ELFMAG0 0x7f
- #define ELFMAG1 'E'
- #define ELFMAG2 'L'
- #define ELFMAG3 'F'
- #define ELFMAG "\177ELF"
- //
- // Size of the ELF magic string
- //
- #define SELFMAG 4
- //
- // Values for e_ident[EI_VERSION] and e_version
- //
- #define EV_NONE 0
- #define EV_CURRENT 1
- //
- // Values for e_ident[EI_CLASS]
- //
- #define ELFCLASSNONE 0
- #define ELFCLASS32 1
- #define ELFCLASS64 2
- //
- // Values for e_ident[EI_DATA]
- //
- //
- // Unknown data format
- //
- #define ELFDATANONE 0
- //
- // Two's complement little-endian
- //
- #define ELFDATA2LSB 1
- //
- // Two's complement big-endian
- //
- #define ELFDATA2MSB 2
- //
- // Values for e_ident[EI_OSABI]
- //
- //
- // UNIX System V ABI
- //
- #define ELFOSABI_NONE 0
- //
- // HP-UX operating system
- //
- #define ELFOSABI_HPUX 1
- //
- // NetBSD
- //
- #define ELFOSABI_NETBSD 2
- //
- // GNU/Linux
- //
- #define ELFOSABI_LINUX 3
- //
- // GNU/Hurd
- //
- #define ELFOSABI_HURD 4
- //
- // 86Open IA32 ABI
- //
- #define ELFOSABI_86OPEN 5
- //
- // Solaris
- //
- #define ELFOSABI_SOLARIS 6
- //
- // AIX
- //
- #define ELFOSABI_AIX 7
- //
- // IRIX
- //
- #define ELFOSABI_IRIX 8
- //
- // FreeBSD
- //
- #define ELFOSABI_FREEBSD 9
- //
- // TRU64 UNIX
- //
- #define ELFOSABI_TRU64 10
- //
- // Novell Modesto
- //
- #define ELFOSABI_MODESTO 11
- //
- // OpenBSD
- //
- #define ELFOSABI_OPENBSD 12
- //
- // Open VMS
- //
- #define ELFOSABI_OPENVMS 13
- //
- // HP Non-Stop Kernel
- //
- #define ELFOSABI_NSK 14
- //
- // ARM
- //
- #define ELFOSABI_ARM 97
- //
- // Standalone (embedded) application.
- //
- #define ELFOSABI_STANDALONE 255
- //
- // Symbol used in old spec
- //
- #define ELFOSABI_SYSV ELFOSABI_NONE
- //
- // Monterey
- //
- #define ELFOSABI_MONTEREY ELFOSABI_AIX
- //
- // Values for e_type
- //
- //
- // Unknown type
- //
- #define ET_NONE 0
- //
- // Relocatable
- //
- #define ET_REL 1
- //
- // Executable
- //
- #define ET_EXEC 2
- //
- // Shared object
- //
- #define ET_DYN 3
- //
- // Core file
- //
- #define ET_CORE 4
- //
- // First operating system specific value
- //
- #define ET_LOOS 0xFE00
- //
- // Last operating system specific value
- //
- #define ET_HIOS 0xFEFF
- //
- // First processor specific value
- //
- #define ET_LOPROC 0xFF00
- //
- // Last processor specific value
- //
- #define ET_HIPROC 0xFFFF
- //
- // Values for e_machine
- //
- //
- // Unknown machine
- //
- #define EM_NONE 0
- //
- // AT&T WE32100
- //
- #define EM_M32 1
- //
- // Sun SPARC
- //
- #define EM_SPARC 2
- //
- // Intel i386
- //
- #define EM_386 3
- //
- // Motorola 68000
- //
- #define EM_68K 4
- //
- // Motorola 88000
- //
- #define EM_88K 5
- //
- // Intel i860
- //
- #define EM_860 7
- //
- // MIPS R3000 Big-Endian
- //
- #define EM_MIPS 8
- //
- // IBM System/370
- //
- #define EM_S370 9
- //
- // MIPS R3000 Little-Endian
- //
- #define EM_MIPS_RS3_LE 10
- //
- // HP PA-RISC
- //
- #define EM_PARISC 15
- //
- // Fujistsu VPP500
- //
- #define EM_VPP500 17
- //
- // SPARC v8plus
- //
- #define EM_SPARC32PLUS 18
- //
- // Intel 80960
- //
- #define EM_960 19
- //
- // PowerPC 32-bit
- //
- #define EM_PPC 20
- //
- // PowerPC 64-bit
- //
- #define EM_PPC64 21
- //
- // IBM System/390
- //
- #define EM_S390 22
- //
- // NEC V800
- //
- #define EM_V800 36
- //
- // Fujitsu FR20
- //
- #define EM_FR20 37
- //
- // TRW RH-32
- //
- #define EM_RH32 38
- //
- // Motorola RCE
- //
- #define EM_RCE 39
- //
- // ARM
- //
- #define EM_ARM 40
- //
- // Hitachi SH
- //
- #define EM_SH 42
- //
- // Sparc v9 64-bit
- //
- #define EM_SPARCV9 43
- //
- // Siemens TriCore embedded processor
- //
- #define EM_TRICORE 44
- //
- // Argonaut RISC Core
- //
- #define EM_ARC 45
- //
- // Hitachi H8/300
- //
- #define EM_H8_300 46
- //
- // Hitachi H8/300H
- //
- #define EM_H8_300H 47
- //
- // Hitachi H8S
- //
- #define EM_H8S 48
- //
- // Hitachi H8/500
- //
- #define EM_H8_500 49
- //
- // Intel IA64
- //
- #define EM_IA_64 50
- //
- // Stanford MIPS-X
- //
- #define EM_MIPS_X 51
- //
- // Motorola ColdFire
- //
- #define EM_COLDFIRE 52
- //
- // Motorola M68HC12
- //
- #define EM_68HC12 53
- //
- // Fujitsu MMA
- //
- #define EM_MMA 54
- //
- // Siemens PCP
- //
- #define EM_PCP 55
- //
- // Sony nCPU
- //
- #define EM_NCPU 56
- //
- // Denso NDR1 microprocessor
- //
- #define EM_NDR1 57
- //
- // Motorola Star*Core processor
- //
- #define EM_STARCORE 58
- //
- // Toyota ME16 processor
- //
- #define EM_ME16 59
- //
- // STMicroelectronics ST100 processor
- //
- #define EM_ST100 60
- //
- // Advanced Logic Corp. TinyJ processor
- //
- #define EM_TINYJ 61
- //
- // AMD x86-64
- //
- #define EM_X86_64 62
- //
- // AMD x86-64 (compat)
- //
- #define EM_AMD64 EM_X86_64
- //
- // ARM 64 bit architecture
- //
- #define EM_AARCH64 183
- //
- // Non-standard or deprecated values
- //
- //
- // Intel i486
- //
- #define EM_486 6
- //
- // MIPS R4000 Big-Endian
- //
- #define EM_MIPS_RS4_BE 10
- //
- // Digital Alpha (standard value)
- //
- #define EM_ALPHA_STD 41
- //
- // Alpha
- //
- #define EM_ALPHA 0x9026
- //
- // Special section indices
- //
- //
- // Undefined, missing, or irrelevant
- //
- #define SHN_UNDEF 0
- //
- // First of the reserved range
- //
- #define SHN_LORESERVE 0xff00
- //
- // First processor specific
- //
- #define SHN_LOPROC 0xff00
- //
- // Last processor specific
- //
- #define SHN_HIPROC 0xff1f
- //
- // First operating system specific
- //
- #define SHN_LOOS 0xff20
- //
- // Last operating system specific
- //
- #define SHN_HIOS 0xff3f
- //
- // Absolute values
- //
- #define SHN_ABS 0xfff1
- //
- // Common data
- //
- #define SHN_COMMON 0xfff2
- //
- // Escape, the index is stored elsewhere
- //
- #define SHN_XINDEX 0xffff
- //
- // Last of the reserved range
- //
- #define SHN_HIRESERVE 0xffff
- //
- // sh_type values
- //
- //
- // Inactive
- //
- #define SHT_NULL 0
- //
- // Program defined information
- //
- #define SHT_PROGBITS 1
- //
- // Symbol table section
- //
- #define SHT_SYMTAB 2
- //
- // String table section
- //
- #define SHT_STRTAB 3
- //
- // Relocation section with addends
- //
- #define SHT_RELA 4
- //
- // Symbol hash table section
- //
- #define SHT_HASH 5
- //
- // Dynamic section
- //
- #define SHT_DYNAMIC 6
- //
- // Note section
- //
- #define SHT_NOTE 7
- //
- // No-space section
- //
- #define SHT_NOBITS 8
- //
- // Relocation section, no addends
- //
- #define SHT_REL 9
- //
- // Reserved, purpose unknown
- //
- #define SHT_SHLIB 10
- //
- // Dynamic symbol table section
- //
- #define SHT_DYNSYM 11
- //
- // Initialization function pointers
- //
- #define SHT_INIT_ARRAY 14
- //
- // Termination function pointers
- //
- #define SHT_FINI_ARRAY 15
- //
- // Pre-initialization function pointers
- //
- #define SHT_PREINIT_ARRAY 16
- //
- // Section group
- //
- #define SHT_GROUP 17
- //
- // Section indices
- //
- #define SHT_SYMTAB_SHNDX 18
- //
- // First of OS specific semantic values
- //
- #define SHT_LOOS 0x60000000
- #define SHT_LOSUNW 0x6ffffff4
- #define SHT_SUNW_dof 0x6ffffff4
- #define SHT_SUNW_cap 0x6ffffff5
- #define SHT_SUNW_SIGNATURE 0x6ffffff6
- #define SHT_SUNW_ANNOTATE 0x6ffffff7
- #define SHT_SUNW_DEBUGSTR 0x6ffffff8
- #define SHT_SUNW_DEBUG 0x6ffffff9
- #define SHT_SUNW_move 0x6ffffffa
- #define SHT_SUNW_COMDAT 0x6ffffffb
- #define SHT_SUNW_syminfo 0x6ffffffc
- #define SHT_SUNW_verdef 0x6ffffffd
- #define SHT_GNU_verdef 0x6ffffffd
- #define SHT_SUNW_verneed 0x6ffffffe
- #define SHT_GNU_verneed 0x6ffffffe
- #define SHT_SUNW_versym 0x6fffffff
- #define SHT_GNU_versym 0x6fffffff
- #define SHT_HISUNW 0x6fffffff
- //
- // Last of OS specific semantic values
- //
- #define SHT_HIOS 0x6fffffff
- //
- // Reserved range for processor
- //
- #define SHT_LOPROC 0x70000000
- //
- // Unwind information
- //
- #define SHT_AMD64_UNWIND 0x70000001
- //
- // Specific section header types
- //
- #define SHT_HIPROC 0x7fffffff
- //
- // Reserved range for applications
- //
- #define SHT_LOUSER 0x80000000
- //
- // Specific indices
- //
- #define SHT_HIUSER 0xffffffff
- //
- // Flags for sh_flags
- //
- //
- // Section contains writable data
- //
- #define SHF_WRITE 0x1
- //
- // Section occupies memory
- //
- #define SHF_ALLOC 0x2
- //
- // Section contains instructions
- //
- #define SHF_EXECINSTR 0x4
- //
- // Section may be merged
- //
- #define SHF_MERGE 0x10
- //
- // Section contains strings
- //
- #define SHF_STRINGS 0x20
- //
- // sh_info holds the section index
- //
- #define SHF_INFO_LINK 0x40
- //
- // Special ordering requirements
- //
- #define SHF_LINK_ORDER 0x80
- //
- // OS-specific processing required
- //
- #define SHF_OS_NONCONFORMING 0x100
- //
- // Member of section grup
- //
- #define SHF_GROUP 0x200
- //
- // Section contains Thread Local Storage data
- //
- #define SHF_TLS 0x400
- //
- // OS-specific semantics
- //
- #define SHF_MASKOS 0x0ff00000
- //
- // Processor-specific semantics
- //
- #define SHF_MASKPROC 0xf0000000
- //
- // Values for p_type
- //
- //
- // Unused entry
- //
- #define PT_NULL 0
- //
- // Loadable segment
- //
- #define PT_LOAD 1
- //
- // Dynamic linking information segment
- //
- #define PT_DYNAMIC 2
- //
- // Pathname of interpreter
- //
- #define PT_INTERP 3
- //
- // Auxiliary information
- //
- #define PT_NOTE 4
- //
- // Reserved (not used)
- //
- #define PT_SHLIB 5
- //
- // Location of the program header
- //
- #define PT_PHDR 6
- //
- // Thread Local Storage segment
- //
- #define PT_TLS 7
- //
- // First OS-specific value
- //
- #define PT_LOOS 0x60000000
- //
- // AMD64 unwind program header
- //
- #define PT_SUNW_UNWIND 0x6464e550
- #define PT_GNU_EH_FRAME 0x6474e550
- #define PT_LOSUNW 0x6ffffffa
- //
- // Sun-specific segment
- //
- #define PT_SUNWBSS 0x6ffffffa
- //
- // Describes the stack segment
- //
- #define PT_SUNWSTACK 0x6ffffffb
- //
- // Private
- //
- #define PT_SUNWDTRACE 0x6ffffffc
- //
- // Hard/soft capabilities segment
- //
- #define PT_SUNWCAP 0x6ffffffd
- #define PT_HISUNW 0x6fffffff
- //
- // Last OS-specific value
- //
- #define PT_HIOS 0x6fffffff
- //
- // Processor-specific types
- //
- #define PT_LOPROC 0x70000000
- #define PT_HIPROC 0x7fffffff
- //
- // Values for p_flags: executable, readable, writable.
- //
- #define PF_X 0x1
- #define PF_W 0x2
- #define PF_R 0x4
- #define PF_MASKOS 0x0ff00000
- #define PF_MASKPROC 0xf0000000
- //
- // Extended program header index
- //
- #define PN_XNUM 0xffff
- //
- // Values for d_tag
- //
- //
- // Terminating entry
- //
- #define DT_NULL 0
- //
- // String table offset of a needed shared library
- //
- #define DT_NEEDED 1
- //
- // Total size in bytes of PLT relocations
- //
- #define DT_PLTRELSZ 2
- //
- // Processor-dependent entries
- //
- #define DT_PLTGOT 3
- //
- // Address of symbol hash table
- //
- #define DT_HASH 4
- //
- // Address of string table
- //
- #define DT_STRTAB 5
- //
- // Address of symbol table
- //
- #define DT_SYMTAB 6
- //
- // Address of ElfNN_Rela relocations
- //
- #define DT_RELA 7
- //
- // Total size of ElfNN_rela relocations
- //
- #define DT_RELASZ 8
- //
- // Size of each ElfNN_Rela relocation entry
- //
- #define DT_RELAENT 9
- //
- // Size of each string table
- //
- #define DT_STRSZ 10
- //
- // Size of each symbol table entry
- //
- #define DT_SYMENT 11
- //
- // Address of initialization function
- //
- #define DT_INIT 12
- //
- // Address of finalization function
- //
- #define DT_FINI 13
- //
- // String table offset of a shared object name
- //
- #define DT_SONAME 14
- //
- // String table offset of a library path
- //
- #define DT_RPATH 15
- //
- // Indicates "symbolic" linking.
- //
- #define DT_SYMBOLIC 16
- //
- // Address of ElfNN_Rel relocations
- //
- #define DT_REL 17
- //
- // Total size of ElfNN_Rel relocations
- //
- #define DT_RELSZ 18
- //
- // Size of each ElfNN_Rel relocation
- //
- #define DT_RELENT 19
- //
- // Type of relocation used for PLT
- //
- #define DT_PLTREL 20
- //
- // Reserved (not used).
- //
- #define DT_DEBUG 21
- //
- // Indicates there may be relocations in non-writable segments
- //
- #define DT_TEXTREL 22
- //
- // Address of PLT relocations
- //
- #define DT_JMPREL 23
- #define DT_BIND_NOW 24
- //
- // Address of the array of pointers to initialization functions
- //
- #define DT_INIT_ARRAY 25
- //
- // Address of the array of pointers to termination functions
- //
- #define DT_FINI_ARRAY 26
- //
- // Size in bytes of the array of initialization functions
- //
- #define DT_INIT_ARRAYSZ 27
- //
- // Size in bytes of the array of termination functions
- //
- #define DT_FINI_ARRAYSZ 28
- //
- // String table offset of a null-terminated library search path string
- //
- #define DT_RUNPATH 29
- //
- // Object specific flag values
- //
- #define DT_FLAGS 30
- #define DT_ENCODING 32
- //
- // Address of the array of pointers to pre-initialization functions
- //
- #define DT_PREINIT_ARRAY 32
- //
- // Size in bytes of the array of pre-initialization functions
- //
- #define DT_PREINIT_ARRAYSZ 33
- //
- // Number of positive tags
- //
- #define DT_MAXPOSTAGS 34
- //
- // First OS-specific value
- //
- #define DT_LOOS 0x6000000d
- //
- // Symbol auxiliary name
- //
- #define DT_SUNW_AUXILIARY 0x6000000d
- //
- // ld.so.1 info (private)
- //
- #define DT_SUNW_RTLDINF 0x6000000e
- //
- // Symbol filter name
- //
- #define DT_SUNW_FILTER 0x6000000f
- //
- // Hardware/software
- //
- #define DT_SUNW_CAP 0x60000010
- //
- // Last OS-specific
- //
- #define DT_HIOS 0x6ffff000
- //
- // DT_* entries which fall between DT_VALRNGHI and DT_VALRNGLO use the
- // Dyn.d_un_d_val fields of the Elf*_Dyn structure.
- //
- #define DT_VALRNGLO 0x6ffffd00
- //
- // ELF checksum
- //
- #define DT_CHECKSUM 0x6ffffdf8
- //
- // PLT padding size
- //
- #define DT_PLTPADSZ 0x6ffffdf9
- //
- // Move table entry size
- //
- #define DT_MOVEENT 0x6ffffdfa
- //
- // Move table size
- //
- #define DT_MOVESZ 0x6ffffdfb
- //
- // Feature holder
- //
- #define DT_FEATURE_1 0x6ffffdfc
- //
- // Flags for DT_* entries.
- //
- #define DT_POSFLAG_1 0x6ffffdfd
- //
- // Syminfo table size (in bytes)
- //
- #define DT_SYMINSZ 0x6ffffdfe
- //
- // Syminfo entry size (in bytes)
- //
- #define DT_SYMINENT 0x6ffffdff
- #define DT_VALRNGHI 0x6ffffdff
- //
- // DT_* entries which fall between DT_ADDRRNGHI and DT_ADDRRNGLO use the
- // Dyn.d_un.d_ptr field of the Elf*_Dyn structure. If any adjustment is made
- // to the ELF object after it has been build, these entries will need to be
- // adjusted.
- //
- #define DT_ADDRRNGLO 0x6ffffe00
- //
- // Configuration information
- //
- #define DT_CONFIG 0x6ffffefa
- //
- // Dependency auditing
- //
- #define DT_DEPAUDIT 0x6ffffefb
- //
- // Object auditing
- //
- #define DT_AUDIT 0x6ffffefc
- //
- // PLT padding (sparcv9)
- //
- #define DT_PLTPAD 0x6ffffefd
- //
- // Move table
- //
- #define DT_MOVETAB 0x6ffffefe
- //
- // Syminfo table
- //
- #define DT_SYMINFO 0x6ffffeff
- #define DT_ADDRRNGHI 0x6ffffeff
- //
- // Address of versym section
- //
- #define DT_VERSYM 0x6ffffff0
- //
- // Number of RELATIVE relocations
- //
- #define DT_RELACOUNT 0x6ffffff9
- #define DT_RELCOUNT 0x6ffffffa
- //
- // State flags. See DF_1_* definitions
- //
- #define DT_FLAGS_1 0x6ffffffb
- //
- // Address of verdef section
- //
- #define DT_VERDEF 0x6ffffffc
- //
- // Number of elements in the verdef section
- //
- #define DT_VERDEFNUM 0x6ffffffd
- //
- // Address of verneed section
- //
- #define DT_VERNEED 0x6ffffffe
- //
- // Number of elements in the verneed section
- //
- #define DT_VERNEEDNUM 0x6fffffff
- //
- // Processor-specific range
- //
- #define DT_LOPROC 0x70000000
- #define DT_DEPRECATED_SPARC_REGISTER 0x7000001
- //
- // Shared library auxiliary name
- //
- #define DT_AUXILIARY 0x7ffffffd
- //
- // Ignored, same as needed
- //
- #define DT_USED 0x7ffffffe
- //
- // Shared library filter name
- //
- #define DT_FILTER 0x7fffffff
- #define DT_HIPROC 0x7fffffff
- //
- // Values for DT_FLAGS
- //
- //
- // Indicates that the object being loaded may make reference to the $ORIGIN
- // substitution string.
- //
- #define DF_ORIGIN 0x0001
- //
- // Indicates "symbolic" linking
- //
- #define DF_SYMBOLIC 0x0002
- //
- // Indicates there may be relocations in non-writable segments
- //
- #define DF_TEXTREL 0x0004
- //
- // Indicates that the dynamic linker should process all relocations for the
- // object containing this entry before transferring control to the program
- //
- #define DF_BIND_NOW 0x0008
- //
- // Indicates that the shared object or executable contains code using a static
- // thread-local storage scheme
- //
- #define DF_STATIC_TLS 0x0010
- //
- // Values for n_type. Used in core files.
- //
- //
- // Process status
- //
- #define NT_PRSTATUS 1
- //
- // Floating point registers
- //
- #define NT_FPREGSET 2
- //
- // Process state info
- //
- #define NT_PRPSINFO 3
- //
- // Symbol Binding, ELFNN_ST_BIND - st_info
- //
- //
- // Local symbol
- //
- #define STB_LOCAL 0
- //
- // Global symbol
- //
- #define STB_GLOBAL 1
- //
- // Global symbol with a lower precedence
- //
- #define STB_WEAK 2
- //
- // OS specific range
- //
- #define STB_LOOS 10
- #define STB_HIOS 12
- //
- // Processor specific range
- //
- #define STB_LOPROC 13
- #define STB_HIPROC 15
- //
- // Symbol type - ELFNN_ST_TYPE - st_info
- //
- //
- // Unspecified type
- //
- #define STT_NOTYPE 0
- //
- // Data object
- //
- #define STT_OBJECT 1
- //
- // Function
- //
- #define STT_FUNC 2
- //
- // Section
- //
- #define STT_SECTION 3
- //
- // Source file
- //
- #define STT_FILE 4
- //
- // Uninitialized common block
- //
- #define STT_COMMON 5
- //
- // Thread local storage object
- //
- #define STT_TLS 6
- #define STT_NUM 7
- //
- // OS-specific range
- //
- #define STT_LOOS 10
- #define STT_HIOS 12
- //
- // Processor-specific range
- //
- #define STT_LOPROC 13
- #define STT_HIPROC 15
- //
- // Symbol visibility - ELFNN_ST_VISIBILITY - st_other
- //
- //
- // Default visibility (see binding)
- //
- #define STV_DEFAULT 0x0
- //
- // Special meaning in relocatable objects
- //
- #define STV_INTERNAL 0x1
- //
- // Not visible
- //
- #define STV_HIDDEN 0x2
- //
- // Visible but not preemptible
- //
- #define STV_PROTECTED 0x3
- //
- // Special symbol table indices - Undefined symbol index
- //
- #define STN_UNDEF 0
- #define VER_DEF_CURRENT 1
- #define VER_DEF_IDX(x) VER_NDX(x)
- #define VER_FLG_BASE 0x01
- #define VER_FLG_WEAK 0x02
- #define VER_NEED_CURRENT 1
- #define VER_NEED_WEAK (1u << 15)
- #define VER_NEED_HIDDEN VER_NDX_HIDDEN
- #define VER_NEED_IDX(x) VER_NDX(x)
- #define VER_NDX_LOCAL 0
- #define VER_NDX_GLOBAL 1
- #define VER_NDX_GIVEN 2
- #define VER_NDX_HIDDEN (1u << 15)
- #define VER_NDX(x) ((x) & ~(1u << 15))
- #define CA_SUNW_NULL 0
- //
- // First hardware capabilities array
- //
- #define CA_SUNW_HW_1 1
- //
- // First software capabilities array
- //
- #define CA_SUNW_SF_1 2
- //
- // Syminfo flag values
- //
- //
- // The symbol reference has direc association with an object containing a
- // definition.
- //
- #define SYMINFO_FLG_DIRECT 0x0001
- //
- // Ignored, see SYMINFO_FLG_FILTER
- //
- #define SYMINFO_FLG_PASSTHRU 0x0002
- //
- // The symbol is a copy-reloc
- //
- #define SYMINFO_FLG_COPY 0x0004
- //
- // The object containing definition should be lazily loaded.
- //
- #define SYMINFO_FLG_LAZYLOAD 0x0008
- //
- // The reference should be found directly to the object containing the
- // definition.
- //
- #define SYMINFO_FLG_DIRECTBIND 0x0010
- //
- // Don't let an external reference directly bind to this symbol.
- //
- #define SYMINFO_FLG_NOEXTDIRECT 0x0020
- //
- // The symbol reference is associated to a standard or auxiliary filter.
- //
- #define SYMINFO_FLG_FILTER 0x0002
- #define SYMINFO_FLG_AUXILIARY 0x0040
- //
- // Syminfo.si_boundto values
- //
- //
- // The symbol is bound to itself.
- //
- #define SYMINFO_BT_SELF 0xffff
- //
- // The symbol is bound to its parent.
- //
- #define SYMINFO_BT_PARENT 0xfffe
- //
- // The symbol has no special symbol binding
- //
- #define SYMINFO_BT_NONE 0xfffd
- //
- // The symbol is defined as external
- //
- #define SYMINFO_BT_EXTERN 0xfffc
- //
- // Reserved entries
- //
- #define SYMINFO_BT_LOWRESERVE 0xff00
- //
- // Syminfo version values
- //
- #define SYMINFO_NONE 0
- #define SYMINFO_CURRENT 1
- #define SYMINFO_NUM 2
- //
- // Relocation types
- // All machine architectures are defined here to allow tools on one to handle
- // others.
- //
- //
- // No relocation
- //
- #define R_386_NONE 0
- //
- // Add symbol value
- //
- #define R_386_32 1
- //
- // Add PC-relative symbol value
- //
- #define R_386_PC32 2
- //
- // Add PC-relative GOT offset
- //
- #define R_386_GOT32 3
- //
- // Add PC-relative PLT offset
- //
- #define R_386_PLT32 4
- //
- // Copy data from the shared object
- //
- #define R_386_COPY 5
- //
- // Set GOT entry to data address
- //
- #define R_386_GLOB_DAT 6
- //
- // Set GOT entry to code address
- //
- #define R_386_JMP_SLOT 7
- //
- // Add load address of shared object
- //
- #define R_386_RELATIVE 8
- //
- // Add GOT-relative symbol address
- //
- #define R_386_GOTOFF 9
- //
- // Add PC-relative GOT table address
- //
- #define R_386_GOTPC 10
- //
- // Negative offset in static TLS block
- //
- #define R_386_TLS_TPOFF 14
- //
- // Absolute address of GOT for -ve static TLS
- //
- #define R_386_TLS_IE 15
- //
- // GOT entry for negative static TLS block
- //
- #define R_386_TLS_GOTIE 16
- //
- // Negative offset relative to static TLD
- //
- #define R_386_TLS_LE 17
- //
- // 32-bit offset to GOT (index, offset) pair
- //
- #define R_386_TLS_GD 18
- //
- // 32-bit offset to GOT (index, zero) pair
- //
- #define R_386_TLS_LDM 19
- //
- // 32-bit offset to GOT (index, offset) pair
- //
- #define R_386_TLS_GD_32 24
- //
- // Pushl instruction for Sun ABI GD sequence
- //
- #define R_386_TLS_GD_PUSH 25
- //
- // Call instruction for Sun ABI GD sequence
- //
- #define R_386_TLS_GD_CALL 26
- //
- // Popl instruction for Sun ABI GD sequence
- //
- #define R_386_TLS_GD_POP 27
- //
- // 32-bit offset to GOT (index, zero) pair
- //
- #define R_386_TLS_LDM_32 28
- //
- // Pushl instruction for Sun ABI LD sequence
- //
- #define R_386_TLS_LDM_PUSH 29
- //
- // Call instruction for Sun ABI LD sequence
- //
- #define R_386_TLS_LDM_CALL 30
- //
- // Popl instruction for Sun ABI LD sequence
- //
- #define R_386_TLS_LDM_POP 31
- //
- // 32-bit offset from start of TLS block
- //
- #define R_386_TLS_LDO_32 32
- //
- // 32-bit offset to GOT static TLS offset entry
- //
- #define R_386_TLS_IE_32 33
- //
- // 32-bit offset within static TLS block
- //
- #define R_386_TLS_LE_32 34
- //
- // GOT entry containing TLS index
- //
- #define R_386_TLS_DTPMOD32 35
- //
- // GOT entry containing TLS offset
- //
- #define R_386_TLS_DTPOFF32 36
- //
- // GOT entry of -ve static TLS offset
- //
- #define R_386_TLS_TPOFF32 37
- //
- // AArch64 relocations
- //
- //
- // No relocation
- //
- #define R_AARCH64_NONE 256
- //
- // Static AArch64 relocations
- //
- //
- // S + A
- //
- #define R_AARCH64_ABS64 257
- #define R_AARCH64_ABS32 258
- #define R_AARCH64_ABS16 259
- //
- // S + A - P
- //
- #define R_AARCH64_PREL64 260
- #define R_AARCH64_PREL32 261
- #define R_AARCH64_PREL16 262
- //
- // Group relocations to create a 16, 32, 48, or 64 bit unsigned ata value
- // or address inline.
- // S + A
- //
- #define R_AARCH64_MOVW_UABS_G0 263
- #define R_AARCH64_MOVW_UABS_G0_NC 264
- #define R_AARCH64_MOVW_UABS_G1 265
- #define R_AARCH64_MOVW_UABS_G1_NC 266
- #define R_AARCH64_MOVW_UABS_G2 267
- #define R_AARCH64_MOVW_UABS_G2_NC 268
- #define R_AARCH64_MOVW_UABS_G3 269
- //
- // Group relocations to create a 16, 32, 48, or 64 bit signed ata or offset
- // value inline.
- // S + A
- //
- #define R_AARCH64_MOVW_SABS_G0 270
- #define R_AARCH64_MOVW_SABS_G1 271
- #define R_AARCH64_MOVW_SABS_G2 272
- //
- // Relocations to generate 19, 21, and 33 bit PC-relative addresses
- // S + A - P
- //
- #define R_AARCH64_LD_PREL_LO19 273
- #define R_AARCH64_ADR_PREL_LO21 274
- //
- // Page(S + A) - Page(P)
- //
- #define R_AARCH64_ADR_PREL_PG_HI21 275
- #define R_AARCH64_ADR_PREL_PG_HI21_NC 276
- //
- // S + A
- //
- #define R_AARCH64_ADD_ABS_LO12_NC 277
- #define R_AARCH64_LDST8_ABS_LO12_NC 278
- #define R_AARCH64_LDST16_ABS_LO12_NC 284
- #define R_AARCH64_LDST32_ABS_LO12_NC 285
- #define R_AARCH64_LDST64_ABS_LO12_NC 286
- #define R_AARCH64_LDST128_ABS_LO12_NC 299
- //
- // Relocations for control-flow instructions. All offsets are a multiple of 4.
- // S + A - P
- #define R_AARCH64_TSTBR14 279
- #define R_AARCH64_CONDBR19 280
- #define R_AARCH64_JUMP26 282
- #define R_AARCH64_CALL26 283
- //
- // Group relocations to create a 16, 32, 48, or 64-bit PC-relative offset
- // inline
- // S + A - P
- //
- #define R_AARCH64_MOVW_PREL_G0 287
- #define R_AARCH64_MOVW_PREL_G0_NC 288
- #define R_AARCH64_MOVW_PREL_G1 289
- #define R_AARCH64_MOVW_PREL_G1_NC 290
- #define R_AARCH64_MOVW_PREL_G2 291
- #define R_AARCH64_MOVW_PREL_G2_NC 292
- #define R_AARCH64_MOVW_PREL_G3 293
- //
- // Group relocations to create a 16, 32, 48, or 64 bit GOT-relative offset
- // inline.
- // G(S) - GOT
- //
- #define R_AARCH64_MOVW_GOTOFF_G0 300
- #define R_AARCH64_MOVW_GOTOFF_G0_NC 301
- #define R_AARCH64_MOVW_GOTOFF_G1 302
- #define R_AARCH64_MOVW_GOTOFF_G1_NC 303
- #define R_AARCH64_MOVW_GOTOFF_G2 304
- #define R_AARCH64_MOVW_GOTOFF_G2_NC 305
- #define R_AARCH64_MOVW_GOTOFF_G3 306
- //
- // GOT-relative data relocations
- // S + A - GOT
- //
- #define R_AARCH64_GOTREL64 307
- #define R_AARCH64_GOTREL32 308
- //
- // GOT-relative instruction relocations
- //
- //
- // G(S) - P
- //
- #define R_AARCH64_GOT_LD_PREL19 309
- //
- // G(S) - GOT
- //
- #define R_AARCH64_LD64_GOTOFF_LO15 310
- //
- // Page(G(S)) - Page(P)
- //
- #define R_AARCH64_ADR_GOT_PAGE 311
- //
- // G(S)
- //
- #define R_AARCH64_LD64_GOT_LO12_NC 312
- //
- // G(S) - Page(GOT)
- //
- #define R_AARCH64_LD64_GOTPAGE_LO15 313
- //
- // Relocations for thread-local storage. General dynamic TLS relocations
- //
- //
- // G(TLSIDX(S + A)) - P
- //
- #define R_AARCH64_TLSGD_ADR_PREL21 512
- //
- // Page(G(TLSIDX(S + A))) - Page(P)
- //
- #define R_AARCH64_TLSGD_ADR_PAGE21 513
- //
- // G(TLSIDX(S + A)
- //
- #define R_AARCH64_TLSGD_ADD_LO12_NC 514
- //
- // G(TLSIDX(S + A)) - GOT
- //
- #define R_AARCH64_TLSGD_MOVW_G1 515
- #define R_AARCH64_TLSGD_MOVW_G0_NC 516
- //
- // Local Dynamic TLS relocations
- //
- //
- // G(LDM(S))) - P
- //
- #define R_AARCH64_TLSLD_ADR_PREL21 517
- //
- // Page(G(LDM(S))) - Page(P)
- //
- #define R_AARCH64_TLSLD_ADR_PAGE21 518
- //
- // G(LDM(S))
- //
- #define R_AARCH64_TLSLD_ADD_LO12_NC 519
- //
- // G(LDM(S)) - GOT
- //
- #define R_AARCH64_TLSLD_MOVW_G1 520
- #define R_AARCH64_TLSLD_MOVW_G0_NC 521
- //
- // G(LDM(S)) - P
- //
- #define R_AARCH64_TLSLD_LD_PREL19 522
- //
- // DTPREL(S + A)
- //
- #define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523
- #define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524
- #define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525
- #define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526
- #define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527
- #define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528
- #define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529
- #define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530
- #define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531
- #define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532
- #define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533
- #define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534
- #define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535
- #define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536
- #define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537
- #define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538
- //
- // Initial Exec TLS relocations
- // G(TPREL(S + A)) - GOT
- //
- #define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539
- #define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540
- //
- // Page(G(TPREL(S + A))) - Page(P)
- //
- #define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541
- //
- // G(TPREL(S + A))
- //
- #define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542
- //
- // G(TPREL(S + A)) - P
- //
- #define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543
- //
- // Local Exec TLS relocations
- // TPREL(S + A)
- //
- #define R_AARCH64_TLSLE_MOVW_TPREL_G2 544
- #define R_AARCH64_TLSLE_MOVW_TPREL_G1 545
- #define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546
- #define R_AARCH64_TLSLE_MOVW_TPREL_G0 547
- #define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548
- #define R_AARCH64_TLSLE_ADD_TPREL_HI12 549
- #define R_AARCH64_TLSLE_ADD_TPREL_LO12 550
- #define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551
- #define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552
- #define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553
- #define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554
- #define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555
- #define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556
- #define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557
- #define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558
- #define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559
- //
- // Dynamic relocations
- //
- #define R_AARCH64_COPY 1024
- //
- // S + A
- //
- #define R_AARCH64_GLOB_DAT 1025
- #define R_AARCH64_JUMP_SLOT 1026
- //
- // Delta(S) + A, Delta(P) + A
- //
- #define R_AARCH64_RELATIVE 1027
- //
- // DTPREL(S + A)
- //
- #define R_AARCH64_TLS_DTPREL64 1028
- //
- // LDM(S)
- //
- #define R_AARCH64_TLS_DTPMOD64 1029
- //
- // TPREL(S + A)
- //
- #define R_AARCH64_TLS_TPREL64 1030
- //
- // DTPREL(S + A)
- //
- #define R_AARCH64_TLS_DTPREL32 1031
- //
- // LDM(S)
- //
- #define R_AARCH64_TLS_DTPMOD32 1032
- //
- // DTPREL(S + A)
- //
- #define R_AARCH64_TLS_TPREL32 1033
- //
- // Alpha relocations
- //
- //
- // No relocation
- //
- #define R_ALPHA_NONE 0
- //
- // Direct 32-bit
- //
- #define R_ALPHA_REFLONG 1
- //
- // Direct 64-bit
- //
- #define R_ALPHA_REFQUAD 2
- //
- // GP relative 32-bit
- //
- #define R_ALPHA_GPREL32 3
- //
- // GP relative 16-bit with optimization
- //
- #define R_ALPHA_LITERAL 4
- //
- // Optimization hint for literal
- //
- #define R_ALPHA_LITUSE 5
- //
- // Add displacement to GP
- //
- #define R_ALPHA_GPDISP 6
- //
- // PC + 4 relative 23-bit shifted
- //
- #define R_ALPHA_BRADDR 7
- //
- // PC + 4 relative 16-bit shifted
- //
- #define R_ALPHA_HINT 8
- //
- // PC relateive 16 bit
- //
- #define R_ALPHA_SREL16 9
- //
- // PC relative 32-bit
- //
- #define R_ALPHA_SREL32 10
- //
- // PC relative 64-bit
- //
- #define R_ALPHA_SREL64 11
- //
- // OP stack push
- //
- #define R_ALPHA_OP_PUSH 12
- //
- // OP stack pop and store
- //
- #define R_ALPHA_OP_STORE 13
- //
- // OP stack add
- //
- #define R_ALPHA_OP_PSUB 14
- //
- // OP stack right shift
- //
- #define R_ALPHA_OP_PRSHIFT 15
- #define R_ALPHA_GPVALUE 16
- #define R_ALPHA_GPRELHIGH 17
- #define R_ALPHA_GPRELLOW 18
- #define R_ALPHA_IMMED_GP_16 19
- #define R_ALPHA_IMMED_GP_HI32 20
- #define R_ALPHA_IMMED_SCN_HI32 21
- #define R_ALPHA_IMMED_BR_HI32 22
- #define R_ALPHA_IMMED_LO32 23
- //
- // Copy symbol at runtime
- //
- #define R_ALPHA_COPY 24
- //
- // Create GOT entry
- //
- #define R_ALPHA_GLOB_DAT 25
- //
- // Create PLT entry
- //
- #define R_ALPHA_JMP_SLOT 26
- //
- // Adjust by program base
- //
- #define R_ALPHA_RELATIVE 27
- //
- // ARM relocations
- //
- #define R_ARM_NONE 0
- #define R_ARM_PC24 1
- #define R_ARM_ABS32 2
- #define R_ARM_REL32 3
- #define R_ARM_PC13 4
- #define R_ARM_ABS16 5
- #define R_ARM_ABS12 6
- #define R_ARM_THM_ABS5 7
- #define R_ARM_ABS8 8
- #define R_ARM_SBREL32 9
- #define R_ARM_THM_PC22 10
- #define R_ARM_THM_PC8 11
- #define R_ARM_AMP_VCALL9 12
- #define R_ARM_SWI24 13
- #define R_ARM_THM_SWI8 14
- #define R_ARM_XPC25 15
- #define R_ARM_THM_XPC22 16
- #define R_ARM_BASE_PREL 25
- #define R_ARM_GOT_BREL 26
- //
- // Copy data from shared object
- //
- #define R_ARM_COPY 20
- //
- // Set GOT entry to data address
- //
- #define R_ARM_GLOB_DAT 21
- //
- // Set GOT entry to code address
- //
- #define R_ARM_JUMP_SLOT 22
- //
- // Add load address of shared object
- //
- #define R_ARM_RELATIVE 23
- //
- // Add GOT-relative symbol address
- //
- #define R_ARM_GOTOFF 24
- //
- // Add PC-relative GOT table address
- //
- #define R_ARM_GOTPC 25
- //
- // Add PC-relative GOT offset
- //
- #define R_ARM_GOT32 26
- //
- // Add PC-relative PLT offset
- //
- #define R_ARM_PLT32 27
- #define R_ARM_CALL 28
- #define R_ARM_JMP24 29
- #define R_ARM_THM_MOVW_ABS_NC 47
- #define R_ARM_THM_MOVT_ABS 48
- //
- // This block of PC-relative relocations was added to work around GCC putting
- // object relocations in static executables.
- //
- #define R_ARM_THM_JUMP24 30
- #define R_ARM_PREL31 42
- #define R_ARM_MOVW_PREL_NC 45
- #define R_ARM_MOVT_PREL 46
- #define R_ARM_THM_MOVW_PREL_NC 49
- #define R_ARM_THM_MOVT_PREL 50
- #define R_ARM_THM_JMP6 52
- #define R_ARM_THM_ALU_PREL_11_0 53
- #define R_ARM_THM_PC12 54
- #define R_ARM_REL32_NOI 56
- #define R_ARM_ALU_PC_G0_NC 57
- #define R_ARM_ALU_PC_G0 58
- #define R_ARM_ALU_PC_G1_NC 59
- #define R_ARM_ALU_PC_G1 60
- #define R_ARM_ALU_PC_G2 61
- #define R_ARM_LDR_PC_G1 62
- #define R_ARM_LDR_PC_G2 63
- #define R_ARM_LDRS_PC_G0 64
- #define R_ARM_LDRS_PC_G1 65
- #define R_ARM_LDRS_PC_G2 66
- #define R_ARM_LDC_PC_G0 67
- #define R_ARM_LDC_PC_G1 68
- #define R_ARM_LDC_PC_G2 69
- #define R_ARM_GOT_PREL 96
- #define R_ARM_THM_JUMP11 102
- #define R_ARM_THM_JUMP8 103
- #define R_ARM_TLS_GD32 104
- #define R_ARM_TLS_LDM32 105
- #define R_ARM_TLS_IE32 107
- #define R_ARM_THM_JUMP19 51
- #define R_ARM_GNU_VTENTRY 100
- #define R_ARM_GNU_VTINHERIT 101
- #define R_ARM_RSBREL32 250
- #define R_ARM_THM_RPC22 251
- #define R_ARM_RREL32 252
- #define R_ARM_RABS32 253
- #define R_ARM_RPC24 254
- #define R_ARM_RBASE 255
- //
- // IA-64 relocations
- //
- #define R_IA_64_NONE 0
- //
- // Immediate14 S + A
- //
- #define R_IA_64_IMM14 0x21
- //
- // Immediate22 S + A
- //
- #define R_IA_64_IMM22 0x22
- //
- // Immediate64 S + A
- //
- #define R_IA_64_IMM64 0x23
- //
- // Word32 MSB S + A
- //
- #define R_IA_64_DIR32MSB 0x24
- //
- // Word32 LSB S + A
- //
- #define R_IA_64_DIR32LSB 0x25
- //
- // Word64 MSB S + A
- //
- #define R_IA_64_DIR64MSB 0x26
- //
- // Word64 LSB S + A
- //
- #define R_IA_64_DIR64LSB 0x27
- //
- // Immediate22 @gprel(S + A)
- //
- #define R_IA_64_GPREL22 0x2a
- //
- // Immediate64 @gprel(S + A)
- //
- #define R_IA_64_GPREL64I 0x2b
- //
- // Word32 MSB @gprel(S + A)
- //
- #define R_IA_64_GPREL32MSB 0x2c
- //
- // Word32 LSB @gprel(S + A)
- //
- #define R_IA_64_GPREL32LSB 0x2d
- //
- // Word64 MSB @gprel(S + A)
- //
- #define R_IA_64_GPREL64MSB 0x2e
- //
- // Word64 LSB @gprel(S + A)
- //
- #define R_IA_64_GPREL64LSB 0x2f
- //
- // Immediate22 @ltoff(S + A)
- //
- #define R_IA_64_LTOFF22 0x32
- //
- // Immediate64 @ltoff (S + A)
- //
- #define R_IA_64_LTOFF64I 0x33
- //
- // Immediate22 @pltoff(S + A)
- //
- #define R_IA_64_PLTOFF22 0x3a
- //
- // Immediate64 @pltoff(S + A)
- //
- #define R_IA_64_PLTOFF64I 0x3b
- //
- // Word64 MSB @pltoff(S + A)
- //
- #define R_IA_64_PLTOFF64MSB 0x3e
- //
- // Word64 LSB @pltoff(S + A)
- //
- #define R_IA_64_PLTOFF64LSB 0x3f
- //
- // Immediate64 @fptr(S + A)
- //
- #define R_IA_64_FPTR64I 0x43
- //
- // Word32 MSB @fptr(S + A)
- //
- #define R_IA_64_FPTR32MSB 0x44
- //
- // Word32 LSB @fptr(S + A)
- //
- #define R_IA_64_FPTR32LSB 0x45
- //
- // Word64 MSB @fptr(S + A)
- //
- #define R_IA_64_FPTR64MSB 0x46
- //
- // Word64 LSB @fptr(S + A)
- //
- #define R_IA_64_FPTR64LSB 0x47
- //
- // Immediate60 form1 S + A - P
- //
- #define R_IA_64_PCREL60B 0x48
- //
- // Immediate21 forms 1, 2, and 3 S + A - P
- //
- #define R_IA_64_PCREL21B 0x49
- #define R_IA_64_PCREL21M 0x4a
- #define R_IA_64_PCREL21F 0x4b
- //
- // Word32/64 MSB and LSB: S + A - P
- //
- #define R_IA_64_PCREL32MSB 0x4c
- #define R_IA_64_PCREL32LSB 0x4d
- #define R_IA_64_PCREL64MSB 0x4e
- #define R_IA_64_PCREL64LSB 0x4f
- //
- // Immediate22/64 @ltoff(@fptr(S + A))
- //
- #define R_IA_64_LTOFF_FPTR22 0x52
- #define R_IA_64_LTOFF_FPTR64I 0x53
- //
- // Word32/64 MSB and LSB: @ltoff(@fptr(S + A))
- //
- #define R_IA_64_LTOFF_FPTR32MSB 0x54
- #define R_IA_64_LTOFF_FPTR32LSB 0x55
- #define R_IA_64_LTOFF_FPTR64MSB 0x56
- #define R_IA_64_LTOFF_FPTR64LSB 0x57
- //
- // Word32/64 MSB/LSB: @segrel(S + A)
- //
- #define R_IA_64_SEGREL32MSB 0x5c
- #define R_IA_64_SEGREL32LSB 0x5d
- #define R_IA_64_SEGREL64MSB 0x5e
- #define R_IA_64_SEGREL64LSB 0x5f
- //
- // Word32/64 MSB/LSB @secrel(S + A)
- //
- #define R_IA_64_SECREL32MSB 0x64
- #define R_IA_64_SECREL32LSB 0x65
- #define R_IA_64_SECREL64MSB 0x66
- #define R_IA_64_SECREL64LSB 0x67
- //
- // Word32/64 MSB/LSB: BD + A
- //
- #define R_IA_64_REL32MSB 0x6c
- #define R_IA_64_REL32LSB 0x6d
- #define R_IA_64_REL64MSB 0x6e
- #define R_IA_64_REL64LSB 0x6f
- //
- // Word32/64 MSB/LSB: S + A
- //
- #define R_IA_64_LTV32MSB 0x74
- #define R_IA_64_LTV32LSB 0x75
- #define R_IA_64_LTV64MSB 0x76
- #define R_IA_64_LTV64LSB 0x77
- //
- // Immediate21 form1 S + A - P
- //
- #define R_IA_64_PCREL21BI 0x79
- //
- // Immediate22/64: S + A - P
- //
- #define R_IA_64_PCREL22 0x7a
- #define R_IA_64_PCREL64I 0x7b
- //
- // Function descriptor MSB/LSB special
- //
- #define R_IA_64_IPLTMSB 0x80
- #define R_IA_64_IPLTLSB 0x81
- //
- // Immediate64: A - S
- //
- #define R_IA_64_SUB 0x85
- //
- // Immediate22 special
- //
- #define R_IA_64_LTOFF22X 0x86
- #define R_IA_64_LDXMOV 0x87
- //
- // Immediate14/22/64 @tprel(S + A)
- //
- #define R_IA_64_TPREL14 0x91
- #define R_IA_64_TPREL22 0x92
- #define R_IA_64_TPREL64I 0x93
- //
- // Word64 MSB/LSB @tprel(S + A)
- //
- #define R_IA_64_TPREL64MSB 0x96
- #define R_IA_64_TPREL64LSB 0x97
- //
- // Immediate22 @ltoff(@tprel(S + A))
- //
- #define R_IA_64_LTOFF_TPREL22 0x9a
- //
- // Word64 MSB/LSB @dtpmod(S + A)
- //
- #define R_IA_64_DTPMOD64MSB 0xa6
- #define R_IA_64_DTPMOD64LSB 0xa7
- //
- // Immediate22 @ltoff(@dtpmod(S + A))
- //
- #define R_IA_64_LTOFF_DTPMOD22 0xaa
- //
- // Immediate14/22/64 @dtprel(S + A)
- //
- #define R_IA_64_DTPREL14 0xb1
- #define R_IA_64_DTPREL22 0xb2
- #define R_IA_64_DTPREL64I 0xb3
- //
- // Word32/64 MSB/LSB @dtprel(S + A)
- //
- #define R_IA_64_DTPREL32MSB 0xb4
- #define R_IA_64_DTPREL32LSB 0xb5
- #define R_IA_64_DTPREL64MSB 0xb6
- #define R_IA_64_DTPREL64LSB 0xb7
- //
- // Immediate22 @ltof(@dtprel(S + A))
- //
- #define R_IA_64_LTOFF_DTPREL22 0xba
- //
- // PowerPC relocations
- //
- #define R_PPC_NONE 0
- #define R_PPC_ADDR32 1
- #define R_PPC_ADDR24 2
- #define R_PPC_ADDR16 3
- #define R_PPC_ADDR16_LO 4
- #define R_PPC_ADDR16_HI 5
- #define R_PPC_ADDR16_HA 6
- #define R_PPC_ADDR14 7
- #define R_PPC_ADDR14_BRTAKEN 8
- #define R_PPC_ADDR14_BRNTAKEN 9
- #define R_PPC_REL24 10
- #define R_PPC_REL14 11
- #define R_PPC_REL14_BRTAKEN 12
- #define R_PPC_REL14_BRNTAKEN 13
- #define R_PPC_GOT16 14
- #define R_PPC_GOT16_LO 15
- #define R_PPC_GOT16_HI 16
- #define R_PPC_GOT16_HA 17
- #define R_PPC_PLTREL24 18
- #define R_PPC_COPY 19
- #define R_PPC_GLOB_DAT 20
- #define R_PPC_JMP_SLOT 21
- #define R_PPC_RELATIVE 22
- #define R_PPC_LOCAL24PC 23
- #define R_PPC_UADDR32 24
- #define R_PPC_UADDR16 25
- #define R_PPC_REL32 26
- #define R_PPC_PLT32 27
- #define R_PPC_PLTREL32 28
- #define R_PPC_PLT16_LO 29
- #define R_PPC_PLT16_HI 30
- #define R_PPC_PLT16_HA 31
- #define R_PPC_SDAREL16 32
- #define R_PPC_SECTOFF 33
- #define R_PPC_SECTOFF_LO 34
- #define R_PPC_SECTOFF_HI 35
- #define R_PPC_SECTOFF_HA 36
- //
- // PowerPC TLS relocations
- //
- #define R_PPC_TLS 67
- #define R_PPC_DTPMOD32 68
- #define R_PPC_TPREL16 69
- #define R_PPC_TPREL16_LO 70
- #define R_PPC_TPREL16_HI 71
- #define R_PPC_TPREL16_HA 72
- #define R_PPC_TPREL32 73
- #define R_PPC_DTPREL16 74
- #define R_PPC_DTPREL16_LO 75
- #define R_PPC_DTPREL16_HI 76
- #define R_PPC_DTPREL16_HA 77
- #define R_PPC_DTPREL32 78
- #define R_PPC_GOT_TLSGD16 79
- #define R_PPC_GOT_TLSGD16_LO 80
- #define R_PPC_GOT_TLSGD16_HI 81
- #define R_PPC_GOT_TLSGD16_HA 82
- #define R_PPC_GOT_TLSLD16 83
- #define R_PPC_GOT_TLSLD16_LO 84
- #define R_PPC_GOT_TLSLD16_HI 85
- #define R_PPC_GOT_TLSLD16_HA 86
- #define R_PPC_GOT_TPREL16 87
- #define R_PPC_GOT_TPREL16_LO 88
- #define R_PPC_GOT_TPREL16_HI 89
- #define R_PPC_GOT_TPREL16_HA 90
- //
- // The remaining PowerPC relocations are from the embedded ELF API, and are not
- // in the SVR4 ELF ABI.
- //
- #define R_PPC_EMB_NADDR32 101
- #define R_PPC_EMB_NADDR16 102
- #define R_PPC_EMB_NADDR16_LO 103
- #define R_PPC_EMB_NADDR16_HI 104
- #define R_PPC_EMB_NADDR16_HA 105
- #define R_PPC_EMB_SDAI16 106
- #define R_PPC_EMB_SDA2I16 107
- #define R_PPC_EMB_SDA2REL 108
- #define R_PPC_EMB_SDA21 109
- #define R_PPC_EMB_MRKREF 110
- #define R_PPC_EMB_RELSEC16 111
- #define R_PPC_EMB_RELST_LO 112
- #define R_PPC_EMB_RELST_HI 113
- #define R_PPC_EMB_RELST_HA 114
- #define R_PPC_EMB_BIT_FLD 115
- #define R_PPC_EMB_RELSDA 116
- #define R_SPARC_NONE 0
- #define R_SPARC_8 1
- #define R_SPARC_16 2
- #define R_SPARC_32 3
- #define R_SPARC_DISP8 4
- #define R_SPARC_DISP16 5
- #define R_SPARC_DISP32 6
- #define R_SPARC_WDISP30 7
- #define R_SPARC_WDISP22 8
- #define R_SPARC_HI22 9
- #define R_SPARC_22 10
- #define R_SPARC_13 11
- #define R_SPARC_LO10 12
- #define R_SPARC_GOT10 13
- #define R_SPARC_GOT13 14
- #define R_SPARC_GOT22 15
- #define R_SPARC_PC10 16
- #define R_SPARC_PC22 17
- #define R_SPARC_WPLT30 18
- #define R_SPARC_COPY 19
- #define R_SPARC_GLOB_DAT 20
- #define R_SPARC_JMP_SLOT 21
- #define R_SPARC_RELATIVE 22
- #define R_SPARC_UA32 23
- #define R_SPARC_PLT32 24
- #define R_SPARC_HIPLT22 25
- #define R_SPARC_LOPLT10 26
- #define R_SPARC_PCPLT32 27
- #define R_SPARC_PCPLT22 28
- #define R_SPARC_PCPLT10 29
- #define R_SPARC_10 30
- #define R_SPARC_11 31
- #define R_SPARC_64 32
- #define R_SPARC_OLO10 33
- #define R_SPARC_HH22 34
- #define R_SPARC_HM10 35
- #define R_SPARC_LM22 36
- #define R_SPARC_PC_HH22 37
- #define R_SPARC_PC_HM10 38
- #define R_SPARC_PC_LM22 39
- #define R_SPARC_WDISP16 40
- #define R_SPARC_WDISP19 41
- #define R_SPARC_GLOB_JMP 42
- #define R_SPARC_7 43
- #define R_SPARC_5 44
- #define R_SPARC_6 45
- #define R_SPARC_DISP64 46
- #define R_SPARC_PLT64 47
- #define R_SPARC_HIX22 48
- #define R_SPARC_LOX10 49
- #define R_SPARC_H44 50
- #define R_SPARC_M44 51
- #define R_SPARC_L44 52
- #define R_SPARC_REGISTER 53
- #define R_SPARC_UA64 54
- #define R_SPARC_UA16 55
- #define R_SPARC_TLS_GD_HI22 56
- #define R_SPARC_TLS_GD_LO10 57
- #define R_SPARC_TLS_GD_ADD 58
- #define R_SPARC_TLS_GD_CALL 59
- #define R_SPARC_TLS_LDM_HI22 60
- #define R_SPARC_TLS_LDM_LO10 61
- #define R_SPARC_TLS_LDM_ADD 62
- #define R_SPARC_TLS_LDM_CALL 63
- #define R_SPARC_TLS_LDO_HIX22 64
- #define R_SPARC_TLS_LDO_LOX10 65
- #define R_SPARC_TLS_LDO_ADD 66
- #define R_SPARC_TLS_IE_HI22 67
- #define R_SPARC_TLS_IE_LO10 68
- #define R_SPARC_TLS_IE_LD 69
- #define R_SPARC_TLS_IE_LDX 70
- #define R_SPARC_TLS_IE_ADD 71
- #define R_SPARC_TLS_LE_HIX22 72
- #define R_SPARC_TLS_LE_LOX10 73
- #define R_SPARC_TLS_DTPMOD32 74
- #define R_SPARC_TLS_DTPMOD64 75
- #define R_SPARC_TLS_DTPOFF32 76
- #define R_SPARC_TLS_DTPOFF64 77
- #define R_SPARC_TLS_TPOFF32 78
- #define R_SPARC_TLS_TPOFF64 79
- //
- // AMD64 relocations
- //
- #define R_X86_64_NONE 0
- //
- // Add 64-bit symbol value
- //
- #define R_X86_64_64 1
- //
- // PC-relative 32-bit signed symbol value
- //
- #define R_X86_64_PC32 2
- //
- // PC-relative 32-bit GOT offset
- //
- #define R_X86_64_GOT32 3
- //
- // PC-relative 32-bit PLT offset
- //
- #define R_X86_64_PLT32 4
- //
- // Copy data from the shared object
- //
- #define R_X86_64_COPY 5
- //
- // Set GOT entry to data address
- //
- #define R_X86_64_GLOB_DAT 6
- //
- // Set GOT entry to code address
- //
- #define R_X86_64_JMP_SLOT 7
- //
- // Add the load address of the shared object
- //
- #define R_X86_64_RELATIVE 8
- //
- // Add 32-bit signed PC-relative offset to GOT
- //
- #define R_X86_64_GOTPCREL 9
- //
- // Add 32-bit zero extended symbol value
- //
- #define R_X86_64_32 10
- //
- // Add 32-bit sign-extended symbol value
- //
- #define R_X86_64_32S 11
- //
- // Add 16-bit zero extended symbol value
- //
- #define R_X86_64_16 12
- //
- // Add 16-bit sign-extended PC-relative symbol value
- //
- #define R_X86_64_PC16 13
- //
- // Add 8-bit zero extended symbol value
- //
- #define R_X86_64_8 14
- //
- // Add 8-bit sign-extended PC-relative symbol value
- //
- #define R_X86_64_PC8 15
- //
- // ID of the module containing the symbol
- //
- #define R_X86_64_DTPMOD64 16
- //
- // Offset in the TLS block
- //
- #define R_X86_64_DTPOFF64 17
- //
- // Offset in the static TLS block
- //
- #define R_X86_64_TPOFF64 18
- //
- // PC-relative offset to GD GOT entry
- //
- #define R_X86_64_TLSGD 19
- //
- // PC-relative offset to LD GOT entry
- //
- #define R_X86_64_TLSLD 20
- //
- // Offset in TLS block
- //
- #define R_X86_64_DTPOFF32 21
- //
- // PC-relative offset to IE GOT entry
- //
- #define R_X86_64_GOTTPOFF 22
- //
- // Offset in static TLS block
- //
- #define R_X86_64_TPOFF32 23
- //
- // ------------------------------------------------------ Data Type Definitions
- //
- //
- // Common ELF definitions
- //
- /*++
- Structure Description:
- This structure defines an ELF note header. The ".note" section contains an
- array of notes. Each not begins with this header, aligned to a word
- boundary. After the note header is n_namesz bytes of name, padded to the
- next word boundary. Then n_descsz bytes of descriptor, again padded to a
- word boundary. The values of n_namesz and n_descsz to not include the
- padding.
- Members:
- n_namesz - Stores the length of the name.
- n_descsz - Stores the length of the descriptor.
- n_type - Stores the note type.
- --*/
- typedef struct {
- uint32_t n_namesz;
- uint32_t n_descsz;
- uint32_t n_type;
- } Elf_Note;
- //
- // 32-bit ELF definitions
- //
- typedef uint32_t Elf32_Addr;
- typedef uint16_t Elf32_Half;
- typedef uint32_t Elf32_Off;
- typedef int32_t Elf32_Sword;
- typedef uint32_t Elf32_Word;
- typedef uint64_t Elf32_Lword;
- typedef Elf32_Word Elf32_Hashelt;
- //
- // Non-standard class-dependent data type used for abstraction
- //
- typedef Elf32_Word Elf32_Size;
- typedef Elf32_Sword Elf32_Ssize;
- /*++
- Structure Description:
- This structure defines the ELF32 file header.
- Members:
- e_ident - Stores the file identification.
- e_type - Stores the file type.
- e_machine - Stores the machine architecture.
- e_version - Stores the ELF format version.
- e_entry - Stores the entry point.
- e_phoff - Stores the program header file offset.
- e_shoff - Stores the section header file offset.
- e_flags - Stores architecture-specific flags.
- e_ehsize - Stores the size of the ELF header in bytes.
- e_phentsize - Stores the size of the program header entry.
- e_phnum - Stores the size of the program header entries.
- e_shentsize - Stores the size of a section header entry.
- e_shnum - Stores the count of section header entries.
- e_shstrndx - Stores the section name strings section.
- --*/
- typedef struct {
- unsigned char e_ident[EI_NIDENT];
- Elf32_Half e_type;
- Elf32_Half e_machine;
- Elf32_Word e_version;
- Elf32_Addr e_entry;
- Elf32_Off e_phoff;
- Elf32_Off e_shoff;
- Elf32_Word e_flags;
- Elf32_Half e_ehsize;
- Elf32_Half e_phentsize;
- Elf32_Half e_phnum;
- Elf32_Half e_shentsize;
- Elf32_Half e_shnum;
- Elf32_Half e_shstrndx;
- } Elf32_Ehdr;
- /*++
- Structure Description:
- This structure defines the ELF32 section header.
- Members:
- sh_name - Stores the index into the section header string table where the
- section name string can bd found.
- sh_type - Stores the section type.
- sh_flags - Stores the section flags.
- sh_addr - Stores the address in the memory image.
- sh_offset - Stores the file offset of the section.
- sh_size - Stores the size of the section in bytes.
- sh_link - Stores the index of a related section.
- sh_info - Stores a value that depends on the section type.
- sh_addralign - Stores the alignment in bytes.
- sh_entsize - Stores the size of each entry in the section.
- --*/
- typedef struct {
- Elf32_Word sh_name;
- Elf32_Word sh_type;
- Elf32_Word sh_flags;
- Elf32_Addr sh_addr;
- Elf32_Off sh_offset;
- Elf32_Word sh_size;
- Elf32_Word sh_link;
- Elf32_Word sh_info;
- Elf32_Word sh_addralign;
- Elf32_Word sh_entsize;
- } Elf32_Shdr;
- /*++
- Structure Description:
- This structure defines the ELF32 program header.
- Members:
- p_type - Stores the program header type.
- p_offset - Stores the file offset of the contents.
- p_vaddr - Stores the virtual address in the memory image.
- p_paddr - Stores the physical address (not used).
- p_filesz - Stores the size of the contents within the file.
- p_memsz - Stores the size of the contents in memory.
- p_flags - Stores access permission flags.
- p_align - Stores the alignment in memory and in the file.
- --*/
- typedef struct {
- Elf32_Word p_type;
- Elf32_Off p_offset;
- Elf32_Addr p_vaddr;
- Elf32_Addr p_paddr;
- Elf32_Word p_filesz;
- Elf32_Word p_memsz;
- Elf32_Word p_flags;
- Elf32_Word p_align;
- } Elf32_Phdr;
- /*++
- Structure Description:
- This structure defines the ELF32 dynamic section.
- Members:
- d_tag - Stores the entry type.
- d_un - Stores a union of the two different forms of the value.
- d_val - Stores the integer representation of the value.
- d_ptr - Stores the pointer representation of the value.
- --*/
- typedef struct {
- Elf32_Sword d_tag;
- union {
- Elf32_Word d_val;
- Elf32_Addr d_ptr;
- } d_un;
- } Elf32_Dyn;
- /*++
- Structure Description:
- This structure defines the ELF32 relocation entry that does not require
- an addend.
- Members:
- r_offset - Stores the location to be relocated.
- r_info - Stores the relocation type and symbol index.
- --*/
- typedef struct {
- Elf32_Addr r_offset;
- Elf32_Word r_info;
- } Elf32_Rel;
- /*++
- Structure Description:
- This structure defines the ELF32 relocation entry that needs an addend
- field.
- Members:
- r_offset - Stores the location to be relocated.
- r_info - Stores the relocation type and symbol index.
- r_addend - Stores the addend to throw in there.
- --*/
- typedef struct {
- Elf32_Addr r_offset;
- Elf32_Word r_info;
- Elf32_Sword r_addend;
- } Elf32_Rela;
- typedef Elf_Note Elf32_Nhdr;
- /*++
- Structure Description:
- This structure defines the ELF32 move entry.
- Members:
- m_value - Stores the symbol value.
- m_info - Stores the size + index.
- m_poffset - Stores the symbol offset.
- m_repeat - Stores the repeat count.
- m_stride - Stores the stride information.
- --*/
- typedef struct {
- Elf32_Lword m_value;
- Elf32_Word m_info;
- Elf32_Word m_poffset;
- Elf32_Half m_repeat;
- Elf32_Half m_stride;
- } Elf32_Move;
- /*++
- Structure Description:
- This structure defines the ELF32 hardware/software capabilities array.
- Members:
- c_tag - Stores the tag which determines the interpretation of the value.
- c_un - Stores a union of the two different forms of the value.
- c_val - Stores the integer representation of the value.
- c_ptr - Stores the pointer representation of the value.
- --*/
- typedef struct {
- Elf32_Word c_tag;
- union {
- Elf32_Word c_val;
- Elf32_Addr c_ptr;
- } c_un;
- } Elf32_Cap;
- /*++
- Structure Description:
- This structure defines an ELF32 symbol table entry.
- Members:
- st_name - Stores the string table index of the name.
- st_value - Stores the value of the symbol.
- st_size - Stores the size of the associated objct.
- st_info - Stores the type and binding information.
- st_other - Stores a reserved value (not used).
- st_shndx - Stores the section index of the symbol.
- --*/
- typedef struct {
- Elf32_Word st_name;
- Elf32_Addr st_value;
- Elf32_Word st_size;
- unsigned char st_info;
- unsigned char st_other;
- Elf32_Half st_shndx;
- } Elf32_Sym;
- //
- // Structures used by Sun & GNU symbol versioning
- //
- typedef struct {
- Elf32_Half vd_version;
- Elf32_Half vd_flags;
- Elf32_Half vd_ndx;
- Elf32_Half vd_cnt;
- Elf32_Word vd_hash;
- Elf32_Word vd_aux;
- Elf32_Word vd_next;
- } Elf32_Verdef;
- typedef struct {
- Elf32_Word vda_name;
- Elf32_Word vda_next;
- } Elf32_Verdaux;
- typedef struct {
- Elf32_Half vn_version;
- Elf32_Half vn_cnt;
- Elf32_Word vn_file;
- Elf32_Word vn_aux;
- Elf32_Word vn_next;
- } Elf32_Verneed;
- typedef struct {
- Elf32_Word vna_hash;
- Elf32_Half vna_flags;
- Elf32_Half vna_other;
- Elf32_Word vna_name;
- Elf32_Word vna_next;
- } Elf32_Vernaux;
- typedef Elf32_Half Elf32_Versym;
- typedef struct {
- Elf32_Half si_boundto;
- Elf32_Half si_flags;
- } Elf32_Syminfo;
- //
- // 64-bit ELF definitions
- //
- typedef uint64_t Elf64_Addr;
- typedef uint16_t Elf64_Half;
- typedef uint64_t Elf64_Off;
- typedef int32_t Elf64_Sword;
- typedef int64_t Elf64_Sxword;
- typedef uint32_t Elf64_Word;
- typedef uint64_t Elf64_Lword;
- typedef uint64_t Elf64_Xword;
- //
- // Define types of dynamic symbol hash table bucket and chain elements.
- // This is inconsitent among 64-bit architectures, so a machine dependent
- // typedef is required.
- //
- typedef Elf64_Word Elf64_Hashelt;
- //
- // Non-standard class-dependent data types used for abstraction.
- //
- typedef Elf64_Xword Elf64_Size;
- typedef Elf64_Sxword Elf64_Ssize;
- /*++
- Structure Description:
- This structure defines the ELF64 file header.
- Members:
- e_ident - Stores the file identification.
- e_type - Stores the file type.
- e_machine - Stores the machine architecture.
- e_version - Stores the ELF format version.
- e_entry - Stores the entry point.
- e_phoff - Stores the program header file offset.
- e_shoff - Stores the section header file offset.
- e_flags - Stores architecture-specific flags.
- e_ehsize - Stores the size of the ELF header in bytes.
- e_phentsize - Stores the size of the program header entry.
- e_phnum - Stores the size of the program header entries.
- e_shentsize - Stores the size of a section header entry.
- e_shnum - Stores the count of section header entries.
- e_shstrndx - Stores the section name strings section.
- --*/
- typedef struct {
- unsigned char e_ident[EI_NIDENT];
- Elf64_Half e_type;
- Elf64_Half e_machine;
- Elf64_Word e_version;
- Elf64_Addr e_entry;
- Elf64_Off e_phoff;
- Elf64_Off e_shoff;
- Elf64_Word e_flags;
- Elf64_Half e_ehsize;
- Elf64_Half e_phentsize;
- Elf64_Half e_phnum;
- Elf64_Half e_shentsize;
- Elf64_Half e_shnum;
- Elf64_Half e_shstrndx;
- } Elf64_Ehdr;
- /*++
- Structure Description:
- This structure defines the ELF64 section header.
- Members:
- sh_name - Stores the index into the section header string table where the
- section name string can bd found.
- sh_type - Stores the section type.
- sh_flags - Stores the section flags.
- sh_addr - Stores the address in the memory image.
- sh_offset - Stores the file offset of the section.
- sh_size - Stores the size of the section in bytes.
- sh_link - Stores the index of a related section.
- sh_info - Stores a value that depends on the section type.
- sh_addralign - Stores the alignment in bytes.
- sh_entsize - Stores the size of each entry in the section.
- --*/
- typedef struct {
- Elf64_Word sh_name;
- Elf64_Word sh_type;
- Elf64_Xword sh_flags;
- Elf64_Addr sh_addr;
- Elf64_Off sh_offset;
- Elf64_Xword sh_size;
- Elf64_Word sh_link;
- Elf64_Word sh_info;
- Elf64_Xword sh_addralign;
- Elf64_Xword sh_entsize;
- } Elf64_Shdr;
- /*++
- Structure Description:
- This structure defines the ELF64 program header.
- Members:
- p_type - Stores the program header type.
- p_flags - Stores access permission flags.
- p_offset - Stores the file offset of the contents.
- p_vaddr - Stores the virtual address in the memory image.
- p_paddr - Stores the physical address (not used).
- p_filesz - Stores the size of the contents within the file.
- p_memsz - Stores the size of the contents in memory.
- p_align - Stores the alignment in memory and in the file.
- --*/
- typedef struct {
- Elf64_Word p_type;
- Elf64_Word p_flags;
- Elf64_Off p_offset;
- Elf64_Addr p_vaddr;
- Elf64_Addr p_paddr;
- Elf64_Xword p_filesz;
- Elf64_Xword p_memsz;
- Elf64_Xword p_align;
- } Elf64_Phdr;
- /*++
- Structure Description:
- This structure defines the ELF64 dynamic section.
- Members:
- d_tag - Stores the entry type.
- d_un - Stores a union of the two different forms of the value.
- d_val - Stores the integer representation of the value.
- d_ptr - Stores the pointer representation of the value.
- --*/
- typedef struct {
- Elf64_Sxword d_tag;
- union {
- Elf64_Xword d_val;
- Elf64_Addr d_ptr;
- } d_un;
- } Elf64_Dyn;
- /*++
- Structure Description:
- This structure defines the ELF64 relocation entry that does not require
- an addend.
- Members:
- r_offset - Stores the location to be relocated.
- r_info - Stores the relocation type and symbol index.
- --*/
- typedef struct {
- Elf64_Addr r_offset;
- Elf64_Xword r_info;
- } Elf64_Rel;
- /*++
- Structure Description:
- This structure defines the ELF64 relocation entry that needs an addend
- field.
- Members:
- r_offset - Stores the location to be relocated.
- r_info - Stores the relocation type and symbol index.
- r_addend - Stores the addend to throw in there.
- --*/
- typedef struct {
- Elf64_Addr r_offset;
- Elf64_Xword r_info;
- Elf64_Sxword r_addend;
- } Elf64_Rela;
- typedef Elf_Note Elf64_Nhdr;
- /*++
- Structure Description:
- This structure defines the ELF64 move entry.
- Members:
- m_value - Stores the symbol value.
- m_info - Stores the size + index.
- m_poffset - Stores the symbol offset.
- m_repeat - Stores the repeat count.
- m_stride - Stores the stride information.
- --*/
- typedef struct {
- Elf64_Lword m_value;
- Elf64_Xword m_info;
- Elf64_Xword m_poffset;
- Elf64_Half m_repeat;
- Elf64_Half m_stride;
- } Elf64_Move;
- /*++
- Structure Description:
- This structure defines the ELF64 hardware/software capabilities array.
- Members:
- c_tag - Stores the tag which determines the interpretation of the value.
- c_un - Stores a union of the two different forms of the value.
- c_val - Stores the integer representation of the value.
- c_ptr - Stores the pointer representation of the value.
- --*/
- typedef struct {
- Elf64_Xword c_tag;
- union {
- Elf64_Xword c_val;
- Elf64_Addr c_ptr;
- } c_un;
- } Elf64_Cap;
- /*++
- Structure Description:
- This structure defines an ELF64 symbol table entry.
- Members:
- st_name - Stores the string table index of the name.
- st_value - Stores the value of the symbol.
- st_size - Stores the size of the associated objct.
- st_info - Stores the type and binding information.
- st_other - Stores a reserved value (not used).
- st_shndx - Stores the section index of the symbol.
- --*/
- typedef struct {
- Elf64_Word st_name;
- unsigned char st_info;
- unsigned char st_other;
- Elf64_Half st_shndx;
- Elf64_Addr st_value;
- Elf64_Xword st_size;
- } Elf64_Sym;
- //
- // Define structures used by Sun & GNU-style symbol versioning.
- //
- typedef struct {
- Elf64_Half vd_version;
- Elf64_Half vd_flags;
- Elf64_Half vd_ndx;
- Elf64_Half vd_cnt;
- Elf64_Word vd_hash;
- Elf64_Word vd_aux;
- Elf64_Word vd_next;
- } Elf64_Verdef;
- typedef struct {
- Elf64_Word vda_name;
- Elf64_Word vda_next;
- } Elf64_Verdaux;
- typedef struct {
- Elf64_Half vn_version;
- Elf64_Half vn_cnt;
- Elf64_Word vn_file;
- Elf64_Word vn_aux;
- Elf64_Word vn_next;
- } Elf64_Verneed;
- typedef struct {
- Elf64_Word vna_hash;
- Elf64_Half vna_flags;
- Elf64_Half vna_other;
- Elf64_Word vna_name;
- Elf64_Word vna_next;
- } Elf64_Vernaux;
- typedef Elf64_Half Elf64_Versym;
- typedef struct {
- Elf64_Half si_boundto;
- Elf64_Half si_flags;
- } Elf64_Syminfo;
- //
- // -------------------------------------------------------------------- Globals
- //
- //
- // -------------------------------------------------------- Function Prototypes
- //
- #endif
|