ChangeLog-0815 737 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139
  1. 2015-12-17 Peter Collingbourne <pcc@google.com>
  2. PR gold/18780
  3. * arm.cc (Target_arm::do_make_data_plt): Choose PLT generator based
  4. on value of --long-plt flag.
  5. (Output_data_plt_arm_standard::do_get_plt_entry_size): Moved to
  6. Output_data_plt_arm_short.
  7. (Output_data_plt_arm_standard::do_fill_plt_entry): Likewise.
  8. (Output_data_plt_arm_standard::plt_entry): Likewise.
  9. (Output_data_plt_arm_standard::do_fill_first_plt_entry): Fix
  10. variable reference.
  11. (Output_data_plt_arm_short): New class.
  12. (Output_data_plt_arm_short::do_fill_plt_entry): Error out on too large
  13. PLT offsets instead of asserting.
  14. (Output_data_plt_arm_long): New class.
  15. * options.h (General_options): Define --long-plt flag.
  16. 2015-12-16 Roland McGrath <mcgrathr@google.com>
  17. PR ld/17473
  18. * binary.cc: Move #include "safe-ctype.h" to be last #include.
  19. 2015-12-13 Cary Coutant <ccoutant@gmail.com>
  20. * object.h (Object::get_output_view): remove const from return type.
  21. (Object::do_get_output_view): Likewise.
  22. (Sized_relobj_file::do_get_output_view): Likewise.
  23. * reloc.cc (Sized_relobj_file::do_get_output_view): Likewise.
  24. 2015-12-11 Cary Coutant <ccoutant@gmail.com>
  25. * target.h (Target::calls_non_split): Add prelocs, reloc_count
  26. parameters.
  27. (Target::do_calls_non_split): Likewise.
  28. * target.cc (Target::do_calls_non_split): Likewise.
  29. * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Adjust
  30. call to Target::calls_non_split.
  31. * i386.cc (Target_i386::do_calls_non_split): Add prelocs, reloc_count
  32. parameters.
  33. * powerpc.cc (Target_powerpc::do_calls_non_split): Likewise.
  34. * x86_64.cc (Target_x86_64::do_calls_non_split): Likewise.
  35. 2015-12-11 Cary Coutant <ccoutant@gmail.com>
  36. * object.cc (Sized_relobj_file::Sized_relobj_file): Initialize
  37. output_views_.
  38. * object.h (Object::get_output_view): New function.
  39. (Object::do_get_output_view): New function.
  40. (Sized_relobj_file::do_get_output_view): New function.
  41. (Sized_relobj_file::output_views_): New data member.
  42. * reloc.cc: (Sized_relobj_file::do_relocate): Store pointer to
  43. output views in class object.
  44. (Sized_relobj_file::do_get_output_view): New function.
  45. 2015-12-10 H.J. Lu <hongjiu.lu@intel.com>
  46. PR ld/19317
  47. * symtab.cc (Symbol_table::add_from_relobj): Don't complain
  48. plugin needed to handle slim lto object for relocatable link.
  49. 2015-12-09 Alan Modra <amodra@gmail.com>
  50. * powerpc.cc (Target_powerpc::Relocate::relocate): New constant
  51. d_offset. Use throughout.
  52. (Target_powerpc::relocate_relocs): Likewise.
  53. 2015-12-09 Alan Modra <amodra@gmail.com>
  54. * powerpc.cc (Target_powerpc::Relocate::relocate): Edit ELFv2
  55. entry code.
  56. (Target_powerpc::relocate_relocs): Edit relocs to suit.
  57. 2015-12-09 Alan Modra <amodra@gmail.com>
  58. * object.h (struct Relocate_info): Add "rr".
  59. * reloc.h (Relocatable_relocs::set_strategy): New accessor.
  60. * reloc.cc (Sized_relobj_file::do_relocate_sections): Init
  61. relinfo.rr for relocate_section and relocate_relocs.
  62. * powerpc.cc (relocate): Add rel_type and preloc parameters.
  63. Delete rela and r_type params, instead recalculate these from
  64. preloc.
  65. (relocate_relocs): Delete Relocatable_relocs* param, instead
  66. use relinfo->rr.
  67. * aarch64.cc: Likewise.
  68. * arm.cc: Likewise.
  69. * i386.cc: Likewise.
  70. * mips.cc: Likewise.
  71. * s390.cc: Likewise.
  72. * sparc.cc: Likewise.
  73. * target.h: Likewise.
  74. * tilegx.cc: Likewise.
  75. * x86_64.cc: Likewise.
  76. * testsuite/testfile.cc: Likewise.
  77. * target-reloc.h (relocate_section): Adjust to suit.
  78. (apply_relocation, relocate_relocs): Likewise.
  79. 2015-12-07 Alan Modra <amodra@gmail.com>
  80. * powerpc.cc (add_2_2_12, ld_2_12, lis_2): Define.
  81. (Target_powerpc::Scan::local, global): Handle R_PPC64_ENTRY.
  82. (Target_powerpc::Relocate::relocate): Edit code at R_PPC64_ENTRY.
  83. 2015-12-03 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
  84. * object.cc (Sized_relobj::do_for_all_local_got_entries): Use
  85. Local_got_entry_key for searching in local_got_offsets_.
  86. * object.h (class Local_got_entry_key): New class.
  87. (Relobj::local_has_got_offset): New overloaded method.
  88. (Relobj::local_got_offset): Likewise.
  89. (Relobj::set_local_got_offset): Likewise.
  90. (Relobj::do_local_has_got_offset): Add addend argument.
  91. (Relobj::do_local_got_offset): Likewise.
  92. (Relobj::do_set_local_got_offset): Likewise.
  93. (Sized_relobj::do_local_has_got_offset): Add addend argument, and use
  94. Local_got_entry_key for searching through local_got_offsets_.
  95. (Sized_relobj::do_local_got_offset): Likewise.
  96. (Sized_relobj::do_set_local_got_offset): Likewise.
  97. (Sized_relobj::Local_got_offsets): Change type of the key from
  98. unsigned int to Local_got_entry_key, and add hash and equal_to.
  99. * output.cc (Got_entry::write): Take addend into account for
  100. calculating value of the local symbol for GOT.
  101. (Output_data_got::add_local): New definition of overloaded method.
  102. (Output_data_got::add_local_with_rel): Likewise.
  103. (Output_data_got::add_local_pair_with_rel): Likewise.
  104. * output.h (Output_data_got::add_local): New declaration of overloaded
  105. method.
  106. 2015-11-25 Cary Coutant <ccoutant@gmail.com>
  107. PR gold/19291
  108. * object.cc (Sized_relobj_file::write_local_symbols): If relocatable,
  109. subtract section address from symbol value.
  110. 2015-11-25 Alan Modra <amodra@gmail.com>
  111. * powerpc.cc (Output_data_got_powerpc::Output_data_got_powerpc): Align
  112. to 256 byte boundary.
  113. 2015-11-19 Alan Modra <amodra@gmail.com>
  114. * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
  115. GOT16 and TOC16 relocs to RELATIVE_REF.
  116. 2015-11-14 Cary Coutant <ccoutant@gmail.com>
  117. PR gold/19244
  118. PR gold/18548
  119. * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
  120. local symbols only for predefined symbols.
  121. 2015-11-11 Alan Modra <amodra@gmail.com>
  122. Peter Bergner <bergner@vnet.ibm.com>
  123. * powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
  124. (Powerpc_relocate_functions::addr16dx_ha): Likewise.
  125. (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
  126. (Target_powerpc::Scan::global): Likewise.
  127. (Target_powerpc::Relocate::relocate): Likewise.
  128. 2015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
  129. * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
  130. sections.
  131. 2015-11-09 Cary Coutant <ccoutant@gmail.com>
  132. Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
  133. * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
  134. with type, offset, addend.
  135. (Copy_relocs::save): Likewise.
  136. * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
  137. (Copy_relocs::save): Likewise.
  138. * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
  139. and r_addend to Copy_relocs::copy_reloc.
  140. * arm.cc (Target_arm::copy_reloc): Likewise.
  141. * i386.cc (Target_i386::copy_reloc): Likewise.
  142. * mips.cc (Target_mips::copy_reloc): Likewise.
  143. * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
  144. * s390.cc (Target_s390::copy_reloc): Likewise.
  145. * sparc.cc (Target_sparc::copy_reloc): Likewise.
  146. * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
  147. * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
  148. 2015-11-05 Cary Coutant <ccoutant@gmail.com>
  149. PR gold/19119
  150. PR gold/19172
  151. PR gold/19197
  152. Revert commit 6457197210144f50a696097c0d308d81d46d5510:
  153. 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
  154. * options.h (General_options): Remove "obsolete" from -m.
  155. * parameters.cc (set_parameters_target): Check if input target
  156. is compatible with output emulation set by "-m emulation".
  157. 2015-11-05 Cary Coutant <ccoutant@gmail.com>
  158. PR gold/19163
  159. * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
  160. certain relocations if --no-apply-dynamic-relocs is set.
  161. * options.h (--apply-dynamic-relocs): New aarch64-specific option.
  162. 2015-11-03 Alan Modra <amodra@gmail.com>
  163. * po/POTFILES.in: Regenerate.
  164. 2015-10-30 Nick Clifton <nickc@redhat.com>
  165. * po/zh_CN.po: New (simplified) Chinese translation.
  166. 2015-10-29 H.J. Lu <hongjiu.lu@intel.com>
  167. PR gold/19184
  168. * incremental.cc (Got_plt_view_info): Add got_entry_size.
  169. (Local_got_offset_visitor::visit): Replace got_entry_size_
  170. with info_.got_entry_size.
  171. (Local_got_offset_visitor::got_entry_size_): Removed.
  172. (Global_got_offset_visitor::visit): Replace got_entry_size_
  173. with info_.got_entry_size.
  174. (Global_got_offset_visitor::got_entry_size_): Removed.
  175. (Output_section_incremental_inputs::write_got_plt): Initialize
  176. view_info.got_entry_size.
  177. * target.h (Sized_target::got_entry_size): New virtual function.
  178. * x86_64.cc (Target_x86_64::got_entry_size): New function.
  179. 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
  180. * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
  181. * testsuite/script_test_12a.c: Likewise.
  182. * testsuite/script_test_1a.cc: Likewise.
  183. * testsuite/script_test_2.cc: Likewise.
  184. 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
  185. * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
  186. 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
  187. PR gold/18959
  188. * stringpool.cc (Stringpool_template::new_key_offset): Align all
  189. strings, even zero-length.
  190. (Stringpool_template::set_string_offsets): Likewise.
  191. 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
  192. * s390.cc: New file.
  193. * Makefile.am (TARGETSOURCES): Add s390.cc.
  194. (ALL_TARGETOBJS): Add s390.o.
  195. * Makefile.in: Regenerate.
  196. * configure.ac: Add s390 support.
  197. * configure: Regenerate.
  198. * configure.tgt: Add s390-*-* and s390x-*-*.
  199. * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
  200. support.
  201. 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
  202. * archive.cc (Archive::sym64name): New const.
  203. (Archive::setup): Add support for SYM64 armap.
  204. (Archive::read_armap): Likewise.
  205. (Archive::interpret_header): Likewise.
  206. (Archive::const_iterator::read_next_header): Likewise.
  207. * archive.h (Archive::sym64name): New const.
  208. (Archive::read_armap): Add mapsize template parameter.
  209. 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
  210. * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
  211. target-specific entry size.
  212. (Dynobj::sized_create_elf_hash_table): Add size template parameter.
  213. * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
  214. * layout.cc (Layout::create_dynamic_symtab): Set entsize to
  215. hash_entry_size.
  216. * target.h (Target::hash_entry_size): New method.
  217. (Target::Target_info::hash_entry_size): New data member.
  218. * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
  219. * arm.cc (Target_arm::arm_info): Likewise.
  220. (Target_arm_nacl::arm_nacl_info): Likewise.
  221. * i386.cc (Target_i386::i386_info): Likewise.
  222. (Target_i386_nacl::i386_nacl_info): Likewise.
  223. (Target_iamcu::iamcu_info): Likewise.
  224. * mips.cc (Target_mips::mips_info): Likewise.
  225. (Target_mips_nacl::mips_nacl_info): Likewise.
  226. * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
  227. * sparc.cc (Target_sparc::sparc_info): Likewise.
  228. * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
  229. * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
  230. (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
  231. * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
  232. 2015-10-28 H.J. Lu <hongjiu.lu@intel.com>
  233. PR gold/19177
  234. * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
  235. and R_386_GOT32X relocations without base register.
  236. 2015-10.27 Han Shen <shenhan@google.com>
  237. PR gold/19042 - unsupported reloc 311/312.
  238. * aarch64.cc (Target_aarch64::Scan::local): Add support for
  239. reloc 311/312.
  240. 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
  241. * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
  242. Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
  243. as R_X86_64_GOTPCREL.
  244. (Target_x86_64<size>::Scan::local): Likewise.
  245. (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
  246. Likewise.
  247. (Target_x86_64<size>::Scan::global): Likewise.
  248. (Target_x86_64<size>::Relocate::relocate): Likewise.
  249. (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
  250. Likewise.
  251. 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
  252. * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
  253. R_386_GOT32X the same as R_386_GOT32.
  254. (Target_i386::Scan::local): Likewise.
  255. (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
  256. (Target_i386::Scan::global): Likewise.
  257. (Target_i386::Relocate::relocate): Likewise.
  258. (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
  259. Likewise.
  260. 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
  261. * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
  262. x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
  263. (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
  264. x86_64_mov_to_lea1.o.
  265. * testsuite/Makefile.in: Regenerated.
  266. 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
  267. PR gold/19119
  268. * options.h (General_options): Remove "obsolete" from -m.
  269. * parameters.cc (set_parameters_target): Check if input target
  270. is compatible with output emulation set by "-m emulation".
  271. 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
  272. PR gold/19118
  273. * i386.cc (Target_iamcu): New class.
  274. (Target_selector_iamcu): Likewise.
  275. (Target_iamcu::iamcu_info): New variable.
  276. (target_selector_iamcu): Likewise.
  277. 2015-10-07 Andreas Schwab <schwab@suse.de>
  278. * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
  279. 2015-10-06 Cary Coutant <ccoutant@gmail.com>
  280. PR gold/18855
  281. * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
  282. parameter.
  283. (Sparc_relocate_functions::gdop_lox10): Likewise.
  284. (Target_sparc::Relocate::relocate): Use addend when computing
  285. symbol value for R_SPARC_GOTDATA_OP*.
  286. 2015-09-07 Cary Coutant <ccoutant@gmail.com>
  287. PR gold/18930
  288. PR gold/18886
  289. * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
  290. * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
  291. 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
  292. PR gold/18886
  293. * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
  294. shared libraries into normal FUNC symbols.
  295. * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
  296. symbols aren't from shared libraries.
  297. 2015-09-02 Alan Modra <amodra@gmail.com>
  298. PR 18878
  299. * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
  300. (Target_powerpc::Branch_info::make_stub): Determine whether long
  301. branch stub is for save/restore function.
  302. (Branch_stub_ent): Add save_res_, and extra parm to constructor.
  303. (Stub_table): Add need_save_res_.
  304. (Stub_table:clear_stubs): Clear need_save_res_.
  305. (Stub_table:set_address_and_size): Add save/restore section size.
  306. (Stub_table::add_long_branch_entry): Add save_res param. Set
  307. need_save_res_, but don't add space for save/restore stubs.
  308. (Stub_table::find_long_branch_entry): Return offset to local copy
  309. of save/restore func.
  310. (Stub_table::do_write): Don't output save/restore stubs. Instead
  311. copy the save/restore functions.
  312. (Output_data_save_res:contents): New accessor.
  313. (Target_powerpc::define_save_restore_funcs): Set savres_section_.
  314. 2015-08-25 Cary Coutant <ccoutant@gmail.com>
  315. PR gold/18847
  316. * script-sections.cc (Memory_region::set_address): New method.
  317. (Script_sections::find_memory_region): Add explicit_only parameter.
  318. (Output_section_definition::set_section_addresses): Handle case where
  319. script specifies both address and vma region.
  320. * script-sections.h (Script_sections::find_memory_region): Add
  321. explicit_only parameter.
  322. 2015-08-25 Cary Coutant <ccoutant@gmail.com>
  323. PR gold/18859
  324. * object.cc (Input_objects::add_object): Store objects in a map,
  325. indexed by soname; update as-needed flag when necessary.
  326. * object.h (Object::clear_as_needed): New method.
  327. (Input_objects::so_names_): Change from set to map.
  328. 2015-08-25 Cary Coutant <ccoutant@gmail.com>
  329. PR gold/14746
  330. * expression.cc (Expression::Expression_eval_info): Add
  331. is_valid_pointer field.
  332. (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
  333. Adjust all callers.
  334. (Addr_expression::value_from_output_section): Check whether address
  335. is valid.
  336. * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
  337. if evaluation failed due to address that is not yet valid.
  338. * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
  339. parameter.
  340. 2015-08-25 Cary Coutant <ccoutant@gmail.com>
  341. PR gold/18866
  342. PR gold/18703
  343. * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
  344. 2015-08-20 Alan Modra <amodra@gmail.com>
  345. PR gold/18846
  346. * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
  347. Subtract os->address() from addend.
  348. * powerpc.cc (relocate_relocs): Likewise.
  349. 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
  350. * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
  351. lazy_stub_normal_1, lazy_stub_normal_1_n64,
  352. lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
  353. lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
  354. lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
  355. lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
  356. of 'addu/daddu'.
  357. 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
  358. * configure: Regenerated.
  359. 2015-07-26 Doug Kwan <dougkwan@google.com>
  360. * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
  361. disassembler output format.
  362. 2015-07-23 Ian Coolidge <icoolidge@google.com>
  363. Plumb --pic-veneer option for gold.
  364. * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
  365. generation.
  366. * options.h (General_options): Add --pic-veneer option.
  367. 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
  368. PR gold/18663
  369. * testsuite/Makefile.am (script_test_1_SOURCES): Set to
  370. script_test_1a.cc script_test_1b.cc.
  371. (script_test_11_r.o): Replace script_test_11.o with
  372. script_test_11a.o script_test_11b.o.
  373. (script_test_11.o): Removed.
  374. (script_test_11a.o): New.
  375. (script_test_11b.o): Likewise.
  376. * testsuite/Makefile.in: Regenerated.
  377. * testsuite/script_test_1.h: New file.
  378. * testsuite/script_test_1b.cc: Likewise.
  379. * testsuite/script_test_11.h: Likewise.
  380. * testsuite/script_test_11b.c: Likewise.
  381. * testsuite/script_test_1.cc: Renamed to ...
  382. * testsuite/script_test_1a.cc: This.
  383. Include "script_test_1.h".
  384. (main): Call check_int and check_ptr.
  385. * testsuite/script_test_11.c: Renamed to ...
  386. * testsuite/script_test_11a.c: This.
  387. Include "script_test_11.h".
  388. (main): Call ptr_equal.
  389. 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
  390. PR gold/18628
  391. * testsuite/ifuncdep2.c (global): Change protected to hidden.
  392. * testsuite/ifuncmod1.c (global): Likewise.
  393. * testsuite/ifuncmod5.c (global): Likewise.
  394. 2015-07-22 Alan Modra <amodra@gmail.com>
  395. * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
  396. 2015-07-21 Cary Coutant <ccoutant@gmail.com>
  397. PR gold/18548
  398. * symtab.cc (Symbol_table::do_define_in_output_data): Check for
  399. forced local symbol even when oldsym != NULL.
  400. (Symbol_table::do_define_in_output_segment): Likewise.
  401. (Symbol_table::do_define_as_constant): Likewise.
  402. 2015-07-21 Cary Coutant <ccoutant@gmail.com>
  403. PR gold/18698
  404. * archive.cc (Library_base::should_include_member): Don't use entry
  405. point for relocatable links, or if target is not yet valid.
  406. * parameters.cc (Parameters::entry): Check target_valid().
  407. 2015-07-20 Han Shen <shenhan@google.com>
  408. Optimize erratum 843419 fix.
  409. * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
  410. (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
  411. (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
  412. (E843419_stub): New sub-class of Erratum_stub.
  413. (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
  414. (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
  415. (AArch64_relobj::create_erratum_stub): Add 1 argument.
  416. (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
  417. 2015-07-20 Han Shen <shenhan@google.com>
  418. Fix arm elf header flags wrt hardfp bit.
  419. * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
  420. 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
  421. PR gold/18689
  422. * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
  423. from input group section for relocatable link.
  424. * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
  425. (check_DATA): Add pr18689.stdout.
  426. (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
  427. (pr18689.stdout): New rule.
  428. (pr18689a.o): Likewise.
  429. (pr18689b.o): Likewise.
  430. (pr18689.o): Likewise.
  431. * testsuite/pr18689.c: New file.
  432. * testsuite/pr18689.sh: Likewise.
  433. * testsuite/Makefile.in: Regenerated.
  434. 2015-07-20 Yiran Wang <yiran@google.com>
  435. Cary Coutant <ccoutant@gmail.com>
  436. PR gold/15574
  437. * resolve.cc (Symbol_table): Remove warning about references
  438. from shared objects to hidden symbols.
  439. * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
  440. * testsuite/Makefile.in: Regenerate.
  441. * testsuite/hidden_test.sh: Check dynamic symbol table; update
  442. expected error messages.
  443. 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
  444. * compressed_output.cc (Output_compressed_section::set_final_data_size):
  445. Make --compress-debug-sections=zlib the same as
  446. --compress-debug-sections=zlib-gabi.
  447. * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
  448. Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
  449. ".zdebug_".
  450. * testsuite/Makefile.in: Regenerated.
  451. 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
  452. PR gold/18322
  453. * compressed_output.cc (zlib_compress): Add argument for
  454. compression header size. Set header size to compression header
  455. size if it isn't 0. Don't write out the zlib header here.
  456. (Output_compressed_section::set_final_data_size): Support
  457. zlib-gnu and zlib-gabi compressions. Pass compression header
  458. size to zlib_compress and write out compression header. Set
  459. the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
  460. clear the SHF_COMPRESSED bit
  461. * options.h (compress_debug_sections): Add zlib-gnu and
  462. zlib-gabi.
  463. * output.h (Output_section::set_flags): New.
  464. * testsuite/Makefile.am (check_PROGRAMS): Add
  465. flagstest_compress_debug_sections_none,
  466. flagstest_compress_debug_sections_gnu and
  467. flagstest_compress_debug_sections_gabi.
  468. (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
  469. flagstest_compress_debug_sections.stdout,
  470. flagstest_compress_debug_sections.cmp,
  471. flagstest_compress_debug_sections.check,
  472. flagstest_compress_debug_sections_gnu.stdout,
  473. flagstest_compress_debug_sections_gnu.cmp,
  474. flagstest_compress_debug_sections_gnu.check,
  475. flagstest_compress_debug_sections_gabi.stdout,
  476. flagstest_compress_debug_sections_gabi.cmp and
  477. flagstest_compress_debug_sections_gabi.check.
  478. (flagstest_compress_debug_sections_none): New.
  479. (flagstest_compress_debug_sections_none.stdout): Likewise.
  480. (flagstest_compress_debug_sections.stdout): Likewise.
  481. (flagstest_compress_debug_sections.check): Likewise.
  482. (flagstest_compress_debug_sections.cmp): Likewise.
  483. (flagstest_compress_debug_sections_gnu): Likewise.
  484. (flagstest_compress_debug_sections_gnu.stdout): Likewise.
  485. (flagstest_compress_debug_sections_gnu.check): Likewise.
  486. (flagstest_compress_debug_sections_gnu.cmp): Likewise.
  487. (flagstest_compress_debug_sections_gabi): Likewise.
  488. (flagstest_compress_debug_sections_gabi.stdout): Likewise.
  489. (flagstest_compress_debug_sections_gnu.check): Likewise.
  490. (flagstest_compress_debug_sections_gnu.cmp): Likewise.
  491. * testsuite/Makefile.in: Regenerated.
  492. 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
  493. PR gold/18321
  494. * compressed_output.h (decompress_input_section): Add arguments
  495. for ELF class, big endian and sh_flags.
  496. * compressed_output.cc (decompress_input_section): Likewise.
  497. Support the SHF_COMPRESSED section.
  498. * dynobj.h (Dynobj): Add elfsize and is_big_endian member
  499. functions.
  500. * plugin.h (Pluginobj): Likewise.
  501. * layout.cc (Layout::get_output_section_flags): Also clear the
  502. SHF_COMPRESSED bit.
  503. * object.h (Compressed_section_info): Add flag to store sh_flags.
  504. (Object): Add pure virtual elfsize and is_big_endian member
  505. functions.
  506. * object.cc (need_decompressed_section): Don't skip the ".zdebug"
  507. prefix here.
  508. (build_compressed_section_map): Check SHF_COMPRESSED for
  509. uncompressed size. Store sh_flags in Compressed_section_info.
  510. Pass size, big_endian and sh_flags to decompress_input_section.
  511. Skip the ".debug"/".zdebug" prefix when passing section name to
  512. need_decompressed_section.
  513. (Sized_relobj_file<size, big_endian>::do_find_special_section):
  514. Don't check ".zdebug_*" sections.
  515. (Object::decompressed_section_contents): Pass ELF class, big
  516. endian and sh_flags to decompress_input_section.
  517. * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
  518. Likewise.
  519. * testsuite/Makefile.am (check_DATA): Add
  520. debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
  521. (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
  522. gdb_index_test_2_gabi.stdout.
  523. (debug_msg_cdebug_gabi.o): New.
  524. (odr_violation1_cdebug_gabi.o): Likewise.
  525. (odr_violation2_cdebug_gabi.o): Likewise.
  526. (debug_msg_cdebug_gabi.err): Likewise.
  527. (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
  528. (gdb_index_test_cdebug_gabi.o): Likewise.
  529. (gdb_index_test_2_gabi): Likewise.
  530. (gdb_index_test_2_gabi.stdout): Likewise.
  531. * testsuite/gdb_index_test_2_gabi.sh: New file.
  532. * testsuite/Makefile.in: Regenerated.
  533. 2015-07-09 Han Shen <shenhan@google.com>
  534. Use "gold_info" instead of "gold_warning" for erratum fix.
  535. * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
  536. 'gold_info'.
  537. (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
  538. 2015-07-09 Han Shen <shenhan@google.com>
  539. Drop missing symbol warning for arm/aarch64.
  540. * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
  541. * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
  542. symbol warning.
  543. 2015-07-07 Han Shen <shenhan@google.com>
  544. Make gold aarch64 accept long form of mapping symbols.
  545. * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
  546. of mapping symbols.
  547. 2015-06-29 Doug Kwan <dougkwan@google.com>
  548. * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
  549. at address expected by test.
  550. * testsuite/arm_cortex_a8_b.s: Ditto.
  551. * testsuite/arm_cortex_a8_b_cond.s: Ditto.
  552. * testsuite/arm_cortex_a8_bl.s: Ditto.
  553. * testsuite/arm_cortex_a8_blx.s: Ditto.
  554. * testsuite/arm_cortex_a8_local.s: Ditto.
  555. * testsuite/arm_fix_v4bx.s: Ditto.
  556. * testsuite/arm_unaligned_reloc.s: Ditto.
  557. * testsuite/thumb_bl_out_of_range.s: Ditto.
  558. * testsuite/thumb_bl_out_of_range_local.s: Ditto.
  559. * testsuite/thumb_blx_out_of_range.s: Ditto.
  560. 2015-06-29 Han Shen <shenhan@google.com>
  561. Patch for erratum 843419 internal error.
  562. * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
  563. (Erratum_stub::update_erratum_insn): New method.
  564. (Stub_table::relocate_stubs): Modified to place relocated insn.
  565. (AArch64_relobj::fix_errata): Modified gold_assert.
  566. 2015-06-12 Han Shen <shenhan@google.com>
  567. Fix erratum 835769.
  568. * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
  569. defintion outside class definition.
  570. (AArch64_insn_utilities::AARCH64_ZR): New static constant.
  571. (AArch64_insn_utilities::aarch64_op31): New member.
  572. (AArch64_insn_utilities::aarch64_ra): New member.
  573. (AArch64_insn_utilities::aarch64_mac): New member.
  574. (AArch64_insn_utilities::aarch64_mlxl): New member.
  575. (ST_E_835769): New global enum member.
  576. (Stub_table::relocate_stubs): Add 835769 handler.
  577. (Stub_template_repertoire::Stub_template_repertoire): Install new
  578. stub type.
  579. (AArch64_relobj::scan_errata): This func is renamed from
  580. scan_erratum_843419.
  581. (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
  582. (AArch64_relobj::do_relocate_sections): Add 835769 handler.
  583. (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
  584. (Target_aarch64::scan_erratum_835769_span): New method.
  585. (Target_aarch64::create_erratum_stub): New method.
  586. (Target_aarch64::is_erratum_835769_sequence): New method.
  587. (Target_aarch64::scan_erratum_843419_sequence): Move part of the
  588. code into create_erratum_stub.
  589. * options.h (fix_cortex_a53_835769): New option.
  590. 2015-06-11 Cary Coutant <ccoutant@gmail.com>
  591. * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
  592. outside class body.
  593. (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
  594. 2015-06-11 Cary Coutant <ccoutant@gmail.com>
  595. PR gold/17731
  596. * layout.cc (corresponding_uncompressed_section_name): New function.
  597. (Layout::choose_output_section): Call it.
  598. * layout.h (corresponding_uncompressed_section_name): New function.
  599. * script-sections.cc (Input_section_info::set_section_name): Check
  600. for compressed debug section (.zdebug style).
  601. 2015-06-11 Jing Yu <jingyu@google.com>
  602. * testsuite/Makefile.am: Add -O0 for script_test_12 test.
  603. * testsuite/Makefile.in: Regenerate.
  604. 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
  605. * gold.h (is_cident): Correct typo.
  606. 2015-06-10 Han Shen <shenhan@google.com>
  607. Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
  608. Now fixing for 843419 is fully functional.
  609. The first part of the erratum fix CL is here -
  610. https://sourceware.org/ml/binutils/2015-04/msg00229.html
  611. * aarch64.cc(global enum): New constants representing stub types.
  612. (Stub_template): New POD struct.
  613. (Stub_template_repertoire): New class.
  614. (Stub_base): New class.
  615. (Erratum_stub): New class.
  616. (Reloc_stub): Refactored to be a subclass of Stub_base.
  617. (Reloc_stub::Stub_type): Removed.
  618. (Reloc_stub::offset): Moved to Stub_base.
  619. (Reloc_stub::set_offset): Moved to Stub_base.
  620. (Reloc_stub::destination_address): Moved to Stub_base.
  621. (Reloc_stub::set_destination_address): Moved to Stub_base.
  622. (Reloc_stub::reset_destination_address): Moved to Stub_base.
  623. (Reloc_stub::stub_type): Renamed and moved to Stub_base.
  624. (Reloc_stub::stub_size): Renamed and moved to Stub_base.
  625. (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
  626. (Reloc_stub::write): Moved to Stub_base.
  627. (Reloc_stub::invalid_offset): Moved to Stub_base.
  628. (Reloc_stub::invalid_address): Moved to Stub_base.
  629. (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
  630. (Reloc_stub::stub_insns_): Moved to Stub_base.
  631. (Reloc_stub::offset_): Moved to Stub_base.
  632. (Reloc_stub::destination_address_): Moved to Stub_base.
  633. (Stub_table::The_aarch64_relobj): New typedef.
  634. (Stub_table::The_erratum_stub): New typedef.
  635. (Stub_table::The_erratum_stub_less): New typedef.
  636. (Stub_table::The_erratum_stub_set): New typedef.
  637. (Stub_table::The_erratum_stub_set_iter): New typedef.
  638. (Stub_table::empty): Added emptiness testing for erratum stubs.
  639. (Stub_table::add_erratum_stub): New method to add an erratum stub.
  640. (Stub_table::find_erratum_stub): New method.
  641. (Stub_table::find_erratum_stubs_for_input_section): New method.
  642. (Stub_table::erratum_stub_address): New method.
  643. (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
  644. (Stub_table::do_addralign): Modified to handle erratum stubs.
  645. (Stub_table::erratum_stubs_): New member.
  646. (Stub_table::erratum_stub_size_): New member.
  647. (Stub_table::relocate_stubs): Modified to handle erratum stubs.
  648. (Stub_table::do_write): Modified to handle erratum stubs.
  649. (AArch64_relobj::The_erratum_stub): New typedef.
  650. (AArch64_relobj::Erratum_stub_set_iter): New typedef.
  651. (AArch64_relobj::fix_errata): New method.
  652. (Target_aarch64::The_reloc_stub_type): Removed.
  653. (Target_aarch64::The_erratum_stub): New typede.
  654. (AArch64_relocate_functions::construct_b): New method.
  655. 2015-06-08 Nick Clifton <nickc@redhat.com>
  656. * po/fr.po: New French Translation.
  657. 2015-06-07 Cary Coutant <ccoutant@gmail.com>
  658. PR gold/18288
  659. * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
  660. callers. Don't use STT_COMMON to check for common symbols.
  661. (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
  662. symbol that's not in a common section.
  663. * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
  664. common symbols.
  665. 2015-06-04 Cary Coutant <ccoutant@gmail.com>
  666. PR gold/18200
  667. * Makefile.am (diststuff): Add target.
  668. * Makefile.in: Regenerate.
  669. 2015-06-04 Cary Coutant <ccoutant@gmail.com>
  670. PR gold/17498
  671. * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
  672. temporary locals in merge sections.
  673. * options.cc (General_options::parse_discard_all): New method.
  674. (General_options::parse_discard_locals): New method.
  675. (General_options::parse_discard_none): New method.
  676. (General_options::General_options): Initialize discard_locals_.
  677. * options.h (--discard-all): Convert to special option.
  678. (--discard-locals): Likewise.
  679. (--discard-none): New option.
  680. (General_options::discard_all): New method.
  681. (General_options::discard_locals): New method.
  682. (General_options::discard_sec_merge): New method.
  683. (General_options::Discard_locals): New enum.
  684. (General_options::discard_locals_): New data member.
  685. 2015-06-03 Cary Coutant <cary@google.com>
  686. * script-sections.cc (Script_sections::Script_sections): Initialize
  687. segments_created_.
  688. (Script_sections::create_note_and_tls_segments): Set flag when
  689. segments are created.
  690. (Script_sections::expected_segment_count): Count PT_INTERP.
  691. (Script_sections::attach_sections_using_phdrs_clause): Set flag when
  692. segments are created.
  693. * script-sections.h (Script_sections::segments_created_): New data
  694. member.
  695. 2015-06-03 Cary Coutant <ccoutant@gmail.com>
  696. PR gold/15370
  697. * script-sections.cc
  698. (Output_section_element_input::set_section_addresses): When there
  699. are several patterns with no sort spec, put all sections in the same
  700. bin.
  701. * testsuite/Makefile.am (script_test_12): New testcase.
  702. (script_test_12i): New testcase.
  703. * testsuite/Makefile.in: Regenerate.
  704. * testsuite/script_test_12.t: New test linker script.
  705. * testsuite/script_test_12i.t: New test linker script.
  706. * testsuite/script_test_12a.c: New test source file.
  707. * testsuite/script_test_12b.c: New test source file.
  708. 2015-06-02 Cary Coutant <ccoutant@gmail.com>
  709. * nacl.h (Sniff_file): Switch parameters to get_view to get an
  710. aligned view.
  711. 2015-06-03 Cary Coutant <ccoutant@gmail.com>
  712. PR gold/17819
  713. * gold.cc (queue_final_tasks): When --build-id=tree, queue a
  714. separate task to schedule the build id computation.
  715. * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
  716. add Output_file and offset.
  717. (Hash_task::run): Get and release the input views.
  718. (Hash_task::is_runnable): Always return NULL (always runnable).
  719. (Layout::queue_build_id_tasks): Remove.
  720. (Layout::write_build_id): Add array_of_hashes and size_of_hashes
  721. parameters; use them instead of class members.
  722. (Build_id_task_runner::run): New function.
  723. (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
  724. to write_build_id.
  725. * layout.h (Layout::queue_build_id_tasks): Remove.
  726. (Layout::write_build_id): Add array_of_hashes and size_of_hashes
  727. parameters.
  728. (Layout::array_of_hashes_): Remove.
  729. (Layout::size_of_array_of_hashes_): Remove.
  730. (Layout::input_view_): Remove.
  731. (Build_id_task_runner): New class.
  732. (Close_task_runner::Close_task_runner): Add array_of_hashes and
  733. size_of_hashes parameters.
  734. (Close_task_runner::array_of_hashes_): New data member.
  735. (Close_task_runner::size_of_hashes_): New data member.
  736. * testsuite/Makefile.am
  737. (flagstest_compress_debug_sections_and_build_id_tree): New test.
  738. * testsuite/Makefile.in: Regenerate.
  739. 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  740. * merge.cc (get_input_merge_map): Update for data structure change.
  741. (get_or_make_input_merge_map): Update for data structure change.
  742. * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
  743. a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
  744. 2015-05-16 Alan Modra <amodra@gmail.com>
  745. * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
  746. * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
  747. (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
  748. (lis_0): Rename from lis_0_0.
  749. 2015-04-29 Cary Coutant <cary@google.com>
  750. Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  751. * gc.h (Garbage_collection::is_section_garbage): Change Object*
  752. to Relobj*.
  753. (Garbage_collection::add_reference): Likewise.
  754. (Garbage_collection::gc_process_relocs): Likewise. Don't push
  755. object/shndx pair onto *secvec for dynamic objects. Don't follow
  756. relocations pointing to dynamic objects for GC.
  757. * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
  758. (Icf::unfold_section): Likewise.
  759. (Icf::is_section_folded): Likewise.
  760. (Icf::get_folded_section): Likewise.
  761. * icf.h: (Icf::get_folded_section): Likewise.
  762. (Icf::unfold_section): Likewise.
  763. (Icf::is_section_folded): Likewise.
  764. (Icf::section_has_function_pointers): Likewise.
  765. (Icf::set_section_has_function_pointers): Likewise.
  766. * object.h (Section_id): Likewise.
  767. (Const_section_id): Likewise.
  768. * output.cc (Output_section::update_section_layout): Likewise.
  769. * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
  770. Likewise.
  771. * plugin.cc (update_section_order): Likewise.
  772. (unique_segment_for_sections): Likewise.
  773. * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
  774. (Target_powerpc::do_gc_add_reference): Likewise.
  775. (Target_powerpc::gc_process_relocs): Likewise.
  776. (Target_powerpc::do_gc_add_reference): Likewise.
  777. * symtab.cc (Symbol_table::is_section_folded): Likewise.
  778. (Symbol_table::gc_mark_symbol): Likewise.
  779. * symtab.h: (Symbol_table::is_section_folded): Likewise.
  780. * target.h: (Sized_target::gc_add_reference): Likewise.
  781. (Sized_target::do_gc_add_reference): Likewise.
  782. 2015-04-29 Nick Clifton <nickc@redhat.com>
  783. * po/fi.po: Updated Finnish translation.
  784. 2015-04-28 Alan Modra <amodra@gmail.com>
  785. * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
  786. than unsigned int for find_global_entry result temp. Compare
  787. against invalid_address.
  788. (Target_powerpc::do_plt_address_for_global): Likewise.
  789. (Target_powerpc::Relocate::relocate): Likewise. Don't assert
  790. on plt call stub existence for debug info. Do assert for plt
  791. and global entry stub existence if an alloc section.
  792. 2015-04-28 Alan Modra <amodra@gmail.com>
  793. * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
  794. on missing global entry stub due to bogus debug info.
  795. 2015-04-27 Han Shen <shenhan@google.com>
  796. * options.h (--fix-cortex-a53-843419): Rename option.
  797. * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
  798. option.
  799. (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
  800. 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  801. PR gold/18327
  802. * output.cc (Output_section::is_input_address_mapped): Assume a missing
  803. entry is mapped.
  804. * testsuite/Makefile.am: Add the eh_test test.
  805. * testsuite/Makefile.in: Regenerate.
  806. * testsuite/eh_test_a.cc: New test.
  807. * testsuite/eh_test_b.cc: New test.
  808. 2015-04-23 Sriraman Tallam <tmsriram@google.com>
  809. * options.h (--weak-unresolved-symbols): New option.
  810. * symtab.cc (Symbol_table::sized_write_globals): Change symbol
  811. binding to weak with new option.
  812. * symtab.h (is_weak_undefined): Check for new option.
  813. (is_strong_undefined): Check for new option.
  814. * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
  815. * testsuite/Makefile.in: Regenerate.
  816. * testsuite/weak_unresolved_symbols_test.cc: New file.
  817. 2015-04-20 Ian Coolidge <icoolidge@google.com>
  818. * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
  819. GNU_UNIQUE.
  820. 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  821. * gc.cc (Garbage_collection::do_transitive_closure): Use back and
  822. push_back.
  823. * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
  824. * object.cc (Sized_relobj_file::do_layout): Use push_back.
  825. * powerpc.cc (process_gc_mark): Use push_back.
  826. (Target_powerpc::do_gc_mark_symbol): Use push_back.
  827. * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
  828. 2015-04-16 Han Shen <shenhan@google.com>
  829. * aarch64.cc (AArch64_insn_utilities): New utility class.
  830. (AArch64_relobj::Mapping_symbol_position): New struct.
  831. (AArch64_relobj::Mapping_symbol_info): New typedef.
  832. (AArch64_relobj::do_count_local_symbols): New function overriding
  833. parent's implementation.
  834. (AArch64_relobj::mapping_symbol_info_): New member
  835. (AArch64_relobj::scan_erratum_843419): New method.
  836. (Target_aarch64::scan_erratum_843419_span): New method.
  837. (Target_aarch64::is_erratum_843419_sequence): New method.
  838. * options.h (fix_cortex_a53): New option.
  839. 2015-04-09 Cary Coutant <ccoutant@google.com>
  840. * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
  841. in a PIE link.
  842. * testsuite/Makefile.am (tls_pie_test.sh): New test.
  843. * testsuite/Makefile.in: Regenerate.
  844. * testsuite/tls_pie_test.sh: New.
  845. 2015-04-09 Cary Coutant <ccoutant@google.com>
  846. * debug.h (DEBUG_LOCATION): New.
  847. (DEBUG_ALL): Include DEBUG_LOCATION.
  848. (debug_string_to_enum): Add DEBUG_LOCATION.
  849. * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
  850. output to print correct context.
  851. (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
  852. up to 4 more locations at the beginning of the function.
  853. * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
  854. result before sorting list of line numbers.
  855. * testsuite/debug_msg.sh: Allow range of line numbers for
  856. canonical results on optimized code.
  857. 2015-04-07 HC Yen <hc.yen@mediatek.com>
  858. Add AArch32 support for gold linker.
  859. * arm.cc: Add V8 arch combine table.
  860. 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  861. * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
  862. 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  863. * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
  864. to find by using the return value of insert.
  865. 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  866. * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
  867. constructor call.
  868. 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
  869. PR gold/17641
  870. * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
  871. (Target_x86_64::Scan::local): Don't create GOT entry, when we
  872. can convert mov to lea.
  873. (Target_x86_64::Scan::global): Ditto.
  874. (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
  875. %reg to lea foo(%rip), %reg if possible.
  876. * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
  877. * testsuite/x86_64_mov_to_lea1.s: New.
  878. * testsuite/x86_64_mov_to_lea2.s: Ditto.
  879. * testsuite/x86_64_mov_to_lea3.s: Ditto.
  880. * testsuite/x86_64_mov_to_lea4.s: Ditto.
  881. * testsuite/x86_64_mov_to_lea.sh: Ditto.
  882. 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
  883. * configure: Regenerated.
  884. 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
  885. PR gold/17640
  886. * i386.cc (Target_i386::can_convert_mov_to_lea): New.
  887. (Target_i386::Scan::local): Don't create GOT entry, when we
  888. can convert GOT to GOTOFF.
  889. (Target_i386::Scan::global): Ditto.
  890. (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
  891. lea foo@GOTOFF(%reg), %reg if possible.
  892. * testsuite/Makefile.am (i386_mov_to_lea): New test.
  893. * testsuite/i386_mov_to_lea1.s: New.
  894. * testsuite/i386_mov_to_lea2.s: Ditto.
  895. * testsuite/i386_mov_to_lea3.s: Ditto.
  896. * testsuite/i386_mov_to_lea4.s: Ditto.
  897. * testsuite/i386_mov_to_lea5.s: Ditto.
  898. * testsuite/i386_mov_to_lea.sh: Ditto.
  899. 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
  900. * Makefile.am (ZLIB): New.
  901. (ZLIBINC): Likewise.
  902. (AM_CFLAGS): Add $(ZLIBINC).
  903. (AM_CXXFLAGS): Likewise.
  904. (ldadd_varldadd_var): Add $(ZLIB).
  905. (incremental_dump_LDADD): Likewise.
  906. (dwp_LDADD): Likewise.
  907. * compressed_output.cc: Don't check HAVE_ZLIB_H to include
  908. <zlib.h>.
  909. (zlib_compress): Don't check HAVE_ZLIB_H.
  910. (zlib_decompress): Likewise.
  911. * options.h (compress_debug_sections): Likewise.
  912. * configure.ac (AM_CONDITIONAL): Removed.
  913. * testsuite/Makefile.am (ZLIB): New.
  914. (LDADD): Add $(ZLIB).
  915. Don't check HAVE_ZLIB.
  916. * Makefile.in: Regenerated.
  917. * config.in: Likewise.
  918. * configure: Likewise.
  919. * testsuite/Makefile.in: Likewise.
  920. 2015-03-30 Jing Yu <jingyu@google.com>
  921. * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
  922. TLSLD_ADD_DTPREL_LO12_NC.
  923. * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
  924. _TLS_MODULE_BASE_ point to the start of tls segment.
  925. (Target_aarch64::optimize_tls_reloc): Add cases for
  926. R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
  927. R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
  928. (Target_aarch64::Scan::local): Likewise.
  929. (Target_aarch64::Scan::global): Likewise.
  930. (Target_aarch64::Relocate::relocate): Likewise.
  931. (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
  932. subtracting tls segment size from symbol value for TLSLD_*_DTPREL
  933. relocations.
  934. 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  935. * merge.cc (Object_merge_map::add_mapping): call
  936. Object_merge_map::Input_merge_map::add_mapping.
  937. (Object_merge_map::Input_merge_map::add_mapping): New.
  938. (Output_merge_data::do_add_input_section): Call
  939. get_or_make_input_merge_map before a loop.
  940. (Output_merge_string<Char_type>::finalize_merged_data): Call
  941. get_or_make_input_merge_map before a loop.
  942. * merge.h (Object_merge_map): Make Input_merge_map public.
  943. * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
  944. (Relobj::get_or_create_merge_map): New.
  945. * object.h (Relobj::get_or_create_merge_map): New.
  946. 2015-03-24 Alan Modra <amodra@gmail.com>
  947. PR 18147
  948. * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
  949. relocation errors for branches to strong undefined symbols.
  950. 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  951. * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
  952. (Object_merge_map::is_merge_section_for): Remove.
  953. (Object_merge_map::find_merge_section): New.
  954. * merge.h (Object_merge_map::is_merge_section_for): Remove.
  955. (Object_merge_map::find_merge_section): New.
  956. (Object_merge_map::get_input_merge_map): Add a const version.
  957. * object.cc (Relobj::is_merge_section_for): Remove.
  958. (Relobj::find_merge_section): New.
  959. * object.h (Relobj::is_merge_section_for): Remove.
  960. (Relobj::find_merge_section): New.
  961. * output.cc
  962. (Output_section::Input_section::is_merge_section_for): Remove.
  963. (Output_section::add_merge_input_section): Don't call
  964. add_merge_input_section.
  965. (Output_section::find_merge_section): Return const. Use
  966. object->find_merge_section.
  967. (Output_section::build_lookup_maps): Don't build a map for
  968. merge sections.
  969. (Output_section::is_input_address_mapped): Return false if
  970. section is not found.
  971. (Output_section::find_starting_output_address): Use
  972. find_merge_section instead of is_merge_section_for.
  973. (Output_section::add_script_input_section): Don't build a map for
  974. merge sections.
  975. * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
  976. (Output_section_lookup_maps::find_merge_section): Remove.
  977. (Output_section_lookup_maps::add_merge_input_section) Remove.
  978. (Output_section::find_merge_section): Return const.
  979. 2015-03-22 Cary Coutant <cary@google.com>
  980. PR gold/18106
  981. * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
  982. non-SIB form of lea, with nop after the call.
  983. 2015-03-21 Cary Coutant <cary@google.com>
  984. PR gold/14217
  985. * output.cc (Output_segment::is_first_section_relro): Don't ignore
  986. .tdata section.
  987. (Output_segment::set_section_addresses): Don't align size of relro
  988. segment for .tbss.
  989. 2015-03-21 Cary Coutant <cary@google.com>
  990. PR gold/18010
  991. * stringpool.cc (Stringpool_template): Don't optimize if section
  992. alignment is greater than sizeof(char).
  993. 2015-03-21 Cary Coutant <cary@google.com>
  994. PR gold/18048
  995. * script-c.h (script_include_directive): Add first_token parameter.
  996. * script.cc (script_include_directive): Add first_token parameter, and
  997. pass it to read_script_file.
  998. * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
  999. (PARSING_MEMORY_DEF): New tokens.
  1000. (top): Add new productions for INCLUDE files.
  1001. (file_cmd): Replace file_or_sections_cmd with copy of its productions.
  1002. Pass PARSING_LINKER_SCRIPT to script_include_directive.
  1003. (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
  1004. (section_cmd): Pass PARSING_SECTION_CMDS.
  1005. (file_or_sections_cmd): Remove.
  1006. (memory_def): Pass PARSING_MEMORY_DEF.
  1007. * testsuite/Makefile.am (memory_test_2): New test.
  1008. * testsuite/Makefile.in: Regenerate.
  1009. * testsuite/memory_test_inc.t: New script file.
  1010. * testsuite/memory_test_inc_1.t.src: New script file.
  1011. * testsuite/memory_test_inc_2.t.src: New script file.
  1012. * testsuite/memory_test_inc_3.t.src: New script file.
  1013. 2015-03-21 Cary Coutant <cary@google.com>
  1014. * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
  1015. (Sized_relobj_dwo::setup): Build compressed section map.
  1016. (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
  1017. * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
  1018. section map.
  1019. * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
  1020. compressed_sections_ field.
  1021. (build_compressed_section_map): Take Object instead of
  1022. Sized_relobj_file parameter; add decompress_if_needed parameter.
  1023. (Sized_relobj_file::do_find_special_sections): Store compressed
  1024. section map in parent Object.
  1025. (Sized_relobj_file::do_decompressed_section_contents): Move
  1026. implementation to Object::decompressed_section_contents.
  1027. (Sized_relobj_file::do_discard_decompressed_sections): Move
  1028. implementation to Object::discard_decompressed_sections.
  1029. * object.h (build_compressed_section_map): Declare.
  1030. (Object::Object): Add compressed_sections_ field.
  1031. (Object::section_is_compressed): Move implementation here.
  1032. (Object::decompressed_section_contents): De-virtualize.
  1033. (Object::discard_decompressed_sections): De-virtualize.
  1034. (Object::do_section_is_compressed): Delete.
  1035. (Object::do_decompressed_section_contents): Delete.
  1036. (Object::set_compressed_sections): New method.
  1037. (Object::compressed_sections): New method.
  1038. (Object::compressed_sections_): New data member.
  1039. (Compressed_section_info, Compressed_section_map): Move to top of file.
  1040. (Sized_relobj_file::do_section_is_compressed): Delete.
  1041. (Sized_relobj_file::do_decompressed_section_contents): Delete.
  1042. (Sized_relobj_file::do_discard_decompressed_sections): Delete.
  1043. (Sized_relobj_file::compressed_sections_): Move to Object class.
  1044. 2015-03-21 Cary Coutant <ccoutant@google.com>
  1045. PR gold/18152
  1046. * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
  1047. deferred objects.
  1048. 2015-03-11 Cary Coutant <ccoutant@google.com>
  1049. * options.cc (General_options::finalize): Don't allow -z relro
  1050. with incremental linking.
  1051. * testsuite/Makefile.am (incremental_test): Add -z norelro.
  1052. (incremental_test_2): Likewise.
  1053. (incremental_test_3): Likewise.
  1054. (incremental_test_4): Likewise.
  1055. (incremental_test_5): Likewise.
  1056. (incremental_test_6): Likewise.
  1057. (incremental_copy_test): Likewise.
  1058. (incremental_common_test_1): Likewise.
  1059. (incremental_comdat_test_1): Likewise.
  1060. * testsuite/Makefile.in: Regenerate.
  1061. 2015-03-09 Cary Coutant <ccoutant@google.com>
  1062. PR gold/14675
  1063. * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
  1064. return enum indicating whether .eh_frame section is empty, optimizable,
  1065. unrecognized, or an end marker. Adjust explicit instantiations.
  1066. * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
  1067. (Eh_frame::add_ehframe_input_section): Change return type.
  1068. * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
  1069. * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
  1070. to the .eh_frame output section until we see the end marker.
  1071. (Layout::finalize_eh_frame_section): New.
  1072. * layout.h: (Layout::finalize_eh_frame_section): New.
  1073. 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
  1074. * output.cc (Relobj::initialize_input_to_output_map<size>):
  1075. Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
  1076. 2015-03-04 Cary Coutant <ccoutant@google.com>
  1077. * parameters.cc (Parameters::set_target_once): Call
  1078. Target::select_as_default_target just once from here...
  1079. (set_parameters_target): ...instead of from here.
  1080. 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  1081. * ehframe.cc (Cie::set_output_offset): Pass in and use a
  1082. Output_section_data instead of a Merge_map.
  1083. (Eh_frame::Eh_frame): Don't initialize merge_map_.
  1084. (Eh_frame::read_cie): Use add_merge_mapping instead of
  1085. Merge_map::add_mapping.
  1086. (Eh_frame::read_fde): Ditto.
  1087. (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
  1088. (Eh_frame::do_output_offset): Use merge_output_offset istead of
  1089. merge_map_->get_output_offset.
  1090. (Eh_frame::do_is_merge_section_for): Delete.
  1091. * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
  1092. instead of a Merge_map.
  1093. (Cie::set_output_offset): Pass in a Output_section_data instead of a
  1094. Merge_map.
  1095. (Eh_frame::do_is_merge_section_for): Delete.
  1096. (Eh_frame::merge_map_): Delete.
  1097. * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
  1098. and use a Output_section_data instead of a Merge_map.
  1099. (Object_merge_map::add_mapping): Ditto.
  1100. (Object_merge_map::get_output_offset): Remove the merge_map argument.
  1101. (Object_merge_map::is_merge_section_for): Pass in and use a
  1102. Output_section_data instead of a Merge_map.
  1103. (Merge_map): Delete.
  1104. (Output_merge_base::do_output_offset): Use merge_output_offset instead
  1105. of merge_map_.get_output_offset.
  1106. (Output_merge_base::do_is_merge_section_for): Delete.
  1107. (Output_merge_data::do_add_input_section): Use
  1108. object->add_merge_mapping instead of add_mapping.
  1109. (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
  1110. * merge.h (Merge_map): Delete forward declaration.
  1111. (Object_merge_map::add_mapping): Pass in and use a Output_section_data
  1112. instead of a Merge_map.
  1113. (Object_merge_map::get_output_offset): Remove the merge_map argument.
  1114. (Object_merge_map::is_merge_section_for): Pass in and use a
  1115. Output_section_data instead of a Merge_map.
  1116. (Input_merge_map::Object_merge_map::merge_map): Replace with
  1117. output_data.
  1118. (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
  1119. Output_section_data instead of a Merge_map.
  1120. (Merge_map): Delete.
  1121. (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
  1122. (Output_merge_base::do_is_merge_section_for): Delete.
  1123. (Output_merge_base::add_mapping): Delete.
  1124. (Output_merge_base::merge_map_): Delete.
  1125. * object.cc (Relobj::initialize_input_to_output_map): New.
  1126. (Relobj::initialize_input_to_output_map): New.
  1127. (Relobj::merge_output_offset): New.
  1128. (Relobj::is_merge_section_for): New.
  1129. (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
  1130. bits.
  1131. * object.h (Relobj::merge_map): Delete.
  1132. (initialize_input_to_output_map): New.
  1133. (set_merge_map): Delete.
  1134. (add_merge_mapping): New.
  1135. (merge_output_offset): New.
  1136. (is_merge_section_for): New.
  1137. * output.cc (Output_section::Input_section::is_merge_section_for):
  1138. Use object->is_merge_section_for.
  1139. * output.h (Output_section_data::is_merge_section_for): Delete.
  1140. (Output_section_data::do_is_merge_section_for): Delete.
  1141. * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
  1142. Use object->initialize_input_to_output_map.
  1143. (Merged_symbol_value<size>::value_from_output_section): Use
  1144. object->merge_output_offset.
  1145. 2015-03-02 Peter Collingbourne <pcc@google.com>
  1146. Cary Coutant <ccoutant@google.com>
  1147. * output.cc (Output_section::add_merge_input_section): Do not
  1148. attempt to merge sections with an entsize of 0.
  1149. 2015-03-02 Khem Raj <raj.khem@gmail.com>
  1150. * attributes.h (class Output_attributes_section_data ): Add
  1151. do_print_to_mapfile function.
  1152. 2015-02-24 Alan Modra <amodra@gmail.com>
  1153. PR 18010
  1154. * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
  1155. complain if value is not a multiple of four.
  1156. (Target_powerpc::Relocate::relocate): Correct handling of
  1157. R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
  1158. 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
  1159. * configure.ac (default_size): Set to 32 for x32.
  1160. * configure: Regenerated.
  1161. 2015-02-18 Alan Modra <amodra@gmail.com>
  1162. PR 17954
  1163. * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
  1164. visibility.
  1165. 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  1166. * gc.h (Garbage_collection::add_reference): Don't use find.
  1167. 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  1168. * object.cc (write_local_symbols): avoid std::vector copy.
  1169. 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  1170. * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
  1171. 2015-02-09 Mark Wielaard <mjw@redhat.com>
  1172. * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
  1173. DW_LANG_Fortran03 and DW_LANG_Fortran08.
  1174. 2015-02-16 Cary Coutant <ccoutant@google.com>
  1175. PR gold/13577
  1176. PR gold/16992
  1177. * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
  1178. DF_SYMBOLIC if --dynamic-list option is used.
  1179. * options.cc (General_options::finalize): --dynamic-list is not
  1180. mutually exclusive with -Bsymbolic.
  1181. * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
  1182. listed in --dynamic-list.
  1183. * testsuite/Makefile.am (dynamic_list_lib2.so): Add
  1184. -Bsymbolic-functions.
  1185. * testsuite/Makefile.in: Regenerate.
  1186. 2015-02-16 Cary Coutant <ccoutant@google.com>
  1187. PR gold/17971
  1188. * incremental.cc: Remove redundant include of "output.h".
  1189. 2015-02-12 Jing Yu <jingyu@google.com>
  1190. * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
  1191. TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
  1192. New relocation.
  1193. * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
  1194. TLSLE_MOVW_* relocations.
  1195. (Target_aarch64::Scan::global): Likewise.
  1196. (Target_aarch64::Relocate::relocate): Likewise.
  1197. (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
  1198. for new TLSLE_MOVW_* relocations.
  1199. 2015-02-11 Will Newton <will.newton@linaro.org>
  1200. PR gold/13321
  1201. * arm.cc (Target_arm::make_plt_section): Create an ARM
  1202. state mapping symbol at the start of the PLT.
  1203. 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
  1204. * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
  1205. Replace two_file_shared_2.so with two_file_shared_1.so.
  1206. * testsuite/Makefile.in: Regenerated.
  1207. 2015-02-09 Alan Modra <amodra@gmail.com>
  1208. * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
  1209. plugin_test_thin.a and defsym_test.
  1210. * testsuite/Makefile.in: Regenerate.
  1211. 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  1212. * merge.cc (do_add_input_section): Combine loop epilogue into main loop
  1213. body.
  1214. 2015-02-04 Peter Collingbourne <pcc@google.com>
  1215. * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
  1216. forwarding symbols when computing symbol resolution info for plugins.
  1217. * plugin.h (Plugin_manager::symtab): New method.
  1218. (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
  1219. 2015-02-03 Cary Coutant <ccoutant@google.com>
  1220. Peter Collingbourne <pcc@google.com>
  1221. PR gold/15660
  1222. * archive.cc (Thin_archive_object_unlocker): New class.
  1223. (Archive::include_member): Unlock external members of thin archives.
  1224. * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
  1225. (plugin_test_2): Likewise.
  1226. (plugin_test_3): Likewise.
  1227. (plugin_test_4): Likewise.
  1228. (plugin_test_5): Likewise.
  1229. (plugin_test_6): Likewise.
  1230. (plugin_test_7): Likewise.
  1231. (plugin_test_8): Likewise.
  1232. (plugin_test_9): Likewise.
  1233. (plugin_test_10): Likewise.
  1234. (plugin_test_11): New test case.
  1235. * testsuite/Makefile.in: Regenerate.
  1236. * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
  1237. file to decide whether to claim file.
  1238. (all_symbols_read_hook): Likewise.
  1239. * testsuite/plugin_test_1.sh: Adjust expected output.
  1240. * testsuite/plugin_test_2.sh: Likewise.
  1241. * testsuite/plugin_test_3.sh: Likewise.
  1242. * testsuite/plugin_test_6.sh: Likewise.
  1243. * testsuite/plugin_test_tls.sh: Likewise.
  1244. * testsuite/plugin_test_11.sh: New testcase.
  1245. 2015-02-03 Cary Coutant <ccoutant@google.com>
  1246. * descriptors.cc (Descriptors::open): Set artificially-low limit for
  1247. file descriptors when debugging enabled. Add debug output.
  1248. (Descriptors::release): Add debug output.
  1249. (Descriptors::close_some_descriptor): Likewise.
  1250. (Descriptors::close_all): Likewise.
  1251. * fileread.cc (File_read::lock): Likewise.
  1252. (File_read::unlock): Likewise.
  1253. 2015-02-02 Cary Coutant <ccoutant@google.com>
  1254. * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
  1255. executable output file.
  1256. 2015-01-22 Han Shen <shenhan@google.com>
  1257. * arm.cc (Target_arm::Target_arm): Add initialization for new members.
  1258. (Target_arm::do_plt_address_for_global): New method.
  1259. (Target_arm::do_plt_address_for_local): New method.
  1260. (Target_arm::rel_irelative_section): New method.
  1261. (Target_arm::make_data_plt): Add more parameters for plt ctor.
  1262. (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
  1263. (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
  1264. (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
  1265. (Target_arm::Scan::check_non_pic): Add ifunc support.
  1266. (Target_arm::Scan::local): Add ifunc support.
  1267. (Target_arm::Scan::global): Add ifunc support.
  1268. (Target_arm::make_plt_section): New method.
  1269. (Target_arm::make_plt_entry): Change to call to make_plt_section.
  1270. (Target_arm::make_local_ifunc_plt_entry): New method.
  1271. (Target_arm::got_irelative_): New member.
  1272. (Target_arm::rel_irelative_): New member.
  1273. (Target_arm::got_section): Add creation for got_irelative_.
  1274. (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
  1275. (Target_arm::Relocate::relocate): Properly set local ifunc address.
  1276. (Target_arm::do_dynsym_value): Properly set global ifunc address.
  1277. (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
  1278. (Output_data_plt_arm::IRelative_data): New type.
  1279. (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
  1280. (Output_data_plt_arm::add_entry): Add more parameters.
  1281. (Output_data_plt_arm::add_relocation): New method.
  1282. (Output_data_plt_arm::add_local_ifunc_entry): New method.
  1283. (Output_data_plt_arm::rel_irelative): New method.
  1284. (Output_data_plt_arm::entry_count): Modified.
  1285. (Output_data_plt_arm::address_for_global): New method.
  1286. (Output_data_plt_arm::address_for_local): New method.
  1287. (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
  1288. (Output_data_plt_arm::insert_irelative_data): New method.
  1289. (Output_data_plt_arm::irelative_rel_): New member.
  1290. (Output_data_plt_arm::got_): New member.
  1291. (Output_data_plt_arm::got_irelative_): New member.
  1292. (Output_data_plt_arm::irelative_count_): New member.
  1293. (Output_data_plt_arm::IRelative_data_vec): New typedef.
  1294. (Output_data_plt_arm::irelative_data_vec_): New member.
  1295. (Output_data_plt_arm::do_write): Write out irelative entries.
  1296. (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
  1297. more parameters to ctor.
  1298. (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
  1299. more parameters to ctor.
  1300. * output.h (Output_data_reloc::add_local_relative): New method.
  1301. * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
  1302. 2015-01-29 Alan Modra <amodra@gmail.com>
  1303. * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
  1304. and GOT_TLSGD to LE optimization.
  1305. 2015-01-28 Cary Coutant <ccoutant@google.com>
  1306. * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
  1307. for undef TLS symbols.
  1308. (Target_x86_64::Relocate::relocate_tls): Likewise.
  1309. (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
  1310. 2015-01-25 Cary Coutant <ccoutant@google.com>
  1311. * output.cc (Output_segment::set_section_addresses): Fix calculation
  1312. of size of relro segment.
  1313. 2015-01-22 Alan Modra <amodra@gmail.com>
  1314. * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
  1315. condition for need of ifunc plt entry.
  1316. (Target_powerpc::Scan::global <got relocs>): Likewise.
  1317. 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1318. * mips.cc (reloc_high): Add r_sym.
  1319. (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
  1320. reloc_high constructor.
  1321. (Mips_relocate_functions::relgot16_local): Likewise.
  1322. (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
  1323. r_type to decide whether LO16 matches HI16.
  1324. (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
  1325. rello16 and relgot16_local.
  1326. 2015-01-09 Cary Coutant <ccoutant@google.com>
  1327. * layout.cc (Layout::set_segment_offsets): Don't align start of segment
  1328. unless alignment is larger than page size.
  1329. 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
  1330. Cary Coutant <ccoutant@google.com>
  1331. PR gold/17729
  1332. * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
  1333. (DEFAULT_TARGET_X32): Set for x32.
  1334. * x86_64.cc (cmp_insn_32): New.
  1335. (lea_r10_insn_32): Likewise.
  1336. (lea_r11_insn_32): Likewise.
  1337. (cmp_insn_64): Likewise.
  1338. (lea_r10_insn_64): Likewise.
  1339. (lea_r11_insn_64): Likewise.
  1340. (Target_x86_64<size>::do_calls_non_split): Handle x32.
  1341. * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
  1342. (check_DATA): Add split_x32 files.
  1343. (split_x32_[1234n].o): New targets.
  1344. (split_x32_[124]): New targets.
  1345. (split_x32_[1234r].stdout): New targets.
  1346. * testsuite/split_x32.sh: New file.
  1347. * testsuite/split_x32_1.s: Likewise.
  1348. * testsuite/split_x32_2.s: Likewise.
  1349. * testsuite/split_x32_3.s: Likewise.
  1350. * testsuite/split_x32_4.s: Likewise.
  1351. * testsuite/split_x32_n.s: Likewise.
  1352. * configure: Regenerated.
  1353. * testsuite/Makefile.in: Likewise.
  1354. 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
  1355. PR gold/17809
  1356. * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
  1357. x32.
  1358. 2015-01-02 Alan Modra <amodra@gmail.com>
  1359. * version.cc (print_version): Just print current year.
  1360. * dwp.cc (print_version): Likewise.
  1361. 2015-01-01 Alan Modra <amodra@gmail.com>
  1362. Update year range in copyright notice of all files.
  1363. 2014-12-25 Alan Modra <amodra@gmail.com>
  1364. * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
  1365. new enums.
  1366. (Target_arm::merge_object_attributes, ): Likewise.
  1367. 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
  1368. * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
  1369. as hard float only when Tag_ABI_VFP_args is 1, using new enum value
  1370. AEABI_VFP_args_vfp to check that.
  1371. (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
  1372. value and replace hardcoded values by enum values.
  1373. 2014-12-22 Cary Coutant <ccoutant@google.com>
  1374. * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
  1375. 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
  1376. PR gold/14608
  1377. * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
  1378. to "return i * i * 3;".
  1379. 2014-12-16 Cary Coutant <ccoutant@google.com>
  1380. * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
  1381. (Mapfile::print_output_data): Use current_data_size() to avoid
  1382. assert for sections requiring postprocessing; if address is not valid,
  1383. print 0.
  1384. (Mapfile::print_output_section): Use current_data_size(); print note
  1385. that addresses and sizes are before compression.
  1386. 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
  1387. * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
  1388. Cast current_group_size to unsigned long when reporting error.
  1389. 2014-12-10 Jing Yu <jingyu@google.com>
  1390. * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
  1391. (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
  1392. Update error message.
  1393. (Target_aarch64::do_relax): Use absolute value of option
  1394. stub_group_size. Replace local variable with class member
  1395. stub_group_size_.
  1396. 2014-12-04 Alan Modra <amodra@gmail.com>
  1397. * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
  1398. addend of PLTREL24 reloc when not generating a plt stub. Make
  1399. max_branch_offset an "Address".
  1400. (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
  1401. (Target_powerpc::Relocate::relocate): Likewise.
  1402. 2014-12-04 Alan Modra <amodra@gmail.com>
  1403. PR 17670
  1404. * symtab.cc (Symbol::set_undefined): Remove assertion.
  1405. * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
  1406. on symbols defined in discarded sections, instead return false.
  1407. Rearrange params, update all callers.
  1408. (Target_powerpc::Branch_info::make_stub): Don't make stubs for
  1409. branches to syms in discarded sections.
  1410. (Global_symbol_visitor_opd::operator()): Set discarded opd syms
  1411. undefined and flag as discarded.
  1412. (Target_powerpc::Relocate::relocate): Localize variable.
  1413. 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
  1414. PR gold/17675
  1415. * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
  1416. * testsuite/Makefile.in: Regenerated.
  1417. 2014-12-03 Alan Modra <amodra@gmail.com>
  1418. PR 17566
  1419. * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
  1420. when adding dynamic relocations against section symbols.
  1421. 2014-12-01 Dimitry Ivanov <dimitry@google.com>
  1422. * layout.cc (Layout::finish_dynamic_section): When '-z global'
  1423. is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
  1424. * options.h (General_options): New -z option (global).
  1425. 2014-12-01 Cary Coutant <ccoutant@google.com>
  1426. PR gold/17578
  1427. * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
  1428. is given.
  1429. (Layout::create_executable_stack_info): Warn when -z noexecstack is
  1430. given but some inputs require executable stack.
  1431. 2014-11-26 Cary Coutant <ccoutant@google.com>
  1432. * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
  1433. .debug_str_offsets; strip .debug_gnu_pubnames and
  1434. .debug_gnu_pubtypes.
  1435. (lines_only_debug_sections): Strip all four new sections.
  1436. 2014-11-26 Jing Yu <jingyu@google.com>
  1437. * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
  1438. register to be x0 when to relax TLSDESC_LD64_LO12.
  1439. 2014-11-26 Alan Modra <amodra@gmail.com>
  1440. * powerpc.cc (struct Stub_table_owner): New.
  1441. (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
  1442. unsigned int vector. Update all references.
  1443. (powerpc_relobj::set_stub_table): Take an unsigned int param
  1444. rather than a Stub_table. Update callers.
  1445. (Powerpc_relobj::clear_stub_table): New function.
  1446. (Target_powerpc): Add relax_failed_, relax_fail_count_ and
  1447. stub_group_size_ vars.
  1448. (Target_powerpc::new_stub_table): Delete.
  1449. (max_branch_delta): New function, extracted from..
  1450. (Target_powerpc::Relocate::relocate): ..here..
  1451. (Target_powerpc::Branch_info::make_stub): ..and here. Return
  1452. status on whether stub created successfully.
  1453. (Stub_control::Stub_control): Add "no_size_errors" param. Move
  1454. default sizing to..
  1455. (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
  1456. reduce on relax failure.
  1457. (Target_powerpc::group_sections): Add "no_size_errors" param.
  1458. Use stub_group_size_. Set up group info in a temp vector,
  1459. before building Stub_table vector. Account for input sections
  1460. possibly already converted to relaxed sections.
  1461. (Stub_table::init): Delete. Merge into..
  1462. (Stub_table::Stub_table): ..here.
  1463. (Stub_table::can_reach_stub): New function.
  1464. (Stub_table::add_plt_call_entry): Add "from" parameter and
  1465. return true iff stub could be reached.
  1466. (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
  1467. param too.
  1468. (Stub_table::clear_stubs): Add "all" param.
  1469. 2014-11-26 Alan Modra <amodra@gmail.com>
  1470. * powerpc.cc (Stub_control::set_output_and_owner): New function.
  1471. (Target_powerpc::group_sections): Use it.
  1472. 2014-11-25 Cary Coutant <ccoutant@google.com>
  1473. * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
  1474. (Binary_to_elf::write_symbol): Add st_size parameter.
  1475. * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
  1476. 2014-11-25 Cary Coutant <ccoutant@google.com>
  1477. PR gold/17639
  1478. * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
  1479. (Sized_relobj_file::do_layout): Handle deferred sections properly
  1480. during GC pass 1. Don't add reloc sections to deferred list twice.
  1481. * object.h (Sized_relobj_file::is_deferred_layout): New function.
  1482. (Sized_relobj_file::is_deferred_layout_): New data member.
  1483. 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
  1484. PR gold/17619
  1485. * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
  1486. Check PC-relative offset overflow in PLT entry.
  1487. 2014-11-21 Alan Modra <amodra@gmail.com>
  1488. * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
  1489. for undefined weaks.
  1490. 2014-11-20 Alan Modra <amodra@gmail.com>
  1491. * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
  1492. from --stub-group-size parameter divided by 1024.
  1493. (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
  1494. template parameter. Update all uses.
  1495. (Target_powerpc::Relocate::relocate): Rename has_plt_value to
  1496. has_stub_value. Set for long branches. Don't report overflow for
  1497. branch to undefined weak symbols. Print info message on
  1498. overflowing branch to stub.
  1499. 2014-11-20 Alan Modra <amodra@gmail.com>
  1500. * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
  1501. 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
  1502. * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
  1503. entry for R_X86_64_GOTPLT64.
  1504. (Target_x86_64<size>::Relocate::relocate): Update comments for
  1505. R_X86_64_GOTPLT64.
  1506. 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
  1507. * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
  1508. * plugin.h: add lock definition
  1509. 2014-10-29 Han Shen <shenhan@google.com>
  1510. Jing Yu <jingyu@google.com>
  1511. * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
  1512. TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
  1513. TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
  1514. Symbol::TLS_REF.
  1515. * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
  1516. method.
  1517. (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
  1518. (Target_aarch64::tls_ld_to_le): New method.
  1519. (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
  1520. for 64bit targets.
  1521. (Output_data_plt_aarch64::irelative_rel_): New data member.
  1522. (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
  1523. (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
  1524. (Output_data_plt_aarch64::add_relocation): New method.
  1525. (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
  1526. offset. Add got_irelative size to got size.
  1527. (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
  1528. type string with the new typename.
  1529. (AArch64_relocate_functions::update_adr): Replace parameter x with
  1530. immed.
  1531. (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
  1532. (AArch64_relocate_functions::reloc_common): New method.
  1533. (AArch64_relocate_funcsions::rela_general): Extract common part out
  1534. into reloc_common method.
  1535. (AArch64_relocate_functions::rela_general): Likewise.
  1536. (AArch64_relocate_functions::pcrela_general): Likewise.
  1537. (AArch64_relocate_functions::adr): New method.
  1538. (AArch64_relocate_functions::adrp): Calculate immed before calling
  1539. update_adr.
  1540. (AArch64_relocate_functions::adrp): Likewise.
  1541. (AArch64_relocate_functions::movnz): Cast x to SignedW type when
  1542. comparing x to 0. Calculate immed from ~x when x < 0.
  1543. (Target_aarch64::optimize_tls_reloc): Add new cases for
  1544. TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
  1545. TLSLD_MOVW_DTPREL_G0_NC.
  1546. (Target_aarch64::possible_function_pointer_reloc): Implement this
  1547. method.
  1548. (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
  1549. comment.
  1550. (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
  1551. symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
  1552. TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
  1553. (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
  1554. symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
  1555. TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
  1556. (Target_aarch64::make_plt_entry): Call add_entry with two more
  1557. parameters.
  1558. (Target_aarch64::make_local_ifunc_plt_entry): New method.
  1559. (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
  1560. ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
  1561. TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
  1562. (Target_aarch64::Relocate::relocate_tls): Add cases for
  1563. TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
  1564. TLSLD_MOVW_DTPREL_G0_NC.
  1565. * testsuite/icf_safe_so_test.cc: Correct test comment.
  1566. * testsuite/icf_safe_test.sh: Add AArch64 arch.
  1567. 2014-10-22 Alan Modra <amodra@gmail.com>
  1568. * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
  1569. thread_starter.
  1570. 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
  1571. * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
  1572. 2014-10-17 Cary Coutant <ccoutant@google.com>
  1573. * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
  1574. Add "typename" keyword.
  1575. 2014-10-15 Han Shen <shenhan@google.com>
  1576. Jing Yu <jingyu@google.com>
  1577. Patch for gold aarch64 backend to support relaxation.
  1578. * aarch64-reloc.def: Change format.
  1579. * aarch64.cc (class Reloc_stub): New class.
  1580. (class Stub_table): New class.
  1581. (class AArch64_relobj): New class.
  1582. (class AArch64_input_section): New class.
  1583. (class AArch64_output_section): New class.
  1584. (Target_aarch64::new_stub_table): New method.
  1585. (Target_aarch64::new_aarch64_input_section): New method.
  1586. (Target_aarch64::find_aarch64_input_section): New method.
  1587. (Target_aarch64::scan_section_for_stubs): New method.
  1588. (Target_aarch64::scan_reloc_section_for_stubs): New method.
  1589. (Target_aarch64::relocate_stub): New method.
  1590. (Target_aarch64::current_target): New method.
  1591. (Target_aarch64::do_make_elf_object): New method.
  1592. (Target_aarch64::do_may_relax): New method.
  1593. (Target_aarch64::do_relax): New method.
  1594. (Target_aarch64::group_sections): New method.
  1595. (Target_aarch64::scan_reloc_for_stub): New method.
  1596. (Target_aarch64::do_make_output_section): New method.
  1597. (Target_aarch64::stub_tables_): New data member.
  1598. (Target_aarch64::aarch64_input_section_map_): New data member.
  1599. (AArch64_relocate_functions::maybe_apply_stub): New method.
  1600. 2014-09-30 Cary Coutant <ccoutant@google.com>
  1601. PR gold/17432
  1602. * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
  1603. 2014-09-30 Kito Cheng <kito@0xlab.org>
  1604. PR gold/13597
  1605. * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
  1606. hash table before sysv-style hash table.
  1607. 2014-09-29 Sriraman Tallam <tmsriram@google.com>
  1608. * options.h (--pic-executable): Add negative to alias to -no-pie.
  1609. 2014-09-26 Cary Coutant <ccoutant@google.com>
  1610. PR gold/16773
  1611. * object.cc (Sized_relobj_file): Compute value of section symbols
  1612. for TLS sections the same as TLS symbols.
  1613. 2014-09-25 Cary Coutant <ccoutant@google.com>
  1614. PR gold/17432
  1615. * resolve.cc (Symbol_table::resolve): Override common placeholder
  1616. symbols, but adjust sizes.
  1617. * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
  1618. symbols to common lists.
  1619. 2014-09-24 Alan Modra <amodra@gmail.com>
  1620. * po/POTFILES.in: Regenerate.
  1621. 2014-09-23 Taiju Tsuiki <tzik@google.com>
  1622. Cary Coutant <ccoutant@google.com>
  1623. PR gold/14860
  1624. * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
  1625. on input_sections_blocker.
  1626. * layout.cc (Write_sections_task::locks): Unblock
  1627. input_sections_blocker_.
  1628. * layout.h (Write_sections_task::Write_sections_task): Add
  1629. input_sections_blocker.
  1630. * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
  1631. to DEPENDENCIES.
  1632. * testsuite/Makefile.in: Regenerate.
  1633. 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  1634. * testsuite/Makefile.am (plugin_test_10): New test.
  1635. * testsuite/Makefile.in: Regenerate
  1636. * testsuite/plugin_common_test_2.c (c1): Align to 8.
  1637. * testsuite/plugin_test_10.sh: New file.
  1638. 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  1639. * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
  1640. * resolve.cc (Symbol_table::resolve): Don't override common symbols
  1641. during the replacement phase.
  1642. 2014-09-17 Han Shen <shenhan@google.com>
  1643. Jing Yu <jingyu@google.com>
  1644. * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
  1645. TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
  1646. * aarch64.cc (Target_aarch64): Add data members
  1647. got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
  1648. tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
  1649. constructor.
  1650. (Target_aarch64::do_reloc_symbol_index): New method.
  1651. (Target_aarch64::do_reloc_addend): New method.
  1652. (Target_aarch64::add_tlsdesc_info): New method.
  1653. (Target_aarch64::do_dynsym_value): New method.
  1654. (Target_aarch64::do_make_data_plt): Add new parameters: got,
  1655. got_irelative. Pass them to Output_data_plt_aarch64_standard.
  1656. (Target_aarch64::make_data_plt): Add new parameters: got,
  1657. got_irelative. Pass them to do_make_data_plt.
  1658. (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
  1659. (Target_aarch64::Relocate:tls_gd_to_le): New method.
  1660. (Target_aarch64::Relocate:tls_ie_to_le): New method.
  1661. (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
  1662. (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
  1663. (Target_aarch64::got_tlsdesc_section): New method.
  1664. (Target_aarch64::make_local_ifunc_plt_entry): New method.
  1665. (Target_aarch64::define_tls_base_symbol): New method.
  1666. (Target_aarch64::reserve_tlsdesc_entries): New method.
  1667. (Target_aarch64::got_mod_index_entry): New method.
  1668. (Target_aarch64::rela_tlsdesc_section): New method.
  1669. (Target_aarch64::rela_irelative_section): New method.
  1670. (Target_aarch64::Tlsdesc_info): New struct.
  1671. (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
  1672. relocations and tlsdesc relocations.
  1673. (Target_aarch64::optimize_tls_reloc): Implement method.
  1674. (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
  1675. got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
  1676. in constructor.
  1677. (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
  1678. (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
  1679. (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
  1680. (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
  1681. (Output_data_plt_aarch64::rela_tlsdesc): New method.
  1682. (Output_data_plt_aarch64::rela_irelative): New method.
  1683. (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
  1684. (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
  1685. (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
  1686. (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
  1687. (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
  1688. (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
  1689. (Output_data_plt_aarch64_standard): New member variables:
  1690. plt_tlsdesc_entry_size, tlsdesc_plt_entry.
  1691. (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
  1692. New parameter: got, got_irelative.
  1693. (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
  1694. (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
  1695. (Output_data_plt_aarch64::do_write): Replace got_address with
  1696. gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
  1697. (AArch64_relocate_functions::update_movnz): New method.
  1698. (AArch64_relocate_functions): Correct format.
  1699. (AArch64_relocate_functions::movnz): New method.
  1700. (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
  1701. before the switch. Add new cases to switch.
  1702. Check ie_to_le relaxation on tlsie relocations. Add code handling
  1703. tlsgd tlsdesc cases.
  1704. (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
  1705. needed. Add new cases to switch. Insert dynamic RELATIVE relocation
  1706. when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
  1707. Call reloc_name_in_error_message to print unsupported reloc.
  1708. (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
  1709. make_data_plt.
  1710. (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
  1711. relocs. Fill in some more dynamic tags.
  1712. (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
  1713. Skip call tls_get_addr when tlsgd is relaxed.
  1714. (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
  1715. handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
  1716. tlsdesc->ie relaxation.
  1717. 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1718. * mips.cc (Target_mips_nacl): New class.
  1719. (Target_selector_mips_nacl): New class.
  1720. (target_selector_mips32): Rename from target_selector_mips32be and use
  1721. Target_selector_mips_nacl instead of Target_selector_mips.
  1722. (target_selector_mips32el): Rename from target_selector_mips32 and use
  1723. Target_selector_mips_nacl instead of Target_selector_mips.
  1724. (target_selector_mips64): Rename from target_selector_mips64be and use
  1725. Target_selector_mips_nacl instead of Target_selector_mips.
  1726. (target_selector_mips64el): Rename from target_selector_mips64 and use
  1727. Target_selector_mips_nacl instead of Target_selector_mips.
  1728. (Target_mips::mips_info): Add const attribute.
  1729. 2014-09-02 Cary Coutant <ccoutant@google.com>
  1730. * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
  1731. * dynobj.h (Sized_dynobj::do_section_name): Likewise.
  1732. * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
  1733. (Sized_incr_dynobj::do_section_name): Likewise.
  1734. * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
  1735. (Sized_incr_dynobj::do_section_name): Likewise.
  1736. * object.h (Object::section_name): Likewise.
  1737. (Object::do_section_name): Likewise.
  1738. (Sized_relobj_file::do_section_name): Likewise.
  1739. * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
  1740. * plugin.h (Sized_pluginobj::do_section_name): Likewise.
  1741. 2014-09-02 Cary Coutant <ccoutant@google.com>
  1742. PR gold/17005
  1743. * ehframe.cc (Fde::write): Add output_offset parameter.
  1744. (Cie::write): Likewise.
  1745. (Eh_frame::set_final_data_size): Account for offset within output
  1746. section.
  1747. (Eh_frame::do_sized_write): Likewise.
  1748. * ehframe.h (Fde::write): Add output_offset parameter.
  1749. (Cie::write): Likewise.
  1750. * output.cc (Output_section::Input_section_sort_entry): Remove
  1751. section_has_name_; add output_section_name parameter. Use
  1752. output section name for non-input sections.
  1753. (Output_section::Input_section_sort_entry::section_has_name): Remove.
  1754. (Output_section::Input_section_sort_entry::section_has_name_): Remove.
  1755. (Output_section::Input_section_sort_compare): Remove logic for
  1756. sections without names.
  1757. (Output_section::Input_section_sort_init_fini_compare): Likewise.
  1758. (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
  1759. Likewise.
  1760. (Output_section::Input_section_sort_section_name_compare): Likewise.
  1761. 2014-08-29 Han Shen <shenhan@google.com>
  1762. Jing Yu <jingyu@google.com>
  1763. * aarch64-reloc-property.cc
  1764. (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
  1765. reference reloc property in the table.
  1766. * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
  1767. 3 other entries.
  1768. * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
  1769. 2 new overloaded methods.
  1770. (Output_data_got_aarch64::do_write): Add code to write out
  1771. static relocs.
  1772. (class Output_data_got_aarch64::Static_reloc): New class to wrap
  1773. static relocs.
  1774. (Output_data_got_aarch64::static_relocs): New vector to
  1775. hold static relocs.
  1776. (Target_aarch64::TCB_SIZE): New const static memeber.
  1777. (Target_aarch64::tcb_size): New method.
  1778. (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
  1779. (Target_aarch64::Relocate::relocate_tls): New method.
  1780. (Target_aarch64::Scan::local): Add code handling new reloc types.
  1781. (Target_aarch64::Scan::global): Add code handling new reloc types.
  1782. 2014-08-13 Sriraman Tallam <tmsriram@google.com>
  1783. * options.h (-no-pie): Add option.
  1784. 2014-08-08 Jing Yu <jingyu@google.com>
  1785. Han Shen <shenhan@google.com>
  1786. * Makefile.am (HFILES): Add aarch64-reloc-property.h.
  1787. (DEFFILES): add aarch64-reloc.def.
  1788. (TARGETSOURCES): Add aarch64-reloc-property.cc.
  1789. (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
  1790. * Makefile.in: Regenerate.
  1791. * aarch64-reloc-property.cc: New file.
  1792. * aarch64-reloc-property.h: New file.
  1793. * aarch64-reloc.def: New file.
  1794. * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
  1795. with tab to make the format consistent.
  1796. (Output_data_got_aarch64::symbol_table_): New method.
  1797. (Target_aarch64::do_plt_address_for_global): New method.
  1798. (Target_aarch64::do_plt_address_for_local): New method.
  1799. (Target_aarch64::do_select_as_default_target): New method.
  1800. (Target_aarch64::do_make_data_plt): New method.
  1801. (Target_aarch64::make_data_plt): New method.
  1802. (Output_data_plt_aarch64::has_irelative_section): New method.
  1803. (Output_data_plt_aarch64::address_for_global): New method.
  1804. (Output_data_plt_aarch64::address_for_local): New method.
  1805. (Output_data_plt_aarch64::irelative_rel_): New parameter.
  1806. (Output_data_plt_aarch64::add_entry): Implement contents.
  1807. (Output_data_plt_aarch64::set_final_data_size): Fix typo.
  1808. (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
  1809. the got_pov entry to plt0.
  1810. (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
  1811. Implement contents.
  1812. (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
  1813. (AArch64_howto): New struct.
  1814. (aarch64_howto[]): New static const array.
  1815. (AArch64_relocate_functions): New class.
  1816. (Target_aarch64::Scan::get_reference_flags): Remove method.
  1817. (Target_aarch64::Scan::local): Implement to support a few relocations.
  1818. (Target_aarch64::Scan::global): Implement to support a few relocations.
  1819. (Target_aarch64::make_plt_section): Implement contents.
  1820. (Target_aarch64::make_plt_entry): Implement contents.
  1821. (Target_aarch64::do_finalize_sections): Implement contents.
  1822. (Target_aarch64::Relocate::relocate): Implement a few relocations.
  1823. (Target_aarch64::relocate_section): Implement contents.
  1824. 2014-08-06 Alan Modra <amodra@gmail.com>
  1825. * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
  1826. 2014-08-06 Alan Modra <amodra@gmail.com>
  1827. PR 13227
  1828. * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
  1829. 2014-07-21 Sriraman Tallam <tmsriram@google.com>
  1830. * object.cc (Relobj::is_section_name_included): Add
  1831. ".rodata.nptl_version" to not garbage collect this section.
  1832. 2014-07-08 Cary Coutant <ccoutant@google.com>
  1833. * expression.cc (struct Expression::Expression_eval_info): Add
  1834. new fields type_pointer, vis_pointer, and nonvis_pointer.
  1835. (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
  1836. nonvis_pointer parameters. Adjust all calls.
  1837. (Symbol_expression::value): Update type, visibility, and nonvis bits
  1838. in caller.
  1839. * script.cc (Symbol_assignment::sized_finalize): Update type,
  1840. visibility, and remaining st_other bits for new symbol.
  1841. * script.h: (Expression::eval_maybe_dot): Add type_pointer,
  1842. vis_pointer, and nonvis_pointer parameters.
  1843. * symtab.h (Symbol::set_type): New method.
  1844. * testsuite/Makefile.am (defsym_test): New test.
  1845. * testsuite/Makefile.in: Regenerate.
  1846. * testsuite/defsym_test.c: New file.
  1847. * testsuite/defsym_test.sh: New file.
  1848. 2014-07-08 Cary Coutant <ccoutant@google.com>
  1849. PR gold/15639
  1850. * dynobj.h (Sized_dynobj::base_read_symbols): New method.
  1851. * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
  1852. (Sized_dynobj::base_read_symbols): ...new method.
  1853. * object.h (Sized_relobj_file::base_read_symbols): New method.
  1854. * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
  1855. (Sized_relobj_file::base_read_symbols): ...new method.
  1856. * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
  1857. * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
  1858. * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
  1859. 2014-07-04 Alan Modra <amodra@gmail.com>
  1860. * po/POTFILES.in: Regenerate.
  1861. 2014-07-02 Jing Yu <jingyu@google.com>
  1862. * aarch64.cc: New file
  1863. * Makefile.am (TARGETSOURCES): Add aarch64.cc
  1864. (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
  1865. * Makefile.in: Regenerate.
  1866. * configure.tgt: Add entries for aarch64*.
  1867. * configure.ac: Likewise.
  1868. * configure: Likewise.
  1869. 2014-06-27 Alan Modra <amodra@gmail.com>
  1870. * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
  1871. 2014-06-24 Cary Coutant <ccoutant@google.com>
  1872. * dwp.cc (Dwo_file::read): Allow files with no .debug_types
  1873. sections.
  1874. (Dwo_file::sized_read_unit_index): Likewise.
  1875. 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1876. * mips.cc: New file.
  1877. * Makefile.am (TARGETSOURCES): Add mips.cc
  1878. (ALL_TARGETOBJS): Add mips.$(OBJEXT)
  1879. * configure.tgt: Add entries for mips*.
  1880. * configure.ac: Likewise.
  1881. * Makefile.in: Regenerate.
  1882. * configure: Likewise.
  1883. 2014-06-09 Cary Coutant <ccoutant@google.com>
  1884. * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
  1885. unit_length is within section bounds.
  1886. 2014-06-09 Cary Coutant <ccoutant@google.com>
  1887. PR gold/16980
  1888. * layout.cc (Layout::print_to_mapfile): Print unattached sections in
  1889. map.
  1890. 2014-06-07 Alan Modra <amodra@gmail.com>
  1891. * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
  1892. 2014-06-06 Cary Coutant <ccoutant@google.com>
  1893. * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
  1894. * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
  1895. (Dwarf_pubnames_table::read_header): Likewise.
  1896. * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
  1897. .debug_gnu_pubtypes.
  1898. 2014-06-05 Joel Brobecker <brobecker@adacore.com>
  1899. * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
  1900. * Makefile.in, configure: Regenerate.
  1901. 2014-06-03 Alan Modra <amodra@gmail.com>
  1902. * powerpc.cc (addis_12_2): Define.
  1903. (Stub_table::do_write): Support fusion on ELFv2 stubs.
  1904. 2014-06-03 Alan Modra <amodra@gmail.com>
  1905. * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
  1906. st_other output.
  1907. 2014-06-02 Alan Modra <amodra@gmail.com>
  1908. * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
  1909. Only ignore relocs on ELFv1.
  1910. (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
  1911. 2014-05-30 Cary Coutant <ccoutant@google.com>
  1912. * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
  1913. * testsuite/Makefile.in: Regenerate.
  1914. * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
  1915. 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
  1916. PR gold/16945
  1917. * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
  1918. for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
  1919. 2014-05-15 Alan Modra <amodra@gmail.com>
  1920. * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
  1921. Compare FDE contents with DW_CFA_nop rather than 0.
  1922. 2014-05-13 Sriraman Tallam <tmsriram@google.com>
  1923. * symtab.h (may_need_copy_reloc): Remove check for position independent
  1924. code.
  1925. * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
  1926. position independence before pc absolute may_need_copy_reloc call.
  1927. Add check for executable output befor pc relative may_need_copy_reloc
  1928. call.
  1929. * i386.cc: Ditto.
  1930. * arm.cc: Ditto.
  1931. * sparc.cc: Ditto.
  1932. * tilegx.cc: Ditto.
  1933. * powerpc.cc: Add check for no position independence before
  1934. may_need_copy_reloc calls.
  1935. * testsuite/pie_copyrelocs_test.cc: New file.
  1936. * testsuite/pie_copyrelocs_shared_test.cc: New file.
  1937. * Makefile.am (pie_copyrelocs_test): New test.
  1938. * Makefile.in: Regenerate.
  1939. 2014-05-08 Martin Liška <mliska@suse.cz>
  1940. * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
  1941. 2014-05-06 Cary Coutant <ccoutant@google.com>
  1942. PR gold/16900
  1943. * i386.cc (Output_data_got_plt_i386): New class.
  1944. (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
  1945. parameter. Change all callers.
  1946. (Output_data_plt_i386::layout_): Remove.
  1947. (Output_data_plt_i386::got_plt_): Change type.
  1948. (Target_i386::got_plt_): Change type. Change all references.
  1949. (Target_i386::got_section): Create instance of new class.
  1950. (Output_data_got_plt_i386::do_write): New function.
  1951. * x86_64.cc (Output_data_got_plt_x86_64): New class.
  1952. (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
  1953. parameter. Change all callers.
  1954. (Output_data_plt_x86_64::layout_): Remove.
  1955. (Output_data_plt_x86_64::got_plt_): Change type.
  1956. (Target_x86_64::got_plt_): Change type. Change all references.
  1957. (Target_x86_64::got_section): Create instance of new class.
  1958. (Output_data_got_plt_x86_64::do_write): New function.
  1959. (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
  1960. (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
  1961. class.
  1962. 2014-05-05 Cary Coutant <ccoutant@google.com>
  1963. * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
  1964. if we have pubnames/pubtypes.
  1965. 2014-05-02 Cary Coutant <ccoutant@google.com>
  1966. * defstd.cc (in_segment): Define __ehdr_start here...
  1967. * layout.cc (Layout::finalize): ...Instead of here. Set the
  1968. output segment when known.
  1969. * resolve.cc (Symbol::override_base_with_special): Remember
  1970. the original binding.
  1971. * symtab.cc (Symbol::set_output_segment): New function.
  1972. (Symbol::set_undefined): New function.
  1973. * symtab.h (Symbol::is_weak_undefined): Check original undef
  1974. binding.
  1975. (Symbol::is_strong_undefined): New function.
  1976. (Symbol::set_output_segment): New function.
  1977. (Symbol::set_undefined): New function.
  1978. * target-reloc.h (is_strong_undefined): Remove.
  1979. (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
  1980. Check for hidden undefs.
  1981. (relocate_section): Call Symbol::is_strong_undefined.
  1982. * testsuite/Makefile.am (ehdr_start_test_1)
  1983. (ehdr_start_test_2, ehdr_start_test_3)
  1984. (ehdr_start_test_4, ehdr_start_test_5): New test cases.
  1985. * testsuite/Makefile.in: Regenerate.
  1986. * testsuite/ehdr_start_def.cc: New source file.
  1987. * testsuite/ehdr_start_test.cc: New source file.
  1988. * testsuite/ehdr_start_test.t: New linker script.
  1989. * testsuite/ehdr_start_test_4.sh: New shell script.
  1990. 2014-04-23 Cary Coutant <ccoutant@google.com>
  1991. PR gold/16870
  1992. * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
  1993. 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1994. * layout.cc (Layout::include_section): Allow a target to decide
  1995. whether to include a section.
  1996. * target.h (Target::should_include_section): New function.
  1997. (Target::do_should_include_section): New function.
  1998. 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1999. * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
  2000. inline into ...
  2001. (Copy_relocs::emit): ... here.
  2002. * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
  2003. (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
  2004. (Copy_reloc_entry::entries_): Change from private to protected.
  2005. 2014-04-02 Sriraman Tallam <tmsriram@google.com>
  2006. * icf.cc (get_section_contents): Replace copies of reloc
  2007. vectors with const references.
  2008. 2014-04-02 Cary Coutant <ccoutant@google.com>
  2009. * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
  2010. (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
  2011. * configure: Regenerate.
  2012. * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
  2013. -fno-use-linker-plugin.
  2014. (LINK1, CXXLINK1): Add it to the link command.
  2015. * testsuite/Makefile.in: Regenerate.
  2016. 2014-03-12 Alan Modra <amodra@gmail.com>
  2017. * Makefile.in: Regenerate.
  2018. 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  2019. * symtab.h (Symbol::set_nonvis): New function.
  2020. 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  2021. * symtab.cc (Sized_symbol<32>::init_output_data):
  2022. Instantiate the template.
  2023. (Sized_symbol<64>::init_output_data): Likewise.
  2024. 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  2025. * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
  2026. adjust dynamic symbol value.
  2027. * target.h (Target::adjust_dyn_symbol): New function.
  2028. (Target::do_adjust_dyn_symbol): New function.
  2029. 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  2030. * output.cc (Output_data_dynamic::Dynamic_entry::write):
  2031. Get the value of DYNAMIC_CUSTOM dynamic entry.
  2032. * output.h (Output_data_dynamic::add_custom): New function.
  2033. (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
  2034. dynamic entry.
  2035. (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
  2036. * target.h (Target::dynamic_tag_custom_value): New function.
  2037. (Target::do_dynamic_tag_custom_value): New function.
  2038. 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  2039. * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
  2040. dynsym indexes.
  2041. * target.h (Target::has_custom_set_dynsym_indexes): New function.
  2042. (Target::do_has_custom_set_dynsym_indexes): New function.
  2043. (Target::set_dynsym_indexes): New function.
  2044. (Target::do_set_dynsym_indexes): New function.
  2045. 2014-03-07 Alan Modra <amodra@gmail.com>
  2046. * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
  2047. CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
  2048. (Powerpc_relocate_functions::has_overflow_unsigned): New function.
  2049. (Powerpc_relocate_functions::has_overflow_bitfield,
  2050. overflowed): Use the above.
  2051. (Target_powerpc::Relocate::relocate): Correct overflow checking
  2052. for a number of relocations. Modify overflow test for 16-bit
  2053. fields in instructions to signed/unsigned according to whether
  2054. the field takes a signed or unsigned value.
  2055. 2014-03-05 Alan Modra <amodra@gmail.com>
  2056. Update copyright years.
  2057. 2014-03-05 Alan Modra <amodra@gmail.com>
  2058. * powerpc.cc (Target_powerpc::Scan::local, global): Support
  2059. R_PPC64_ADDR64_LOCAL.
  2060. (Target_powerpc::Relocate::relocate): Likewise.
  2061. 2014-03-03 Alan Modra <amodra@gmail.com>
  2062. * dwp.cc (print_version): Update copyright year to current.
  2063. 2014-02-10 Alan Modra <amodra@gmail.com>
  2064. * po/gold.pot: Regenerate.
  2065. 2014-02-06 Cary Coutant <ccoutant@google.com>
  2066. Fix problem where -u is ignored when a weak undef is seen.
  2067. * archive.cc (Library_base::should_include_member): Reorder
  2068. code to check for -u option if a weak undef has already been seen.
  2069. * testsuite/Makefile.am (weak_undef_test_2): New test case.
  2070. * testsuite/Makefile.in: Regenerate.
  2071. * testsuite/weak_undef_file3.cc: New file.
  2072. * testsuite/weak_undef_file4.cc: New file.
  2073. * testsuite/weak_undef_test_2.cc: New file.
  2074. 2014-02-05 Cary Coutant <ccoutant@google.com>
  2075. Fix issues with gold undefined symbol diagnostics.
  2076. PR binutils/15435
  2077. * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
  2078. check to here.
  2079. * target-reloc.h (is_strong_undefined): New function.
  2080. (relocate_section): Move undef vtable symbol check from here.
  2081. Check for is_strong_undefined.
  2082. 2014-02-05 Cary Coutant <ccoutant@google.com>
  2083. Fix problems with the --dynamic-list option.
  2084. PR gold/13577
  2085. * options.cc (General_options::parse_dynamic_list):
  2086. Set have_dynamic_list_.
  2087. (General_options::General_options): Initialize have_dynamic_list_.
  2088. (General_options::finalize): Turn off -Bsymbolic and
  2089. -Bsymbolic-functions if --dynamic-list provided.
  2090. * options.h (General_options::have_dynamic_list): New function.
  2091. (General_options::have_dynamic_list_): New data member.
  2092. * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
  2093. correctly.
  2094. PR gold/16530
  2095. * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
  2096. in --dynamic-list, mark it.
  2097. * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
  2098. (dynamic_list_2): New test case.
  2099. * testsuite/Makefile.in: Regenerate.
  2100. * testsuite/dynamic_list_2.cc: New file.
  2101. * testsuite/dynamic_list_2.t: New file.
  2102. * testsuite/dynamic_list_lib1.cc: New file.
  2103. * testsuite/dynamic_list_lib2.cc: New file.
  2104. * testsuite/gc_dynamic_list_test.c: New file.
  2105. * testsuite/gc_dynamic_list_test.sh: New file.
  2106. * testsuite/gc_dynamic_list_test.t: New file.
  2107. 2014-01-28 Cary Coutant <ccoutant@google.com>
  2108. Add .gdb_index version 7 support.
  2109. * dwarf_reader.cc: include <utility> (for make_pair).
  2110. (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
  2111. debug sections.
  2112. (Dwarf_ranges_table::read_ranges_table): Likewise.
  2113. (Dwarf_pubnames_table::read_section): Check for GNU-style
  2114. sections, and for compressed debug sections.
  2115. (Dwarf_pubnames_table::read_header): Compute end address of table.
  2116. (Dwarf_pubnames_table::next_name): Return flag_byte. Check
  2117. for end of list by offset, not by offset == 0.
  2118. (Dwarf_info_reader::do_read_string_table): Check for compressed
  2119. debug sections.
  2120. * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
  2121. Initialize new data members.
  2122. (Dwarf_pubnames_table::next_name): return flag_byte.
  2123. (Dwarf_pubnames_table::end_of_table_): New data member.
  2124. (Dwarf_pubnames_table::is_gnu_style_): New data member.
  2125. * gdb-index.cc (gdb_index_version): Update to version 7.
  2126. (Gdb_index_info_reader::read_pubtable): Read flag_byte.
  2127. (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
  2128. read skeleton type unit DIEs.
  2129. (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
  2130. (Gdb_index::do_write): Write flag_byte.
  2131. * gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
  2132. (Gdb_index::Cu_vector): Store flags along with cu indexes.
  2133. * testsuite/gdb_index_test_3.sh: Allow versions 4-7.
  2134. * testsuite/gdb_index_test_comm.sh: Likewise.
  2135. 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
  2136. * version.cc (print_version): Update copyright year to 2014.
  2137. 2013-12-19 Dimitry Andric <dimitry@andric.com>
  2138. * stringpool.cc (Stringpool_template::reserve): Add
  2139. HAVE_UNORDERED_MAP case.
  2140. * stringpool.cc (Stringpool_template::print_stats): Likewise.
  2141. 2013-12-18 Cary Coutant <ccoutant@google.com>
  2142. * configure.ac: Check for <unordered_set> and <unordered_map>.
  2143. * config.in: Regenerate.
  2144. * configure: Regenerate.
  2145. * system.h: Use <unordered_set> and <unordered_map> if available.
  2146. 2013-12-10 Roland McGrath <mcgrathr@google.com>
  2147. * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
  2148. with $(INSTALL_PROGRAM_ENV).
  2149. * Makefile.in: Regenerate.
  2150. 2013-11-22 Cary Coutant <ccoutant@google.com>
  2151. * configure.ac: Add check for which library is needed for
  2152. dlopen.
  2153. * configure: Regenerate.
  2154. 2013-11-22 Cary Coutant <ccoutant@google.com>
  2155. * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
  2156. assembler.
  2157. * testsuite/Makefile.in: Regenerate.
  2158. 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
  2159. * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
  2160. Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
  2161. R_X86_64_PC32 and R_X86_64_PLT32, respectively.
  2162. (Target_x86_64<size>::Scan::local): Likewise.
  2163. (Target_x86_64<size>::Scan::global): Likewise.
  2164. (Target_x86_64<size>::Relocate::relocate): Likewise.
  2165. (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
  2166. Likewise.
  2167. (Target_x86_64<size>::Scan::check_non_pic(): Handle
  2168. R_X86_64_PC32_BND.
  2169. * testsuite/Makefile.am (check_PROGRAMS): Add
  2170. exception_x86_64_bnd_test.
  2171. (exception_x86_64_bnd_test_SOURCES): New macro.
  2172. (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
  2173. (exception_x86_64_bnd_test_LDFLAGS): Likewise.
  2174. (exception_x86_64_bnd_test_LDADD): Likewise.
  2175. (exception_x86_64_bnd_1.o): New rule.
  2176. (exception_x86_64_bnd_2.o): Likewise.
  2177. * testsuite/Makefile.in: Regenerated.
  2178. 2013-11-15 Alan Modra <amodra@gmail.com>
  2179. * powerpc.cc (Target_powerpc::glink_section): Provide non-const
  2180. accessor.
  2181. (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
  2182. Only call ppc64_local_entry_offset for 64-bit. Restrict
  2183. symval_for_branch lookup to ELFv1.
  2184. (Stub_table::add_plt_call_entry): Use unsigned int off.
  2185. (Output_data_glink::Address, invalid_address): New.
  2186. (Output_data_glink::add_eh_frame): Move out of line. Add
  2187. support for ELFv2.
  2188. (Output_data_glink::add_global_entry, find_global_entry,
  2189. global_entry_address): New functions.
  2190. (Output_data_glink::global_entry_stubs_, end_branch_table_,
  2191. ge_size): New variables.
  2192. (Output_data_glink::set_final_data_size): Add global entry
  2193. stub sizing.
  2194. (Output_data_glink::do_write): Write global entry stubs.
  2195. (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
  2196. parameter. Return true for ELFv2. Adjust callers.
  2197. (Target_powerpc::Scan::local, global): Restrict opd lookup to
  2198. ELFv1. Similarly for ifunc and dynamic relocation processing
  2199. specific to ELFv1. Recognize that symbols are defined on
  2200. their plt entries for ELFv2.
  2201. (Target_powerpc::symval_for_branch): Assert if called for
  2202. ELFv2 or ppc32.
  2203. (Target_powerpc::Relocate::relocate): Use global entry plt
  2204. stub for symbol value if such exists on ELFv2.
  2205. (Target_powerpc::Relocate::relocate): Don't call
  2206. symval_for_branch when ELFv2. Do adjust for local entry
  2207. offset when ELFv2.
  2208. (Target_powerpc::do_dynsym_value): Set symbols to global entry
  2209. plt stub for ELFv2.
  2210. (Target_powerpc::do_plt_address_for_global): Similarly.
  2211. 2013-11-14 Cary Coutant <ccoutant@google.com>
  2212. Revert patch -- this did not fix the problem, and there is
  2213. no race there.
  2214. 2013-11-14 Cary Coutant <ccoutant@google.com>
  2215. PR gold/14860
  2216. * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
  2217. (Ehframe_hdr::set_final_data_size): Allocate a Lock.
  2218. * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
  2219. updating fde_offsets_.
  2220. (Eh_frame_hdr::lock_): New data member.
  2221. 2013-11-14 Cary Coutant <ccoutant@google.com>
  2222. * dwp.cc (Dwo_file_entry): New type.
  2223. (File_list): Use Dwo_file_entry.
  2224. (Dwo_file::verify): New function.
  2225. (Dwo_file::verify_dwo_list): New function.
  2226. (Dwo_file::sized_verify_dwo_list): New function.
  2227. (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
  2228. list.
  2229. (Dwp_options): New enum type.
  2230. (dwp_options): Add --verify-only.
  2231. (usage): Likewise.
  2232. (main): Likewise.
  2233. * dwp.h (gold_info): Add declaration.
  2234. 2013-11-14 Cary Coutant <ccoutant@google.com>
  2235. PR gold/14860
  2236. * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
  2237. (Ehframe_hdr::set_final_data_size): Allocate a Lock.
  2238. * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
  2239. updating fde_offsets_.
  2240. (Eh_frame_hdr::lock_): New data member.
  2241. 2013-11-06 Cary Coutant <ccoutant@google.com>
  2242. PR gold/15758
  2243. * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
  2244. before reloc sections.
  2245. 2013-11-04 Alan Modra <amodra@gmail.com>
  2246. * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
  2247. (Symbol::needs_dynamic_reloc): Test new flag.
  2248. * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
  2249. (Target_powerpc::Scan::get_reference_flags): Add target param.
  2250. Return FUNC_DESC_ABI for 64-bit ELFv1.
  2251. (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
  2252. call.
  2253. (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
  2254. (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
  2255. 2013-10-31 Cary Coutant <ccoutant@google.com>
  2256. Restore support for dwp v2 DWARF package file format.
  2257. * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
  2258. tu_length parameter. Adjust all callers.
  2259. * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
  2260. * dwp.cc: Include dwarf.h.
  2261. (Section_bounds): New struct type.
  2262. (Unit_set): New struct type.
  2263. (Dwo_file::Dwo_file): Initialize new data member.
  2264. (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
  2265. Combine and rename to...
  2266. (Dwo_file::read_unit_index): ...this.
  2267. (Dwo_file::sized_read_compunit_index)
  2268. (Dwo_file::sized_read_typeunit_index): Combine and rename to...
  2269. (Dwo_file::sized_read_unit_index): ...this.
  2270. (Dwo_file::copy_section): Remove section_name, is_str_offsets
  2271. parameters; add section_id parameter.
  2272. (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
  2273. (Dwo_file::add_unit_set): ...this.
  2274. (Dwo_file::shndx_map_): Remove.
  2275. (Dwo_file::sect_offsets_): New data member.
  2276. (Dwp_output_file::Dwp_output_file): Initialize new data members.
  2277. (Dwp_output_file::add_section): Rename to...
  2278. (Dwp_output_file::add_contribution): ...this.
  2279. (Dwp_output_file::add_cu_set): Combine parameters into a struct.
  2280. (Dwp_output_file::add_tu_set): Likewise.
  2281. (Dwp_output_file::Contribution): New type.
  2282. (Dwp_output_file::Section::contributions): New data member.
  2283. (Dwp_output_file::Cu_or_tu_set): Remove.
  2284. (Dwp_output_file::Section::Section): New ctor.
  2285. (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
  2286. (Dwp_output_file::Dwp_index::Section_table): New type.
  2287. (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
  2288. (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
  2289. parameter.
  2290. (Dwp_output_file::Dwp_index::shndx_pool): Remove.
  2291. (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
  2292. (Dwp_output_file::Dwp_index::section_table): New member function.
  2293. (Dwp_output_file::Dwp_index::section_table_end): New member function.
  2294. (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
  2295. (Dwp_output_file::Dwp_index::section_table_rows): New member function.
  2296. (Dwp_output_file::Dwp_index::section_table_cols): New member function.
  2297. (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
  2298. (Dwp_output_file::Dwp_index::section_table_): New data member.
  2299. (Dwp_output_file::Dwp_index::section_mask_): New data member.
  2300. (Dwp_output_file::add_output_section): New member function.
  2301. (Dwp_output_file::write_new_section): New member function.
  2302. (Dwp_output_file::write_contributions): New member function.
  2303. (Dwp_output_file::section_id_map_): New data member.
  2304. (class Dwo_id_info_reader): Remove.
  2305. (class Unit_reader): New class.
  2306. (get_dwarf_section_name): New function.
  2307. (Dwo_file::read_executable): Adjust initializations of class data.
  2308. (Dwo_file::read): Add support for v2 package file format.
  2309. (Dwo_file::read_unit_index): Likewise.
  2310. (Dwo_file::sized_read_unit_index): Likewise.
  2311. (Dwo_file::copy_section): Likewise.
  2312. (Dwo_file::add_unit_set): Likewise.
  2313. (Dwp_output_file::add_output_section): Likewise.
  2314. (Dwp_output_file::add_contribution): Likewise.
  2315. (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
  2316. for empty slot.
  2317. (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
  2318. file format.
  2319. (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
  2320. slot.
  2321. (Dwp_output_file::initialize): Remove unused function.
  2322. (Dwp_output_file::finalize): Add support for v2 package file format.
  2323. (Dwp_output_file::write_index): Likewise.
  2324. * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
  2325. function prototype.
  2326. 2013-10-31 Cary Coutant <ccoutant@google.com>
  2327. * configure.ac: Fix check for -fmerge-constants.
  2328. * configure.ac: Regenerate.
  2329. 2013-10-30 Roland McGrath <mcgrathr@google.com>
  2330. * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
  2331. Correct 9-byte nop sequence to match what the assembler generates.
  2332. 2013-10-30 Alan Modra <amodra@gmail.com>
  2333. * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
  2334. ppc64_local_entry_offset, ppc64_local_entry_offset,
  2335. do_read_symbols): New functions.
  2336. (Powerpc_relobj::e_flags_, st_other_): New vars.
  2337. (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
  2338. (Powerpc_dynobj::abiversion, set_abiversion): New functions.
  2339. (Powerpc_relobj::e_flags_): New var.
  2340. (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
  2341. and adjust for ELFv2.
  2342. (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
  2343. (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
  2344. (Powerpc_dynobj::do_find_special_sections): Likewise.
  2345. (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
  2346. (Target_powerpc::Branch_info::make_stub): Adjust stub destination
  2347. to ELFv2 local entry.
  2348. (Target_powerpc::do_relax): No thread safe barriers needed for
  2349. ELFv2.
  2350. (Output_data_plt_powerpc::initial_plt_entry_size_,
  2351. plt_entry_size): Delete. Replace all uses with
  2352. first_plt_entry_offset() and plt_entry_size().
  2353. (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
  2354. reserved_size parm. Update callers.
  2355. (Output_data_plt_powerpc::entry_count): Update.
  2356. (Output_data_plt_powerpc::first_plt_entry_offset): Make private
  2357. and use Target_powerpc::first_plt_entry_offset().
  2358. (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
  2359. rename to plt_entry_size.
  2360. (Output_data_plt_powerpc::add_ifunc_entry,
  2361. add_local_ifunc_entry): Adjust reloc for ELFv2.
  2362. (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
  2363. (glink_eh_frame_fde_64v2): New.
  2364. (Stub_table::plt_call_size): Support ELFv2 sizing.
  2365. (Output_data_glink::add_eh_frame): Use the new FDE.
  2366. (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
  2367. (Stub_table::do_write): Write ELFv2 stubs and glink.
  2368. (Target_powerpc::Relocate::relocate): Replaces nop after call
  2369. with ld 2,24(1) and adjust local offset destination for ELFv2.
  2370. 2013-10-30 Alan Modra <amodra@gmail.com>
  2371. * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
  2372. (Target_powerpc::Scan::global, local): Likewise.
  2373. (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
  2374. on all ppc64 @h and @ha relocs.
  2375. 2013-10-14 Alan Modra <amodra@gmail.com>
  2376. * output.h (Output_data_got::add_constant): Tidy.
  2377. (Output_data_got::add_constant_pair): New function.
  2378. * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
  2379. methods used so as to first call reserve_ent().
  2380. 2013-10-11 Roland McGrath <mcgrathr@google.com>
  2381. * powerpc.cc (Output_data_got_powerpc): Remove unused methods
  2382. add_got_entry and add_got_entry_pair.
  2383. * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
  2384. (HAVE_PUBNAMES): Likewise.
  2385. * configure: Regenerate.
  2386. * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
  2387. * testsuite/Makefile.in: Regenerate.
  2388. * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
  2389. Remove const from declaration.
  2390. * target.cc (Sized_target::do_adjust_elf_header): Update definition.
  2391. * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
  2392. * output.h (Output_file_header): Remove const from member target_
  2393. and corresponding constructor argument.
  2394. * output.cc (Output_file_header::Output_file_header): Update prototype.
  2395. (Output_file_header::do_sized_write): Use this->target_ in place
  2396. of parameters()->target().
  2397. * testsuite/undef_symbol.cc (Foo::get_a): New method.
  2398. * configure.ac (MERGE_CONSTANTS_FLAG): New check.
  2399. * configure: Regenerate.
  2400. * Makefile.in: Regenerate.
  2401. * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
  2402. * testsuite/merge_string_literals_2.c: Likewise.
  2403. * testsuite/Makefile.am
  2404. (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
  2405. (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
  2406. literal -fmerge-constants.
  2407. * testsuite/Makefile.in: Regenerate.
  2408. * i386.cc (Target_i386): Remove unused member dynbss_.
  2409. * arm.cc (Target_arm): Likewise.
  2410. * powerpc.cc (Target_powerpc): Likewise.
  2411. * sparc.cc (Target_sparc): Likewise.
  2412. * tilegx.cc (Target_tilegx): Likewise.
  2413. * x86_64.cc (Target_x86_64): Likewise.
  2414. * dwarf_reader.h (Dwarf_info_reader): Remove unused members
  2415. type_signature_, type_offset_.
  2416. * plugin.h (Plugin_hook): Remove unused member layout_.
  2417. * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
  2418. mapfile_.
  2419. (Read_member): Remove unused members input_objects_, symtab_,
  2420. mapfile_, layout_.
  2421. (Check_library): Remove unused member symtab_.
  2422. * archive.h (Lib_group): Remove unused member lib_.
  2423. * archive.cc (Lib_group::Lib_group): Update initializer.
  2424. * incremental.h (Incremental_binary): Remove unused member target_.
  2425. (Incremental_script_entry): Removed unused member script_.
  2426. * layout.h (Write_symbols_task): Remove unused member input_objects_.
  2427. * icf.h (Icf): Remove unused member num_tracked_relocs.
  2428. * gold-threads.h (Once): Conditionalize member was_run_lock_ on
  2429. [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
  2430. its only use.
  2431. * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
  2432. * archive.h: Use struct rather than class for forward declaration
  2433. of Read_symbols_data.
  2434. 2013-10-07 Cary Coutant <ccoutant@google.com>
  2435. PR gold/16010
  2436. * testsuite/Makefile.am (icf_test): Fix dependencies.
  2437. (icf_safe_test): Likewise.
  2438. (icf_safe_so_test): Likewise.
  2439. (large_symbol_alignment): Add empty _LDADD rule.
  2440. * testsuite/Makefile.in: Regenerate.
  2441. 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
  2442. PR gold/15927
  2443. * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
  2444. relocation for R_X86_64_32 on x32.
  2445. 2013-08-27 Roland McGrath <mcgrathr@google.com>
  2446. * output.cc (Output_segment::set_section_addresses): Take new
  2447. Target* argument. If target->isolate_execinstr() and the segment
  2448. is executable and starts at a target->abi_pagesize() boundary,
  2449. pad its end out to a target->abi_pagesize() boundary with code fill.
  2450. * output.h (Output_segment::set_section_addresses): Update decl.
  2451. * layout.h (Layout::check_output_data_for_reset_values): Take new
  2452. argument RELAX_OUTPUTS.
  2453. (Layout): New member relax_output_list_.
  2454. (Layout::add_relax_output): New method.
  2455. * layout.cc (Layout::Layout): Update constructor.
  2456. (Layout::reset_relax_output): New method.
  2457. (Layout::clean_up_after_relaxation): Call it.
  2458. (Layout::prepare_for_relaxation): Update caller.
  2459. (Layout::set_segment_offsets): Update callers of set_section_addresses.
  2460. Call reset_relax_output before re-processing segments for
  2461. isolate_execinstr case.
  2462. (Layout::write_data): Handle relax_output_list_.
  2463. (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
  2464. Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
  2465. 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
  2466. PR binutils/15834
  2467. * object.h: Fix typos.
  2468. 2013-08-16 Roland McGrath <mcgrathr@google.com>
  2469. * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
  2470. * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
  2471. 2013-08-07 Cary Coutant <ccoutant@google.com>
  2472. Revert support for v2 DWP files:
  2473. 2013-03-01 Cary Coutant <ccoutant@google.com>
  2474. Add dwp support for v2 DWARF package file format.
  2475. * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
  2476. tu_length parameter. Adjust all callers.
  2477. * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
  2478. * dwp.cc: Include dwarf.h.
  2479. (Section_bounds): New struct type.
  2480. (Unit_set): New struct type.
  2481. (Dwo_file::Dwo_file): Initialize new data member.
  2482. (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
  2483. Combine and rename to...
  2484. (Dwo_file::read_unit_index): ...this.
  2485. (Dwo_file::sized_read_compunit_index)
  2486. (Dwo_file::sized_read_typeunit_index): Combine and rename to...
  2487. (Dwo_file::sized_read_unit_index): ...this.
  2488. (Dwo_file::copy_section): Remove section_name, is_str_offsets
  2489. parameters; add section_id parameter.
  2490. (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
  2491. (Dwo_file::add_unit_set): ...this.
  2492. (Dwo_file::shndx_map_): Remove.
  2493. (Dwo_file::sect_offsets_): New data member.
  2494. (Dwp_output_file::Dwp_output_file): Initialize new data members.
  2495. (Dwp_output_file::add_section): Rename to...
  2496. (Dwp_output_file::add_contribution): ...this.
  2497. (Dwp_output_file::add_cu_set): Combine parameters into a struct.
  2498. (Dwp_output_file::add_tu_set): Likewise.
  2499. (Dwp_output_file::Contribution): New type.
  2500. (Dwp_output_file::Section::contributions): New data member.
  2501. (Dwp_output_file::Cu_or_tu_set): Remove.
  2502. (Dwp_output_file::Section::Section): New ctor.
  2503. (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
  2504. (Dwp_output_file::Dwp_index::Section_table): New type.
  2505. (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
  2506. (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
  2507. parameter.
  2508. (Dwp_output_file::Dwp_index::shndx_pool): Remove.
  2509. (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
  2510. (Dwp_output_file::Dwp_index::section_table): New member function.
  2511. (Dwp_output_file::Dwp_index::section_table_end): New member function.
  2512. (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
  2513. (Dwp_output_file::Dwp_index::section_table_rows): New member function.
  2514. (Dwp_output_file::Dwp_index::section_table_cols): New member function.
  2515. (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
  2516. (Dwp_output_file::Dwp_index::section_table_): New data member.
  2517. (Dwp_output_file::Dwp_index::section_mask_): New data member.
  2518. (Dwp_output_file::add_output_section): New member function.
  2519. (Dwp_output_file::write_new_section): New member function.
  2520. (Dwp_output_file::write_contributions): New member function.
  2521. (Dwp_output_file::section_id_map_): New data member.
  2522. (class Dwo_id_info_reader): Remove.
  2523. (class Unit_reader): New class.
  2524. (get_dwarf_section_name): New function.
  2525. (Dwo_file::read_executable): Adjust initializations of class data.
  2526. (Dwo_file::read): Add support for v2 package file format.
  2527. (Dwo_file::read_unit_index): Likewise.
  2528. (Dwo_file::sized_read_unit_index): Likewise.
  2529. (Dwo_file::copy_section): Likewise.
  2530. (Dwo_file::add_unit_set): Likewise.
  2531. (Dwp_output_file::add_output_section): Likewise.
  2532. (Dwp_output_file::add_contribution): Likewise.
  2533. (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
  2534. for empty slot.
  2535. (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
  2536. file format.
  2537. (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
  2538. slot.
  2539. (Dwp_output_file::initialize): Remove unused function.
  2540. (Dwp_output_file::finalize): Add support for v2 package file format.
  2541. (Dwp_output_file::write_index): Likewise.
  2542. * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
  2543. function prototype.
  2544. 2013-07-31 Cary Coutant <ccoutant@google.com>
  2545. * object.cc (Sized_relobj::do_output_section_address): New function.
  2546. (Sized_relobj): Instantiate explicitly.
  2547. * object.h (Object::output_section_address): New function.
  2548. (Object::do_output_section_address): New function.
  2549. (Sized_relobj::do_output_section_address): New function.
  2550. * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
  2551. 2013-07-30 Cary Coutant <ccoutant@google.com>
  2552. Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  2553. * parameters.cc (Parameters::entry): Return target-specific entry
  2554. symbol name.
  2555. * target.h (Target::entry_symbol_name): New function.
  2556. (Target_info::entry_symbol_name): New data member.
  2557. * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
  2558. * i386.cc (Target_i386::i386_info): Likewise.
  2559. (Target_i386_nacl::i386_nacl_info): Likewise.
  2560. * sparc.cc (Target_sparc::sparc_info): Likewise.
  2561. * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
  2562. * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
  2563. (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
  2564. * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
  2565. 2013-07-22 Sterling Augustine <saugustine@google.com>
  2566. * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
  2567. Convert parameter shndx to local variable. Add parameters symtab
  2568. and symtab_size. Scan over section names. Find relocation
  2569. section corresponding to current section. Create and initialize
  2570. reloc_mapper_ and reloc_type_.
  2571. (Dwarf_pubnames_table::read_header): Add assertion. Change
  2572. unit_length to off_t. Initialize member unit_length_. Fill in field
  2573. cu_offset_.
  2574. * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
  2575. Initialize new fields unit_length_ and cu_offset_.
  2576. (Dwarf_pubnames_table::read_section): Update prototype.
  2577. (Dwarf_pubnames_table::cu_offset): New member function.
  2578. (Dwarf_pubnames_table::subsection_size): Likewise.
  2579. (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
  2580. New fields.
  2581. (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
  2582. member functions public.
  2583. * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
  2584. Update comment. Rework logic. Move repeated parts to...
  2585. (Gdb_index_info_reader::read_pubtable): ...here. New function.
  2586. (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
  2587. pubtypes_table_, and stmt_list_offset.
  2588. (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
  2589. Gdb_index::find_pubtype_offset,
  2590. Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
  2591. (Gdb_index::pubnames_read): Update prototype and rework logic.
  2592. * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
  2593. Forward declare.
  2594. (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
  2595. Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
  2596. Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
  2597. Gdb_index::map_pubtable_to_dies):
  2598. Declare functions.
  2599. (Gdb_index::pubnames_read): Update declaration.
  2600. (Gdb_index::Pubname_offset_map): New type.
  2601. (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
  2602. Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
  2603. Gdb_index::stmt_list_offset): Declare.
  2604. (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
  2605. Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
  2606. Gdb_index::pubtypes_offset_): Remove.
  2607. 2013-07-19 Roland McGrath <mcgrathr@google.com>
  2608. * options.h (General_options): Add -Trodata-segment option.
  2609. * parameters.cc (Parameters::check_rodata_segment): New function.
  2610. (Parameters::set_target_once): Call it.
  2611. * parameters.h (Parameters): Declare it (private member function).
  2612. * layout.cc (load_seg_unusable_for_headers): New function, broken
  2613. out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
  2614. then validate rodata segment rather than text segment.
  2615. (relaxation_loop_body): Call that.
  2616. (is_text_segment): New function. Don't admit a non-executable
  2617. segment if TARGET->isolate_execinstr().
  2618. (set_segment_offsets): Call it. Honor -Trodata-segment option.
  2619. 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
  2620. PR gold/15070
  2621. * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
  2622. * nacl.h (Sniff_file::View::View): Request aligned view.
  2623. 2013-07-11 Cary Coutant <ccoutant@google.com>
  2624. * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
  2625. correct BRLT entry size.
  2626. 2013-07-03 Alan Modra <amodra@gmail.com>
  2627. * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
  2628. comment.
  2629. 2013-07-01 Cary Coutant <ccoutant@google.com>
  2630. * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
  2631. reloc_type_.
  2632. (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
  2633. (Dwarf_ranges_table::lookup_reloc): New function.
  2634. * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
  2635. reloc_type_.
  2636. (Dwarf_ranges_table::lookup_reloc): New function.
  2637. (Dwarf_ranges_table::reloc_type_): New data member.
  2638. 2013-06-27 Jing Yu <jingyu@google.com>
  2639. PR gold/15662
  2640. * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
  2641. function.
  2642. (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
  2643. (Target_powerpc::do_relax): Call the above.
  2644. 2013-06-27 Cary Coutant <ccoutant@google.com>
  2645. * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
  2646. on garbage collected .opd section.
  2647. 2013-06-27 Alan Modra <amodra@gmail.com>
  2648. * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
  2649. is non-zero.
  2650. (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
  2651. (Target_powerpc::do_function_location): Likewise for loc->shndx.
  2652. 2013-06-14 Cary Coutant <ccoutant@google.com>
  2653. * resolve.cc (Symbol::override_base): Don't override st_type
  2654. from plugin placeholder symbols.
  2655. (Symbol_table::resolve): Likewise.
  2656. (Symbol_table::should_override): Don't complain about TLS mismatch
  2657. if the TO symbol is a plugin placeholder.
  2658. * testsuite/Makefile.am (plugin_test_tls): New test.
  2659. * testsuite/Makefile.in: Regenerate.
  2660. * testsuite/plugin_test_tls.sh: New test script.
  2661. * testsuite/two_file_test_2_tls.cc: New test source.
  2662. * testsuite/two_file_test_tls.cc: New test source.
  2663. 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
  2664. * layout.cc (Layout::set_segment_offsets): Taking care of the case when
  2665. the maximum segment alignment is larger than the page size.
  2666. * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
  2667. correctly aligns the symbols with large alignemnt.
  2668. * testsuite/Makefile.in: Regenerate.
  2669. * testsuite/large_symbol_alignment.cc: New file.
  2670. 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
  2671. Sriraman Tallam <tmsriram@google.com>
  2672. * options.h (sort_section): New option.
  2673. * output.h (Input_section_sort_section_prefix_special_ordering_compare):
  2674. Rename from Input_section_sort_section_name_special_ordering_compare.
  2675. (Input_section_sort_section_name_compare): New struct.
  2676. * output.cc (Output_section::Input_section_sort_section_name_compare::
  2677. operator()): New function.
  2678. (Output_section::sort_attached_input_sections): Use new sort function
  2679. for .text if --sort-section=name is specified.
  2680. * layout.cc (Layout::make_output_section):
  2681. Add sorting by name when --sort-section=name is specified.
  2682. * testsuite/Makefile.am (text_section_grouping): Test option
  2683. --sort-section=name.
  2684. * testsuite/Makefile.in: Regenerate.
  2685. * testsuite/section_sorting_name.cc: New file.
  2686. * testsuite/section_sorting_name.sh: New file.
  2687. 2013-05-21 Cary Coutant <ccoutant@google.com>
  2688. * symtab.h (Symbol::is_cxx_vtable): New function.
  2689. * target-reloc.h (relocate_section): Check for vtable symbol.
  2690. * testsuite/Makefile.am (missing_key_func.sh): New test case.
  2691. * testsuite/Makefile.in: Regenerate.
  2692. * testsuite/missing_key_func.cc: New test source.
  2693. * testsuite/missing_key_func.sh: New test script.
  2694. 2013-05-21 Cary Coutant <ccoutant@google.com>
  2695. * object.cc (Sized_relobj_file::get_symbol_location_info): Set
  2696. type of enclosing symbol.
  2697. (Relocate_info::location): Check symbol type when describing symbol.
  2698. * object.h (Symbol_location_info): Remove unused line_number;
  2699. add enclosing_symbol_type.
  2700. * testsuite/debug_msg.sh: Adjust expected output.
  2701. 2013-05-13 Cary Coutant <ccoutant@google.com>
  2702. * configure.ac: Export DEFAULT_TARGET.
  2703. * configure: Regenerate.
  2704. * Makefile.in: Regenerate.
  2705. * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
  2706. * testsuite/Makefile.in: Regenerate.
  2707. * testsuite/debug_msg.sh: Delete duplicate tests.
  2708. Don't check undef_int error message match for powerpc where the
  2709. source file and line number aren't available.
  2710. 2013-05-10 Roland McGrath <mcgrathr@google.com>
  2711. * options.h (General_options): Add --rosegment-gap option.
  2712. * options.cc (finalize): --rosegment-gap implies --rosegment.
  2713. * layout.cc (set_segment_offsets): Let user option override
  2714. target->rosegment_gap().
  2715. 2013-05-10 Roland McGrath <mcgrathr@google.com>
  2716. * options.h (General_options): Remove leading space from help
  2717. messages for -nostdlib and --rosegment.
  2718. 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
  2719. PR ld/15365
  2720. * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
  2721. 2013-05-03 Alan Modra <amodra@gmail.com>
  2722. * merge.cc (Output_merge_string::do_add_input_section): Correct
  2723. scan for number of strings. Rename vars to avoid shadowing.
  2724. Include missing terminator in input_size_.
  2725. 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
  2726. * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
  2727. Restore empty string handling.
  2728. 2013-05-01 Cary Coutant <ccoutant@google.com>
  2729. * stringpool.cc (Stringpool_template::new_key_offset): Fix
  2730. uninitialized warning.
  2731. 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
  2732. * output.cc (Output_section::add_merge_input_section): Allow
  2733. to merge sections if the alignment is more than character size.
  2734. * merge.h (Output_merge_string::Output_merge_string): Remove
  2735. assert.
  2736. * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
  2737. only not-null strings. Check the alignment of strings.
  2738. * stringpool.h
  2739. (Stringpool_template<Stringpool_char>::Stringpool_template): Add
  2740. alignment as the argument.
  2741. (Stringpool_template<Stringpool_char>::addralign_): New class member.
  2742. * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
  2743. Align non-zero length strings according to the addralign_.
  2744. (Stringpool_template<Stringpool_char>::set_string_offsets):
  2745. Updating offsets according to the given alignment.
  2746. * testsuite/Makefile.am (text_section_grouping): Test if string
  2747. literals are getting merged.
  2748. * testsuite/Makefile.in: Regenerate.
  2749. * testsuite/merge_string_literals_1.c: New file.
  2750. * testsuite/merge_string_literals_2.c: Ditto.
  2751. * testsuite/merge_string_literals.sh: Ditto.
  2752. 2013-04-26 Ian Lance Taylor <iant@google.com>
  2753. * target-reloc.h (relocate_section): If the reloc offset is out of
  2754. range, pass VIEW as NULL to relocate.relocate.
  2755. * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
  2756. * i386.cc (Target_i386::Relocate::relocate): Likewise.
  2757. * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
  2758. * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
  2759. * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
  2760. * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
  2761. 2013-04-26 Geoff Pike <gpike@chromium.org>
  2762. * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
  2763. * layout.cc (Hash_task): New class.
  2764. (Layout::queue_build_id_tasks): New function.
  2765. (Layout::write_build_id): Handle single-thread portion of build ID
  2766. computation. (In some cases, all of it is single-threaded.) Replace
  2767. {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
  2768. functionality in fewer lines of code.
  2769. * layout.h (Layout::queue_build_id_tasks): New function declaration.
  2770. * options.h (General_options): make "--build-id" default to tree
  2771. rather than sha1. Add two new options related to --build-id=tree:
  2772. --build-id-chunk-size-for-treehash and
  2773. --build-id-min-file-size-for-treehash.
  2774. * Makefile.am: add testing of --build-id=tree and related new options
  2775. (these tests will be invoked by "make check").
  2776. * Makefile.in: Regenerate.
  2777. 2013-04-25 Alan Modra <amodra@gmail.com>
  2778. * configure.tgt: Add powerpcle and powerpc64le.
  2779. 2013-04-22 Alan Modra <amodra@gmail.com>
  2780. PR gold/15355
  2781. * layout.cc (Layout::segment_precedes): Allow more than one
  2782. segment with the same type and flags.
  2783. 2013-04-15 Cary Coutant <ccoutant@google.com>
  2784. * layout.cc (Layout::set_relocatable_section_offsets): Don't
  2785. allocate space in file for BSS sections.
  2786. 2013-04-15 Cary Coutant <ccoutant@google.com>
  2787. * script-sections.cc (Orphan_output_section): Reset address
  2788. to zero after each orphaned section for relocatable links.
  2789. 2013-04-15 Cary Coutant <ccoutant@google.com>
  2790. * symtab.cc (Symbol_table::sized_write_globals): Subtract
  2791. section starting address for relocatable link.
  2792. * testsuite/Makefile.am (script_test_11): New test.
  2793. * testsuite/Makefile.in: Regenerate.
  2794. * testsuite/script_test_11.c: New source file.
  2795. * testsuite/script_test_11.t: New linker script.
  2796. 2013-04-13 Alan Modra <amodra@gmail.com>
  2797. * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
  2798. owner when sections are not adjacent and exceed group size.
  2799. (Target_powerpc::group_sections): Handle corner case.
  2800. (Target_powerpc::Branch_info::make_stub): Handle case where
  2801. stub table doesn't exist due to branches in non-exec sections.
  2802. (Target_powerpc::Relocate::relocate): Likewise.
  2803. 2013-04-11 Alan Modra <amodra@gmail.com>
  2804. PR gold/15354
  2805. * powerpc.cc (Target_powerpc::make_brlt_section): Name section
  2806. .branch_lt to match bfd ld. Adjust comments throughout file.
  2807. 2013-04-04 Ian Lance Taylor <iant@google.com>
  2808. GCC PR c++/56840
  2809. * object.cc (do_layout_deferred_sections): Handle .eh_frame
  2810. sections before checking whether they are included in the link.
  2811. 2013-03-29 Sriraman Tallam <tmsriram@google.com>
  2812. * archive.cc (Archive::get_elf_object_for_member): Create the elf
  2813. object before calling the plugin claim_file handler. Pass the elf
  2814. object of the archive to the plugin. Delete the elf object if the
  2815. plugin claims the file.
  2816. 2013-03-21 Alan Modra <amodra@gmail.com>
  2817. * layout.cc (Layout::set_segment_offsets): Accept writable .text
  2818. segment when omagic.
  2819. 2013-03-21 Alan Modra <amodra@gmail.com>
  2820. * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
  2821. comparison warning.
  2822. * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
  2823. uninitialized" warning.
  2824. 2013-03-20 Alan Modra <amodra@gmail.com>
  2825. * symtab.h (Symbol::clear_version): New function.
  2826. * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
  2827. is_needed by weak references. Clear version for symbols defined
  2828. in as-needed objects that are not needed.
  2829. 2013-03-15 Alan Modra <amodra@gmail.com>
  2830. * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
  2831. static and public. Add report_err param. Return false for data refs.
  2832. (Target_powerpc::rela_dyn_section): New overloaded function.
  2833. (Target_powerpc::plt_, iplt_): Elucidate.
  2834. (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
  2835. (Output_data_plt_powerpc::do_write): Don't write .iplt.
  2836. (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
  2837. (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
  2838. calls. Put ifunc dynamic relocs in irela_dyn_section. Only
  2839. push_branch and make_plt_entry for ifunc syms when
  2840. reloc_needs_plt_for_ifunc.
  2841. (Target_powerpc::Relocate::relocate): Don't use plt entry value
  2842. for ifunc unless reloc_needs_plt_for_ifunc.
  2843. 2013-03-15 Alan Modra <amodra@gmail.com>
  2844. * gc.h (gc_process_relocs): Don't look through function descriptors.
  2845. * icf.cc (get_section_contents): Do so here instead.
  2846. 2013-03-13 Alan Modra <amodra@gmail.com>
  2847. * powerpc.cc (is_branch_reloc): Forward declare.
  2848. (Target_powerpc::do_can_check_for_function_pointers): New predicate.
  2849. (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
  2850. false for 64-bit, true for 32-bit non-branch relocs.
  2851. (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
  2852. * testsuite/Makefile.am (icf_test): Use linker map file instead of
  2853. nm output.
  2854. (icf_safe_test): Generate linker map file as well as nm output.
  2855. (icf_safe_so_test): Likewise.
  2856. * testsuite/Makefile.in: Regenerate.
  2857. * testsuite/icf_test.sh: Parse linker map file to determine
  2858. section folding.
  2859. * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
  2860. * testsuite/icf_safe_so_test.sh: Likewise.
  2861. (X86_32_or_ARM_specific_safe_fold): Merge into..
  2862. (arch_specific_safe_fold): ..this.
  2863. (X86_64_specific_safe_fold): Delete unused function.
  2864. 2013-03-12 Alan Modra <amodra@gmail.com>
  2865. * gc.h (gc_process_relocs): Look through function descriptors
  2866. to determine shndx, symvalue and addend used by ICF. Tidy
  2867. variable duplication.
  2868. 2013-03-11 Alan Modra <amodra@gmail.com>
  2869. * gold.cc (queue_middle_tasks): Move detect_odr_violations..
  2870. * layout.cc (Layout_task_runner::run): ..to here.
  2871. * symtab.h (struct Symbol_location): Extract from..
  2872. (class Symbol_table): ..here.
  2873. * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
  2874. * target.h (class Target): Add function_location and
  2875. do_function_location functions.
  2876. (class Sized_target): Add do_function_location.
  2877. * object.h (class Sized_relobj_file): Move find_shdr..
  2878. (class Object): ..to here.
  2879. * object.cc: Likewise. Update to suit. Instantiate.
  2880. (Sized_relobj_file::find_eh_frame): Update find_shdr call.
  2881. * powerpc.cc (class Powerpc_dynobj): New.
  2882. (Target_powerpc::do_function_location): New function.
  2883. (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
  2884. (Powerpc_dynobj::do_read_symbols): New function.
  2885. (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
  2886. 2013-03-08 Ian Lance Taylor <iant@google.com>
  2887. * options.cc (General_options::string_to_object_format): Accept
  2888. "default".
  2889. 2013-03-08 Alan Modra <amodra@gmail.com>
  2890. * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
  2891. pointer to Post_fde.
  2892. (struct Post_fde): Move definition to here..
  2893. * ehframe.cc (struct Post_fde): ..from here.
  2894. (Cie::write): Don't alloc Post_fde.
  2895. (Eh_frame::do_sized_write): Update. Don't free Post_fde.
  2896. 2013-03-07 Alan Modra <amodra@gmail.com>
  2897. * testsuite/discard_locals_relocatable_test.c: Add a powerpc
  2898. relocation referencing .LC0.
  2899. * testsuite/discard_locals_test.sh: Remove FIXMEs.
  2900. 2013-03-07 Alan Modra <amodra@gmail.com>
  2901. * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
  2902. always_inline. Add assembly for powerpc to avoid GOT.
  2903. 2013-03-07 Alan Modra <amodra@gmail.com>
  2904. * testsuite/script_test_10.sh: Don't test .bss section
  2905. header number.
  2906. 2013-03-06 Alan Modra <amodra@gmail.com>
  2907. * powerpc.cc (class Powerpc_relobj): Move some member functions.
  2908. (Target_powerpc::symval_for_branch): Add symtab param. Update
  2909. all callers. Handle folded sections.
  2910. (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
  2911. to Powerpc_relobj.
  2912. (Global_symbol_visitor_opd::operator()): Likewise.
  2913. 2013-03-04 Alan Modra <amodra@gmail.com>
  2914. * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
  2915. * testsuite/Makefile.in: Regenerate.
  2916. 2013-03-01 Cary Coutant <ccoutant@google.com>
  2917. Add dwp support for v2 DWARF package file format.
  2918. * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
  2919. tu_length parameter. Adjust all callers.
  2920. * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
  2921. * dwp.cc: Include dwarf.h.
  2922. (Section_bounds): New struct type.
  2923. (Unit_set): New struct type.
  2924. (Dwo_file::Dwo_file): Initialize new data member.
  2925. (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
  2926. Combine and rename to...
  2927. (Dwo_file::read_unit_index): ...this.
  2928. (Dwo_file::sized_read_compunit_index)
  2929. (Dwo_file::sized_read_typeunit_index): Combine and rename to...
  2930. (Dwo_file::sized_read_unit_index): ...this.
  2931. (Dwo_file::copy_section): Remove section_name, is_str_offsets
  2932. parameters; add section_id parameter.
  2933. (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
  2934. (Dwo_file::add_unit_set): ...this.
  2935. (Dwo_file::shndx_map_): Remove.
  2936. (Dwo_file::sect_offsets_): New data member.
  2937. (Dwp_output_file::Dwp_output_file): Initialize new data members.
  2938. (Dwp_output_file::add_section): Rename to...
  2939. (Dwp_output_file::add_contribution): ...this.
  2940. (Dwp_output_file::add_cu_set): Combine parameters into a struct.
  2941. (Dwp_output_file::add_tu_set): Likewise.
  2942. (Dwp_output_file::Contribution): New type.
  2943. (Dwp_output_file::Section::contributions): New data member.
  2944. (Dwp_output_file::Cu_or_tu_set): Remove.
  2945. (Dwp_output_file::Section::Section): New ctor.
  2946. (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
  2947. (Dwp_output_file::Dwp_index::Section_table): New type.
  2948. (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
  2949. (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
  2950. parameter.
  2951. (Dwp_output_file::Dwp_index::shndx_pool): Remove.
  2952. (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
  2953. (Dwp_output_file::Dwp_index::section_table): New member function.
  2954. (Dwp_output_file::Dwp_index::section_table_end): New member function.
  2955. (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
  2956. (Dwp_output_file::Dwp_index::section_table_rows): New member function.
  2957. (Dwp_output_file::Dwp_index::section_table_cols): New member function.
  2958. (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
  2959. (Dwp_output_file::Dwp_index::section_table_): New data member.
  2960. (Dwp_output_file::Dwp_index::section_mask_): New data member.
  2961. (Dwp_output_file::add_output_section): New member function.
  2962. (Dwp_output_file::write_new_section): New member function.
  2963. (Dwp_output_file::write_contributions): New member function.
  2964. (Dwp_output_file::section_id_map_): New data member.
  2965. (class Dwo_id_info_reader): Remove.
  2966. (class Unit_reader): New class.
  2967. (get_dwarf_section_name): New function.
  2968. (Dwo_file::read_executable): Adjust initializations of class data.
  2969. (Dwo_file::read): Add support for v2 package file format.
  2970. (Dwo_file::read_unit_index): Likewise.
  2971. (Dwo_file::sized_read_unit_index): Likewise.
  2972. (Dwo_file::copy_section): Likewise.
  2973. (Dwo_file::add_unit_set): Likewise.
  2974. (Dwp_output_file::add_output_section): Likewise.
  2975. (Dwp_output_file::add_contribution): Likewise.
  2976. (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
  2977. for empty slot.
  2978. (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
  2979. file format.
  2980. (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
  2981. slot.
  2982. (Dwp_output_file::initialize): Remove unused function.
  2983. (Dwp_output_file::finalize): Add support for v2 package file format.
  2984. (Dwp_output_file::write_index): Likewise.
  2985. * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
  2986. function prototype.
  2987. 2013-03-01 Cary Coutant <ccoutant@google.com>
  2988. * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
  2989. function into class definition in header file.
  2990. (Dwarf_info_reader::warn_corrupt_debug_section): New function.
  2991. * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
  2992. New function.
  2993. (Dwarf_info_reader::check_buffer): Move here from .cc file.
  2994. 2013-02-28 Alan Modra <amodra@gmail.com>
  2995. * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
  2996. * target.cc (Target::do_plt_fde_location): New function.
  2997. * ehframe.h (class FDE): Add post_map field to u_.from_linker,
  2998. accessor function, and constructor param.
  2999. (struct Post_fde, Post_fdes): Declare.
  3000. (Cie::write): Add post_fdes param.
  3001. * ehframe.cc (Fde::write): Use plt_fde_location.
  3002. (struct Post_fde): Define.
  3003. (Cie::write): Stash FDEs added post merge mapping.
  3004. (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
  3005. Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
  3006. (Eh_frame::do_sized_write): Arrange to write post map FDES after
  3007. other FDEs.
  3008. * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
  3009. (Target_powerpc::has_glink): New function.
  3010. (Target_powerpc::do_relax): Add eh_frame info for stubs.
  3011. (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
  3012. glink_eh_frame_fde_32, default_fde): New data.
  3013. (Stub_table::eh_frame_added_): New var.
  3014. (Stub_table::find_long_branch_entry, stub_address, stub_offset):
  3015. Make const.
  3016. (Stub_table::add_eh_frame): New function.
  3017. (Output_data_glink::add_eh_frame): New function.
  3018. (Target_powerpc::make_glink_section): Call add_eh_frame.
  3019. 2013-02-15 Ian Lance Taylor <iant@google.com>
  3020. * options.h (DEFINE_uint64_alias): Define.
  3021. (class General_options): Add -Ttext-segment as an alias for
  3022. -Ttext.
  3023. 2013-02-15 Alan Modra <amodra@gmail.com>
  3024. * powerpc.cc (Stub_table::plt_off): New function, extracted from..
  3025. (Stub_table::do_write): ..here, two places.
  3026. (Stub_table::plt_call_size): Use it here too.
  3027. 2013-02-11 Ian Lance Taylor <iant@google.com>
  3028. * descriptors.cc (Descriptors::close_all): New function.
  3029. * descriptors.h (class Descriptors): Declare close_all.
  3030. (close_all_descriptors): New inline function.
  3031. * plugin.cc: Include "descriptors.h".
  3032. (Plugin_manager::cleanup): Call close_all_descriptors.
  3033. 2013-02-06 Alan Modra <amodra@gmail.com>
  3034. * README: Update coding style link.
  3035. 2013-01-28 Cary Coutant <ccoutant@google.com>
  3036. * dwp.cc (File_list): New typedef.
  3037. (Dwo_name_info_reader): New class.
  3038. (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
  3039. (Dwo_id_info_reader::visit_top_die): Remove unused member function.
  3040. (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
  3041. (Dwo_file::read_executable): New function.
  3042. (Dwo_file::read): Move common setup code to ...
  3043. (Dwo_file::make_object): ... here.
  3044. (dwp_options): Add --exec/-e.
  3045. (usage): Likewise.
  3046. (main): Likewise.
  3047. 2013-01-24 Sriraman Tallam <tmsriram@google.com>
  3048. * layout.cc (Layout::layout): Check for option text_reorder.
  3049. (Layout::make_output_section): Ditto.
  3050. * options.h (text_reorder): New option.
  3051. * output.cc (Input_section_sort_compare): Remove special ordering
  3052. of section names.
  3053. (Output_section::
  3054. Input_section_sort_section_name_special_ordering_compare::
  3055. operator()): New function.
  3056. (Output_section::sort_attached_input_sections): Use new sort function
  3057. for .text.
  3058. * output.h (Input_section_sort_section_name_special_ordering_compare):
  3059. New struct.
  3060. * testsuite/Makefile.am (text_section_grouping): Test option
  3061. --no-text-reorder
  3062. * testsuite/Makefile.in: Regenerate.
  3063. * testsuite/text_section_grouping.sh: Check order of functions without
  3064. default text reordering.
  3065. 2013-01-18 Mike Frysinger <vapier@gentoo.org>
  3066. * options.h (General_options): Change default to true for new_dtags.
  3067. 2013-01-18 Mike Frysinger <vapier@gentoo.org>
  3068. * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
  3069. when enable_new_dtags is false. Only add DT_RUNPATH when
  3070. enable_new_dtags is true.
  3071. 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
  3072. * powerpc.cc (Stub_table::find_plt_call_entry): Make types
  3073. used in declaration and definition consistent.
  3074. (Target_powerpc::symval_for_branch): Ditto.
  3075. 2013-01-16 Sriraman Tallam <tmsriram@google.com>
  3076. * testsuite/plugin_final_layout.cc: Fix comment.
  3077. 2013-01-16 Sriraman Tallam <tmsriram@google.com>
  3078. * layout.cc (Layout::layout): Do not do default sorting for
  3079. text sections when section ordering is specified.
  3080. (make_output_section): Ditto.
  3081. * testsuite/plugin_final_layout.cc: Name the function sections
  3082. to catch reordering issues.
  3083. 2013-01-15 Alan Modra <amodra@gmail.com>
  3084. * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
  3085. plt-thread-safe.
  3086. 2013-01-15 Alan Modra <amodra@gmail.com>
  3087. * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
  3088. * testsuite/Makefile.in: Regenerate.
  3089. 2013-01-14 Alan Modra <amodra@gmail.com>
  3090. * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
  3091. * testsuite/Makefile.in: Regenerate.
  3092. 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
  3093. PR bfd/14430
  3094. Fix mingw gold build with plugins enabled
  3095. * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
  3096. * configure.ac: Export DLOPEN_LIBS and add headers check.
  3097. * plugin.cc: Handle non-dlfcn case.
  3098. * Makefile.in: Regenerate.
  3099. * config.in: Regenerate.
  3100. * configure: Regenerate.
  3101. * testsuite/Makefile.in: Regenerate.
  3102. 2013-01-09 Sriraman Tallam <tmsriram@google.com>
  3103. * output.h (sort_attached_input_sections): Change to be public.
  3104. * script-sections.cc
  3105. (Output_section_definition::set_section_addresses): Sort
  3106. attached input sections according to section order before linker
  3107. script assigns section addresses.
  3108. (Orphan_output_section::set_section_addresses): Sort
  3109. attached input sections according to section order before linker
  3110. script assigns section addresses.
  3111. * Makefile.am (final_layout.sh): Use a simple linker script to
  3112. check if section ordering still works.
  3113. * Makefile.in: Regenerate.
  3114. 2013-01-09 Ben Cheng <bccheng@google.com>
  3115. * arm.cc (Target_arm::attributes_accept_div): New function.
  3116. (Target_arm::attributes_forbid_div): New function.
  3117. (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
  3118. attribute using the same new functions as what bfd/elf32_arm.c
  3119. does.
  3120. 2013-01-07 Cary Coutant <ccoutant@google.com>
  3121. PR gold/14993
  3122. * output.cc (Output_section::add_input_section): For incremental
  3123. updates, don't track input sections that are allocated from patch
  3124. space.
  3125. 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
  3126. Ian Lance Taylor <iant@google.com>
  3127. PR gold/14897
  3128. * configure.ac (--enable-ld): Removed.
  3129. (install_as_default): Set to yes only for --enable-gold=default
  3130. or --disable-ld.
  3131. * configure: Regenerated.
  3132. 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
  3133. * options.h (General_options): Add -fuse-ld= for GCC linker
  3134. option compatibility.
  3135. 2013-01-04 Cary Coutant <ccoutant@google.com>
  3136. * configure.ac: Fix typo restoring CXXFLAGS.
  3137. * configure: Regenerate.
  3138. 2013-01-04 Cary Coutant <ccoutant@google.com>
  3139. * testsuite/Makefile.am (CXXLINK_S): New macro.
  3140. (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
  3141. * testsuite/Makefile.in: Regenerate.
  3142. 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
  3143. * version.cc (print_version): Update copyright year to 2013.
  3144. 2012-12-20 Ian Lance Taylor <iant@google.com>
  3145. * layout.cc (Layout::special_ordering_of_input_section): New
  3146. function.
  3147. (Layout::layout): If input section requires special ordering, must
  3148. sort input sections.
  3149. (Layout::make_output_section): May sort .text input sections.
  3150. (Layout::is_section_name_prefix_grouped): Remove.
  3151. * layout.h (class Layout): Declare
  3152. special_ordering_of_input_section. Don't declare
  3153. is_section_name_prefix_grouped.
  3154. * output.cc (Output_section::add_input_section): Revert last
  3155. change.
  3156. (Output_section::Input_section_sort::match_file_name): Don't crash
  3157. if called on output section data.
  3158. (Output_section::Input_section_sort_compare): Sort based on
  3159. special ordering.
  3160. (Output_section::Input_section_sort_section_order_index_compare):
  3161. Revert last patch.
  3162. (Output_section::sort_attached_input_sections): Likewise.
  3163. 2012-12-18 Sriraman Tallam <tmsriram@google.com>
  3164. * layout.cc (Layout::is_section_name_prefix_grouped): New function.
  3165. * layout.h (Layout::is_section_name_prefix_grouped): New function.
  3166. * output.cc (Output_section::add_input_section): Check if section
  3167. name contains special prefix. Keep input sections to sort such
  3168. sections.
  3169. (Output_section::Input_section_sort_section_order_index_compare
  3170. ::operator()): Group sections according to prefixes.
  3171. (Output_section::sort_attached_input_sections): Add condition to
  3172. Input_section_entry constructor call.
  3173. * testsuite/Makefile.am (text_section_grouping): New test.
  3174. * testsuite/Makefile.in: Regenerate.
  3175. * testsuite/text_section_grouping.cc: New file.
  3176. * testsuite/text_section_grouping.sh: New file.
  3177. 2012-12-17 Nick Clifton <nickc@redhat.com>
  3178. * Makefile.am: Add copyright notice.
  3179. * NEWS: Likewise.
  3180. * README: Likewise.
  3181. * configure.ac: Likewise.
  3182. * ftruncate.c: Likewise.
  3183. * Makefile.in: Regenerate.
  3184. 2012-12-14 Cary Coutant <ccoutant@google.com>
  3185. * testsuite/Makefile.am (exception_separate_shared_12_test): Add
  3186. --no-as-needed flag.
  3187. (exception_separate_shared_12_test): Likewise.
  3188. (incremental_copy_test): Likewise.
  3189. * testsuite/Makefile.in: Regenerate.
  3190. 2012-12-14 Cary Coutant <ccoutant@google.com>
  3191. * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
  3192. (Dwp_output_file::Dwp_index::enter_set): Add assert.
  3193. 2012-12-12 Alan Modra <amodra@gmail.com>
  3194. * powerpc.cc (class Track_tls): New.
  3195. (class Relocate, class Scan): Inherit Track_tls.
  3196. (Target_powerpc::Scan::local, global): Track tls optimization
  3197. and avoid creating plt entry for __tls_get_addr if all uses
  3198. are optimized away.
  3199. (Target_powerpc::Relocate::relocate): Update to use Track_tls.
  3200. 2012-12-12 Alan Modra <amodra@gmail.com>
  3201. * options.h (General_options): Add --toc-sort/--no-toc-sort.
  3202. Replace no_toc_optimize with toc_optimize.
  3203. * output.h (Output_section::input_sections): Provide non-const variant.
  3204. * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
  3205. set_has_small_toc_reloc, has_small_toc_reloc): New variable and
  3206. accessors.
  3207. (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
  3208. (class Sort_toc_sections): New.
  3209. (Target_powerpc::do_finalize_sections): Sort toc sections.
  3210. (Target_powerpc::Relocate::relocate): Update toc_optimize test.
  3211. 2012-12-10 Roland McGrath <mcgrathr@google.com>
  3212. * testsuite/binary_unittest.cc (read_all): New function.
  3213. (Sized_binary_test): Use it instead of ::read.
  3214. * fileread.cc (do_read): Don't assume pread always reads the whole
  3215. amount in a single call.
  3216. 2012-12-10 Alan Modra <amodra@gmail.com>
  3217. * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
  3218. Set EM_PPC64 or EM_PPC here.
  3219. (Target_selector_powerpc::do_recognize): Delete.
  3220. 2012-12-10 Alan Modra <amodra@gmail.com>
  3221. * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
  3222. stub_table_.
  3223. (Target_powerpc::Branch_info::make_stub): Don't omit addend.
  3224. 2012-12-07 Roland McGrath <mcgrathr@google.com>
  3225. * testsuite/binary_unittest.cc (Sized_binary_test):
  3226. Use open_descriptor rather than ::open.
  3227. 2012-12-07 Alan Modra <amodra@gmail.com>
  3228. * powerpc.cc (Stub_table::do_write): Delete redundant Address
  3229. typedef and invalid_address constant.
  3230. (Output_data_glink, Stub_table, Target_powerpc): Explicitly
  3231. instantiate constants.
  3232. 2012-12-06 Roland McGrath <mcgrathr@google.com>
  3233. * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
  3234. Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
  3235. * aclocal.m4: Regenerate.
  3236. * configure: Regenerate.
  3237. * Makefile.in: Regenerate.
  3238. * testsuite/Makefile.in: Regenerate.
  3239. 2012-12-07 Alan Modra <amodra@gmail.com>
  3240. * options.h (General_options): Add no_toc_optimize.
  3241. * powerpc.cc (ok_lo_toc_insn): New function.
  3242. (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
  3243. 2012-12-06 Alan Modra <amodra@gmail.com>
  3244. * options.h (General_options): Add plt_align, plt_static_chain,
  3245. plt_thread_safe. Update stub_group_size help text.
  3246. * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
  3247. for new plt_thread_safe_ var.
  3248. (use_plt_offset): Correct comments.
  3249. (Target_powerpc::do_relax): Look for thread creation symbols to
  3250. determine default plt_thread_safe value. Clear plt call stubs
  3251. as well as branch stubs each iteration.
  3252. (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
  3253. insn constants.
  3254. (l, hi, ha, write_insn): Move earlier.
  3255. (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
  3256. (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
  3257. plt stubs too.
  3258. (Stub_table::update_size): Adjust.
  3259. (Stub_table::prev_size, set_prev_size): Delete.
  3260. (Stub_table::stub_align): Let --plt-align affect result.
  3261. (Stub_table::plt_call_size): Calculate sizes for various stubs.
  3262. (Stub_table::branch_stub_size): Use last_plt_size in address calc.
  3263. (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
  3264. (Stub_table::do_write): Support more stub variants.
  3265. 2012-12-04 Alan Modra <amodra@gmail.com>
  3266. * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
  3267. (Target_powerpc::do_define_standard_symbols): New function.
  3268. 2012-12-03 Alan Modra <amodra@gmail.com>
  3269. * output.h: Formatting, whitespace.
  3270. 2012-12-03 Alan Modra <amodra@gmail.com>
  3271. * layout.h (Layout::get_executable_sections): Declare.
  3272. * layout.cc (Layout::get_executable_sections): New function.
  3273. * arm.cc (Target_arm::group_sections): Use it.
  3274. (Arm_output_section::group_sections): Delete now redundant test.
  3275. * output.cc (Output_reloc::Output_reloc): Add is_relative.
  3276. param to handle relative relocs.
  3277. * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
  3278. (Output_data_reloc::add_absolute): Adjust.
  3279. (Output_data_reloc::add_relative): New function.
  3280. (Output_data::reset_data_size): New function.
  3281. (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
  3282. (Output_section::set_addralign): New function.
  3283. (Output_section::checkpoint_set_addralign): New function.
  3284. (Output_section::clear_section_offsets_need_adjustment): New function.
  3285. (Output_section::input_sections): Make public.
  3286. * powerpc.cc (class Output_data_brlt_powerpc): New.
  3287. (class Stub_table, class Stub_control): New.
  3288. (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
  3289. stub_table_, set_stub_table, stub_table): New vectors and accessor
  3290. functions.
  3291. (Target_powerpc::do_may_relax, do_relax, push_branch,
  3292. new_stub_table, stub_tables, brlt_section, group_sections,
  3293. add_branch_lookup_table, find_branch_lookup_table,
  3294. write_branch_lookup_table, make_brlt_section): New functions.
  3295. (Target_powerpc::struct Sort_sections, class Branch_info): New.
  3296. (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
  3297. branch_info_): New vars.
  3298. (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
  3299. make call stubs here.
  3300. (Output_data_glink): Remove all call stub handling from this class.
  3301. (Target_powerpc::Scan::local, global): Save interesting branch
  3302. relocs and relocs for ifunc. Adjust calls to plt entry functions.
  3303. (Target_powerpc::do_finalize_sections): Only make reg save/restore
  3304. functions on final link.
  3305. (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
  3306. Handle long branch destinations too.
  3307. (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
  3308. do_plt_address_for_local): Adjust lookup of plt call stubs.
  3309. 2012-11-30 Alan Modra <amodra@gmail.com>
  3310. * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
  3311. relocs against protected symbols when building 32-bit shared libs.
  3312. 2012-11-30 Alan Modra <amodra@gmail.com>
  3313. * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
  3314. param. Call got_section() to make .got. Update all callers
  3315. and their callers and so on.
  3316. 2012-11-30 Alan Modra <amodra@gmail.com>
  3317. * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
  3318. _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
  3319. (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
  3320. value if it already exists.
  3321. 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
  3322. PR gold/14858
  3323. * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
  3324. 2012-11-14 Roland McGrath <mcgrathr@google.com>
  3325. * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
  3326. than bfc instruction for data sandboxing.
  3327. 2012-11-08 Alan Modra <amodra@gmail.com>
  3328. * po/POTFILES.in: Regenerate.
  3329. 2012-11-05 Alan Modra <amodra@gmail.com>
  3330. * configure.ac: Apply 2012-09-10 change to config.in here.
  3331. * configure: Regenerate.
  3332. 2012-11-05 Alan Modra <amodra@gmail.com>
  3333. * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
  3334. (struct Opd_ent): Use "Address" rather than "Offset".
  3335. (Output_data_got_powerpc::got_base_offset): Return Valtype.
  3336. (Target_powerpc::got_section): Make public.
  3337. (Target_powerpc::scan_relocs): Move code setting symbols..
  3338. (Powerpc_relobj::do_scan_relocs): ..to here, new function.
  3339. Create _SDA_BASE_ only when referenced.
  3340. 2012-11-02 Roland McGrath <mcgrathr@google.com>
  3341. * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
  3342. from last change.
  3343. 2012-11-01 Roland McGrath <mcgrathr@google.com>
  3344. * target.h (Sized_target::relocate_relocs): Use Elf_Off
  3345. for offset_in_output_section parameter.
  3346. (Sized_target::relocate_special_relocatable): Likewise.
  3347. * arm.cc (Target_arm::relocate_relocs): Likewise.
  3348. (Target_arm::relocate_special_relocatable): Likewise.
  3349. * i386.cc (Target_i386::relocate_relocs): Likewise.
  3350. * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
  3351. * sparc.cc (Target_sparc::relocate_relocs): Likewise.
  3352. * target-reloc.h (relocate_relocs): Likewise.
  3353. * testsuite/testfile.cc (Target_test): Likewise.
  3354. * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
  3355. * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
  3356. * system.h: Move inclusion of <clocale> to after <libintl.h> in
  3357. [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
  3358. * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
  3359. parameter, which is unused in the [!F_SETFD] case.
  3360. * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
  3361. SYMNDX to off_t before comparing it to this->data_size().
  3362. * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
  3363. * incremental.cc (Output_section_incremental_inputs::do_write):
  3364. Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
  3365. * nacl.cc: Include "libiberty.h" for vasprintf declaration.
  3366. 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
  3367. * gold.cc (Target_arm::do_adjust_elf_header): Add the
  3368. hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
  3369. in EABI_VER5.
  3370. 2012-10-29 Cary Coutant <ccoutant@google.com>
  3371. * dwp.cc (usage): Add file and exit status parameters;
  3372. add --help and --version options.
  3373. (print_version): New function.
  3374. (main): Add --help and --version options.
  3375. 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
  3376. * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
  3377. final_layout_sequence.txt.
  3378. * testsuite/Makefile.in: Regenerated.
  3379. 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
  3380. * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
  3381. COMPILE generated by automake.
  3382. (LINK1): Likewise.
  3383. (CXXCOMPILE1): Likewise.
  3384. (CXXLINK1): Likewise.
  3385. (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
  3386. (LINK): Likewise.
  3387. (CXXCOMPILE): Likewise.
  3388. (CXXLINK): Likewise.
  3389. * testsuite/Makefile.in: Regenerated.
  3390. 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
  3391. * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
  3392. on bad fwrite return.
  3393. 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
  3394. * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
  3395. on val.
  3396. 2012-10-23 Cary Coutant <ccoutant@google.com>
  3397. * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
  3398. * testsuite/Makefile.in: Regenerate.
  3399. * testsuite/dwp_test.h: New source file.
  3400. * testsuite/dwp_test_1.cc: New source file.
  3401. * testsuite/dwp_test_1.s: New source file.
  3402. * testsuite/dwp_test_1.sh: New source file.
  3403. * testsuite/dwp_test_1b.cc: New source file.
  3404. * testsuite/dwp_test_1b.s: New source file.
  3405. * testsuite/dwp_test_2.cc: New source file.
  3406. * testsuite/dwp_test_2.s: New source file.
  3407. * testsuite/dwp_test_2.sh: New source file.
  3408. * testsuite/dwp_test_main.cc: New source file.
  3409. * testsuite/dwp_test_main.s: New source file.
  3410. 2012-10-23 Cary Coutant <ccoutant@google.com>
  3411. * dwp.h: New header file.
  3412. * dwp.cc: New source file.
  3413. * gold.h: Move shared declarations to system.h.
  3414. * system.h: New header file.
  3415. * Makefile.am: Add dwp.
  3416. * Makefile.in: Regenerate.
  3417. 2012-10-23 Cary Coutant <ccoutant@google.com>
  3418. * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
  3419. Dwarf_info_reader::read_from_pointer.
  3420. (Dwarf_pubnames_table::read_header): Likewise.
  3421. (Dwarf_pubnames_table::next_name): Likewise.
  3422. (Dwarf_die::read_attributes): Likewise.
  3423. (Dwarf_die::skip_attributes): Likewise.
  3424. (Dwarf_info_reader::read_from_pointer): New function template.
  3425. * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
  3426. (Dwarf_pubnames_table): Likewise.
  3427. (Dwarf_info_reader::read_from_pointer): New function template.
  3428. * gdb-index.cc (Gdb_index_info_reader): Adjust call to
  3429. Dwarf_pubnames_table ctor.
  3430. 2012-10-23 Cary Coutant <ccoutant@google.com>
  3431. * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
  3432. abbrev_shndx.
  3433. * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
  3434. abbrev_shndx_.
  3435. (Dwarf_info_reader::set_abbrev_shndx): New method.
  3436. (Dwarf_info_reader::abbrev_shndx_): New data member.
  3437. 2012-10-23 Cary Coutant <ccoutant@google.com>
  3438. * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
  3439. from object, not parameters.
  3440. (Dwarf_info_reader::parse): Likewise.
  3441. * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
  3442. (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
  3443. (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
  3444. methods.
  3445. 2012-10-23 Cary Coutant <ccoutant@google.com>
  3446. * fileread.cc (Input_file::Input_file): New constructor.
  3447. * fileread.h (class Input_file): Add new constructor.
  3448. 2012-10-18 Alan Modra <amodra@gmail.com>
  3449. PR gold/14727
  3450. * object.cc (Relobj::is_section_name_included): Also match
  3451. .sdata personality section.
  3452. 2012-10-18 Alan Modra <amodra@gmail.com>
  3453. * target-reloc.h (class Default_comdat_behavior): New, package up..
  3454. (get_comdat_behaviour): ..this.
  3455. (relocate_section): Add Relocate_comdat_behavior template arg,
  3456. adjust code to suit.
  3457. * arm.cc (Target_arm::relocate_section): Adjust to suit.
  3458. (Target_arm::scan_reloc_section): Likewise.
  3459. * i386.cc (Target_i386::relocate_section): Likewise.
  3460. * sparc.cc (Target_sparc::relocate_section): Likewise.
  3461. * tilegx.cc (Target_tilegx::relocate_section): Likewise.
  3462. * x86_64.cc (Target_x86_64::relocate_section): Likewise.
  3463. * powerpc.cc (class Relocate_comdat_behavior): New.
  3464. (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
  3465. gold::relocate_section with new template arg.
  3466. 2012-10-18 Alan Modra <amodra@gmail.com>
  3467. * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
  3468. dynamic relocs for GOT_TPREL got entries, without symbol if
  3469. resolving locally.
  3470. (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
  3471. (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
  3472. (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
  3473. 2012-10-17 Alan Modra <amodra@gmail.com>
  3474. PR gold/14726
  3475. * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
  3476. 2012-10-16 Sriraman Tallam <tmsriram@google.com>
  3477. * layout.cc (Layout::include_section): Keep sections marked
  3478. SHF_EXCLUDE when doing relocatable links.
  3479. 2012-10-16 Alan Modra <amodra@gmail.com>
  3480. * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
  3481. (Target_powerpc::do_finalize_sections): Call it.
  3482. (Output_data_save_res): New class and supporting functions.
  3483. (Target_powerpc::symval_for_branch): Only look up .opd entry for
  3484. normal symbols defined in object files.
  3485. 2012-10-12 Alan Modra <amodra@gmail.com>
  3486. * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
  3487. (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
  3488. (Target_powerpc::do_gc_mark_symbol): Delay marking function code
  3489. section if scan_opd_relocs not yet called.
  3490. (Target_powerpc::gc_process_relocs): Call process_gc_mark.
  3491. 2012-10-12 Alan Modra <amodra@gmail.com>
  3492. * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
  3493. add_local_ifunc_entry): Revert last change.
  3494. (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
  3495. 2012-10-05 Alan Modra <amodra@gmail.com>
  3496. * powerpc.cc (Target_powerpc::do_plt_address_for_local,
  3497. do_plt_address_for_global): New functions.
  3498. (Output_data_got_powerpc::do_write): Don't segfault when linking
  3499. statically.
  3500. (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
  3501. add_local_ifunc_entry): Return true on adding entry..
  3502. (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
  3503. glink->add_entry call. Remove unused symtab param. Adjust calls.
  3504. (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
  3505. (Target_powerpc::make_iplt_section): Remove symtab param. Don't
  3506. set up symbols here.
  3507. (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
  3508. syms here. Do so even when no .iplt. Don't segfault when linking
  3509. statically.
  3510. (Output_data_glink::add_entry, find_entry): Rearrange params. Add
  3511. new variants without reloc param.
  3512. (Glink_sym_ent::Glink_sym_ent): Likewise.
  3513. (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
  3514. reloc when refs will resolve to plt call stub.
  3515. (Target_powerpc::Scan::local): Correct ifunc handling. Allow
  3516. R_PPC_PLTREL24 to resolve locally.
  3517. (Target_powerpc::Scan::global): Correct ifunc handling.
  3518. (Target_powerpc::Relocate::relocate): Correct local sym glink
  3519. lookup. Don't destroy "value" when we have a plt call stub,
  3520. and when checking plt call validity.
  3521. (Target_powerpc::do_dynsym_value): Simplify.
  3522. 2012-10-05 Alan Modra <amodra@gmail.com>
  3523. * i386.cc (Output_data_plt_i386::address_for_global,
  3524. address_for_local): Add plt offset to returned value. Adjust uses.
  3525. * sparc.cc (Output_data_plt_sparc::address_for_global,
  3526. address_for_local): Likewise.
  3527. * tilegx.cc (Output_data_plt_tilegx::address_for_global,
  3528. address_for_local): Likewise.
  3529. * x86_64.cc (Output_data_plt_x86_64::address_for_global,
  3530. address_for_local): Likewise.
  3531. * target.h (Target::plt_address_for_global, plt_address_for_local):
  3532. Update comment.
  3533. * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
  3534. (Output_data_got::Got_entry::write): Nor here.
  3535. * output.h: Comment fix.
  3536. 2012-10-02 Jiong Wang <jiwang@tilera.com>
  3537. * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
  3538. global_offset_table_ value for larget got.
  3539. (Target_tilegx::Relocate::relocate): Handle adjusted got value.
  3540. 2012-09-29 Alan Modra <amodra@gmail.com>
  3541. * powerpc.cc (Target_powerpc::iplt_): New output section.
  3542. (Target_powerpc::iplt_section, make_iplt_section,
  3543. reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
  3544. (Target_powerpc::make_plt_entry): Handle ifunc syms.
  3545. Target_powerpc::plt_entry_count): Count iplt entries too.
  3546. (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
  3547. reloc section in constructor. New params.
  3548. (Target_powerpc::make_plt_section): Create reloc section here instead.
  3549. (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
  3550. functions.
  3551. (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
  3552. (Output_data_glink::add_entry, find_entry): New functions to
  3553. deal with local syms.
  3554. (Glink_sym_ent): Add support for local syms.
  3555. (Output_data_glink::do_write): Handle ifunc plt entries.
  3556. (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
  3557. (Target_powerpc::Scan::local, global): Handle ifunc syms.
  3558. (Target_powerpc::Relocate::relocate): Likewise.
  3559. (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
  3560. 2012-09-25 Alan Modra <amodra@gmail.com>
  3561. * object.h (Sized_relobj_file::adjust_local_symbol,
  3562. do_adjust_local_symbol): New functions.
  3563. * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
  3564. * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
  3565. (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
  3566. and irregular opd entry spacing.
  3567. (Powerpc_relobj::do_read_relocs): Add opd size checks.
  3568. (Global_symbol_visitor_opd): New functor.
  3569. (Target_powerpc::do_finalize_sections): Omit global symbols defined
  3570. on deleted opd entries.
  3571. 2012-09-15 Jiong Wang <jiwang@tilera.com>
  3572. * tilegx.cc: New file.
  3573. * Makefile.am (TARGETSOURCES): Add tilegx.cc
  3574. (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
  3575. * configure.tgt: Add entries for tilegx*.
  3576. * configure.ac: Likewise.
  3577. * Makefile.in: Rebuild.
  3578. * configure: Likewise.
  3579. * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
  3580. tilegx.
  3581. 2012-09-13 Alan Modra <amodra@gmail.com>
  3582. * target-reloc.h (scan_relocs): Call scan.local for relocs
  3583. against symbols in discarded sections. Pass is_discarded
  3584. param.
  3585. * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
  3586. Add is_discarded param.
  3587. * powerpc (Target_powerpc::Scan::local): Likewise. Use
  3588. is_discarded to flag opd entry as discarded. Don't emit dyn
  3589. relocs on such entries.
  3590. (Target_powerpc::Scan::global): Similarly detect and handle
  3591. such opd entries.
  3592. (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
  3593. opd_ent_. Update all uses.
  3594. (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
  3595. (Target_powerpc::relocate_section): Zero out discarded opd
  3596. entry relocs.
  3597. 2012-09-12 Ian Lance Taylor <iant@google.com>
  3598. PR gold/14570
  3599. * output.cc: Rename Output_data_got template parameter from size
  3600. to got_size for all functions. Compile all variants of
  3601. Output_data_got.
  3602. (Output_data_got::Got_entry::write): Correct use of size for
  3603. symbol value. Use local_is_tls rather than casting to
  3604. Sized_relobj_file.
  3605. * object.h (class Object): Add local_is_tls and do_local_is_tls.
  3606. (class Sized_relobj_file): Add do_local_is_tls.
  3607. * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
  3608. 2012-09-11 Alan Modra <amodra@gmail.com>
  3609. PR gold/14566
  3610. * layout.cc (Layout::set_segment_offsets): When using
  3611. common-page-size alignment, ensure we are on a new max-page-size
  3612. page.
  3613. * output.cc (Output_segment::set_section_addresses): Use
  3614. abi_pagesize, not common_pagesize for relro boundary.
  3615. (Output_segment::set_offset): Likewise.
  3616. 2012-09-11 Alan Modra <amodra@gmail.com>
  3617. * output.h (Output_data_got::add_global_tls, add_local_tls,
  3618. add_local_tls_pair): New functions.
  3619. (Output_data_got::add_local_pair_with_rel): Remove second
  3620. reloc param. Expand comment.
  3621. (Output_data_got::Got_entry): Rename use_plt_offset_ to
  3622. use_plt_or_tls_offset_, similarly for constructor param.
  3623. (Output_data_got::Got_entry::write): Add got_index param.
  3624. * output.cc (Output_data_got::add_global_tls, add_local_tls,
  3625. add_local_tls_pair): New functions.
  3626. (Output_data_got::Got_entry::write): Handle tls symbols
  3627. with use_plt_or_tls_offset_ set specially.
  3628. (Output_data_got::add_local_pair_with_rel): Only one reloc.
  3629. (Output_data_got::do_write): Replace iterator with index, pass
  3630. index to entry write function.
  3631. * target.h (Target::tls_offset_for_local, tls_offset_for_global,
  3632. do_tls_offset_for_local, do_tls_offset_for_global): New functions.
  3633. * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
  3634. call.
  3635. * i386.cc (Target_i386::Scan::local): Likewise.
  3636. * sparc.cc (Target_sparc::Scan::local): Likewise.
  3637. * x86_64.cc (Target_x86_64::Scan::local): Likewise.
  3638. * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
  3639. do_tls_offset_for_global): New functions.
  3640. (Target_powerpc::Scan::local): Correct TLS relocations and got
  3641. entry values.
  3642. (Target_powerpc::Scan::global): Don't emit unnecessary
  3643. dynamic relocations on TLS GOT entries.
  3644. 2012-09-10 Matthias Klose <doko@ubuntu.com>
  3645. * config.in: Disable sanity check for kfreebsd.
  3646. 2012-09-10 Sterling Augustine <saugustine@google.com>
  3647. * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
  3648. (Gdb_index::pubtypes_read): New parameter.
  3649. (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
  3650. to calls.
  3651. * gdb-index.h (Gdb_index): New fields pubnames_object_ and
  3652. pubtypes_object_.
  3653. 2012-09-09 Alan Modra <amodra@gmail.com>
  3654. * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
  3655. (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
  3656. * gc.h (gc_process_relocs): Call target gc_add_reference.
  3657. * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
  3658. * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
  3659. (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
  3660. unnecessary cast.
  3661. * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
  3662. to cater for when we don't need code offset. Update use.
  3663. (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
  3664. (Powerpc_relobj::access_from_map, add_reference, opd_valid,
  3665. set_opd_valid): New functions.
  3666. (Target_powerpc::do_gc_add_reference): New function.
  3667. (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
  3668. stashed refs.
  3669. (Target_powerpc::do_gc_mark_symbol): New function.
  3670. 2012-09-06 Cary Coutant <ccoutant@google.com>
  3671. * dwarf_reader.cc (Dwarf_die::read_attributes): Add
  3672. DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
  3673. (Dwarf_die::skip_attributes): Likewise.
  3674. * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
  3675. * testsuite/gdb_index_test.cc (inline_func_1): New function.
  3676. (main): Call it.
  3677. * testsuite/gdb_index_test_comm.sh: Check index for inline function.
  3678. 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
  3679. * testsuite/script_test_3.t: Add .got.plt output section
  3680. statement.
  3681. * testsuite/script_test_4.t: Likewise.
  3682. 2012-09-05 Alan Modra <amodra@gmail.com>
  3683. * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
  3684. update all uses and lose "enum" when using type.
  3685. 2012-09-05 Alan Modra <amodra@gmail.com>
  3686. * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
  3687. * configure: Regenerate.
  3688. * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
  3689. (plugin_final_layout.stdout): Likewise.
  3690. (memory_test): Set page sizes to 0x1000.
  3691. * testsuite/Makefile.in: Regenerate.
  3692. * testsuite/discard_locals_test.sh: Add FIXME comment.
  3693. * testsuite/justsyms_exec.c: Disable function test for powerpc64.
  3694. * testsuite/pr14265.t: Add .got output section statement.
  3695. * testsuite/script_test_2.t: Likewise.
  3696. * testsuite/script_test_3.t: Likewise.
  3697. * testsuite/script_test_4.t: Likewise.
  3698. * testsuite/script_test_5.t: Likewise.
  3699. * testsuite/script_test_6.t: Likewise.
  3700. * testsuite/script_test_7.t: Likewise.
  3701. * testsuite/script_test_9.t: Likewise.
  3702. 2012-09-05 Alan Modra <amodra@gmail.com>
  3703. * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
  3704. (Powerpc_relocate_functions::Status): New typedef.
  3705. (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
  3706. (Target_powerpc::Scan::local): Handle REL64.
  3707. (Target_powerpc::Scan::global): Likewise, and dynamic relocs
  3708. for REL32 and REL64.
  3709. (Target_powerpc::symval_for_branch): New function, extracted from..
  3710. (Target_powerpc::Relocate::relocate): ..here. Correct plt call
  3711. checks. Report overflow errors.
  3712. 2012-09-05 Alan Modra <amodra@gmail.com>
  3713. * object.h (Sized_relobj_file::emit_relocs): Delete.
  3714. (Sized_relobj_file::emit_relocs_reltype): Delete.
  3715. * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
  3716. relocate_relocs for --emit-relocs.
  3717. (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
  3718. * output.h: Update comment.
  3719. (Output_segment::first_section): New function.
  3720. (Output_segment::first_section_load_address): Use first_section.
  3721. * output.cc (Output_segment::first_section): New function extracted..
  3722. (Output_segment::first_section_load_address): ..from here. Delete.
  3723. * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
  3724. * target.h (Sized_target::relocate_for_relocatable): Likewise.
  3725. * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
  3726. adjust call to target.h function.
  3727. * i386.cc (Target_i386): Likewise.
  3728. * sparc.cc (Target_sparc): Likewise.
  3729. * x86_64.cc (Target_x86_64): Likewise.
  3730. * powerpc.cc (Target_powerpc): Likewise.
  3731. (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
  3732. first tls section has section symbol for optimised local dynamic
  3733. output relocs.
  3734. (Target_powerpc::Relocate::relocate): Correct local dynamic value.
  3735. (Target_powerpc::relocate_relocs): Adjust relocs emitted for
  3736. optimised tls code.
  3737. * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
  3738. Rename to relocate_relocs. Update error message.
  3739. 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
  3740. * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
  3741. --just-symbols.
  3742. 2012-08-31 Alan Modra <amodra@gmail.com>
  3743. * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
  3744. (Powerpc_relobj::toc_base_offset): New stub function.
  3745. (Target_powerpc): Add tp_offset, dtp_offset. Rename
  3746. got_mod_index_offset to tlsld_got_offset. Update all refs.
  3747. (Target_powerpc::Relocate::enum skip_tls): New.
  3748. (Target_powerpc::call_tls_get_addr_): New var.
  3749. (Target_powerpc::is_branch_reloc): Move to file scope.
  3750. (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
  3751. (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
  3752. New functions.
  3753. (Target_powerpc::enum Got_type): Delete old values, add new ones.
  3754. (powerpc_info): Correct common_pagesize for ppc64.
  3755. (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
  3756. (Powerpc_relocate_functions): Add overflow check enums and functions.
  3757. Add non-shift version of rela, rela_ua. Delete all rel public
  3758. functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
  3759. addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
  3760. addr16_ha3, addr14 functions.
  3761. (Output_data_got_powerpc::add_constant_pair): New function.
  3762. (Output_data_got_powerpc::got_base_offset): Likewise.
  3763. (Output_data_got_powerpc::do_write): Correct 64-bit got header.
  3764. (instruction constants): Sort, add some more.
  3765. (Output_data_glink::do_write): Add and use Address typedef. Use
  3766. object->toc_base_offset() stub for 64-bit.
  3767. (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
  3768. (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
  3769. (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
  3770. for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
  3771. Always treat .opd relocs as against locally defined symbol.
  3772. Correct condition for RELATIVE relocs.
  3773. (Target_powerpc::do_finalize_sections): Test for NULL sections.
  3774. (Target_powerpc::Relocate::relocate): Use plt call stub as value
  3775. for 32-bit syms with a plt entry. Correct ppc64 toc base
  3776. calculations. Handle TLS relocs, and more. Add overflow
  3777. checking and adjust for Powerpc_relocate_functions changes.
  3778. (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
  3779. Reinstate --emit-relocs code with FIXME.
  3780. 2012-08-30 Alan Modra <amodra@gmail.com>
  3781. * layout.cc (Layout::set_segment_offsets): Set p_align to
  3782. abi_pagesize, not common_pagesize.
  3783. (Layout::relaxation_loop_body): Similarly use abi_pagesize
  3784. to determine whether file header can go in segment.
  3785. 2012-08-30 Alan Modra <amodra@gmail.com>
  3786. * output.h (Output_reloc::Output_reloc <output section>): Add
  3787. is_relative param. Adjust calls.
  3788. (Output_reloc::add_output_section_relative): New functions.
  3789. * output.cc (Output_reloc::Output_reloc <output section>): Handle
  3790. is_relative.
  3791. (Output_reloc::symbol_value): Handle SECTION_CODE.
  3792. 2012-08-24 Sriraman Tallam <tmsriram@google.com>
  3793. * gold.cc (queue_middle_tasks): Call layout again when unique
  3794. segments for sections is desired.
  3795. * layout.cc (Layout::Layout): Initialize new members.
  3796. (Layout::get_output_section_flags): New function.
  3797. (Layout::choose_output_section): Call get_output_section_flags.
  3798. (Layout::layout): Make output section for mapping to a unique segment.
  3799. (Layout::insert_section_segment_map): New function.
  3800. (Layout::attach_allocated_section_to_segment): Make unique segment for
  3801. output sections marked so.
  3802. (Layout::segment_precedes): Check for unique segments when sorting.
  3803. * layout.h (Layout::Unique_segment_info): New struct.
  3804. (Layout::Section_segment_map): New typedef.
  3805. (Layout::insert_section_segment_map): New function.
  3806. (Layout::get_output_section_flags): New function.
  3807. (Layout::is_unique_segment_for_sections_specified): New function.
  3808. (Layout::set_unique_segment_for_sections_specified): New function.
  3809. (Layout::unique_segment_for_sections_specified_): New member.
  3810. (Layout::section_segment_map_): New member.
  3811. * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
  3812. Rename is_gc_pass_one to is_pass_one.
  3813. Rename is_gc_pass_two to is_pass_two.
  3814. Rename is_gc_or_icf to is_two_pass.
  3815. Check for which pass based on whether symbols data is present.
  3816. Make it two pass when unique segments for sections is desired.
  3817. * output.cc (Output_section::Output_section): Initialize new
  3818. members.
  3819. * output.h (Output_section::is_unique_segment): New function.
  3820. (Output_section::set_is_unique_segment): New function.
  3821. (Output_section::is_unique_segment_): New member.
  3822. (Output_section::extra_segment_flags): New function.
  3823. (Output_section::set_extra_segment_flags): New function.
  3824. (Output_section::extra_segment_flags_): New member.
  3825. (Output_section::segment_alignment): New function.
  3826. (Output_section::set_segment_alignment): New function.
  3827. (Output_section::segment_alignment_): New member.
  3828. (Output_segment::Output_segment): Initialize is_unique_segment_.
  3829. (Output_segment::is_unique_segment): New function.
  3830. (Output_segment::set_is_unique_segment): New function.
  3831. (Output_segment::is_unique_segment_): New member.
  3832. * plugin.cc (allow_unique_segment_for_sections): New function.
  3833. (unique_segment_for_sections): New function.
  3834. (Plugin::load): Add new functions to transfer vector.
  3835. * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
  3836. * Makefile.in: Regenerate.
  3837. * testsuite/plugin_final_layout.sh: Check if unique segment
  3838. functionality works.
  3839. * testsuite/plugin_section_order.c (onload): Check if new interfaces
  3840. are available.
  3841. (allow_unique_segment_for_sections): New global.
  3842. (unique_segment_for_sections): New global.
  3843. (claim_file_hook): Call allow_unique_segment_for_sections.
  3844. (all_symbols_read_hook): Call unique_segment_for_sections.
  3845. 2012-08-22 Cary Coutant <ccoutant@google.com>
  3846. * layout.cc (Layout::include_section): Don't assert on GROUP
  3847. sections with --emit-relocs.
  3848. 2012-08-21 Cary Coutant <ccoutant@google.com>
  3849. * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
  3850. if --export-dynamic-symbol names an undef symbol.
  3851. 2012-08-18 Alan Modra <amodra@gmail.com>
  3852. * powerpc.cc: Formatting and white space.
  3853. (Powerpc_relobj): Rename got2_section_ to special_.
  3854. Add opd_ent_shndx_ and opd_ent_off_ vectors.
  3855. (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
  3856. scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
  3857. (Target_powerpc): Add Address typedef and invalid_address. Use
  3858. throughout.
  3859. (Target_powerpc::is_branch_reloc): New function.
  3860. (Powerpc_relocate_functions): Add Address typedef, use throughout.
  3861. (Powerpc_relocate_functions:rela, rela_ua): Correct type used
  3862. for dst_mask, value and addend.
  3863. (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
  3864. (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
  3865. (Output_data_glink::do_write): Correct toc base. Don't try to use
  3866. uint16_t for 24-bit offset. Use get_output_section_offset and
  3867. check return.
  3868. (Target_powerpc::Scan::local): Handle more relocs.
  3869. (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
  3870. (Target_powerpc::Relocate::relocate): Correct toc base calculation.
  3871. Plug in toc restoring insn after plt calls. Translate branches
  3872. to function descriptor symbols to corresponding entry point.
  3873. (Target_powerpc::relocate_for_relocatable): Check return from
  3874. get_output_section_offset.
  3875. * symtab.h: Comment typo.
  3876. 2012-08-14 Ian Lance Taylor <iant@google.com>
  3877. * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
  3878. unsupported_relocal_local to call unsupported_reloc_global.
  3879. 2012-08-14 Nick Clifton <nickc@redhat.com>
  3880. PR ld/14265
  3881. * script-sections.cc (Sections_element::output_section_name): Add
  3882. keep return parameter.
  3883. (Output_section_element::match_name): Add keep return parameter.
  3884. Return the value of the keep_ member.
  3885. * script-sections.h (class Output_section): Update
  3886. output_section_name prototype.
  3887. * layout.cc (Layout::keep_input_section): New public member
  3888. function.
  3889. (Layout::choose_output_section): Pass keep parameter to
  3890. output_section_name.
  3891. * layout.h (class Layout): Add keep_input_section.
  3892. * object.cc (Sized_relobj_file::do_layout): Check for kept input
  3893. sections.
  3894. * testsuite/Makefile.am: Add a test.
  3895. * testsuite/Makefile.in: Regenerate.
  3896. * testsuite/pr14265.c: Source file for the test.
  3897. * testsuite/pr14265.t: Linker script for the test.
  3898. * testsuite/pr14265.sh: Shell script for the test.
  3899. 2012-08-14 Alan Modra <amodra@gmail.com>
  3900. * target.h (Target::output_section_name): New function.
  3901. (Target::do_output_section_name): New function.
  3902. * layout.cc (Layout::choose_output_section): Call the above.
  3903. * powerpc.cc (Target_powerpc::do_output_section_name): New function.
  3904. 2012-08-14 Alan Modra <amodra@gmail.com>
  3905. * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
  3906. (Output_data_got_powerpc::do_write): Don't rely on base class lookup
  3907. for replace_constant call.
  3908. (Output_data_plt_powerpc::do_print_to_mapfile): New function.
  3909. (Output_data_glink::do_print_to_mapfile): New function.
  3910. (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
  3911. (Target_powerpc::Relocate::relocate): Likewise.
  3912. 2012-08-14 Alan Modra <amodra@gmail.com>
  3913. * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
  3914. (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
  3915. (Output_data_glink::add_entry,find_entry): Remove shndx param.
  3916. (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
  3917. all references to shndx_. Handle special case for R_PPC_PLTREL24
  3918. here.
  3919. (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
  3920. (Output_data_glink::do_write): Retrieve got2_shdnx from object.
  3921. (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
  3922. here.
  3923. (Target_powerpc::Scan::global): Nor on make_plt_entry call.
  3924. (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
  3925. 2012-08-12 Alan Modra <amodra@gmail.com>
  3926. * powerpc.cc: Whitespace fixes. Wrap overly long lines.
  3927. (glink insn constants): Use uint32_t.
  3928. (Output_data_glink::add_entry): Use insert, not [] operator.
  3929. 2012-08-11 Alan Modra <amodra@gmail.com>
  3930. * object.h (Sized_relobj_file::find_shdr): New function.
  3931. (Sized_relobj_file::find_special_sections): New function.
  3932. * object.cc (Sized_relobj_file::find_shdr): New function.
  3933. (Sized_relobj_file::find_eh_frame): Use find_shdr.
  3934. (Sized_relobj_file::find_special_sections): New function, split out..
  3935. (Sized_relobj_file::do_read_symbols): ..from here.
  3936. * output.h (Output_data_got::replace_constant): New function.
  3937. (Output_data_got::num_entries): New function.
  3938. (Output_data_got::last_got_offset,set_got_size): Use num_entries.
  3939. (Output_data_got::got_offset): Protected rather than private.
  3940. (Output_data_got::replace_got_entry): New function.
  3941. * output.cc (Output_data_got::replace_got_entry): New function.
  3942. * powerpc.cc (class Powerpc_relobj): New.
  3943. (class Powerpc_relocate_functions): Delete all psymval variants or
  3944. convert to value,addend type. Delete pcrela, pcrela_unaligned.
  3945. Implement _ha functions using corresponding _hi function.
  3946. (Powerpc_relobj::find_special_sections): New function.
  3947. (Target_powerpc::do_make_elf_object): New function.
  3948. (class Output_data_got_powerpc): New.
  3949. (class Output_data_glink): New.
  3950. (class Powerpc_scan_relocatable_reloc): New.
  3951. Many more changes througout file.
  3952. 2012-08-09 Nick Clifton <nickc@redhat.com>
  3953. * po/vi.po: Updated Vietnamese translation.
  3954. 2012-08-07 Ian Lance Taylor <iant@google.com>
  3955. * layout.cc (Layout::add_target_dynamic_tags): If
  3956. dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
  3957. plt_rel.
  3958. 2012-07-30 Nick Clifton <nickc@redhat.com>
  3959. * po/gold.pot: Updated template.
  3960. * po/es.po: Updated Spanish translation.
  3961. 2012-07-18 Cary Coutant <ccoutant@google.com>
  3962. PR gold/14344
  3963. * configure.ac: Add check for -gpubnames support.
  3964. * configure: Regenerate.
  3965. * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
  3966. support; force -gno-pubnames.
  3967. (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
  3968. support.
  3969. (gdb_index_test_4): New test.
  3970. * testsuite/Makefile.in: Regenerate.
  3971. * testsuite/gdb_index_test_1.sh: Refactor code into common file.
  3972. * testsuite/gdb_index_test_2.sh: Likewise.
  3973. * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
  3974. * testsuite/gdb_index_test_4.sh: New script.
  3975. * testsuite/gdb_index_test_comm.sh: New script with common code;
  3976. don't look for space after colon.
  3977. 2012-07-16 Sriraman Tallam <tmsriram@google.com>
  3978. * gold.cc (queue_middle_tasks): Update function order only after
  3979. deferred objects due to plugins are processed.
  3980. 2012-07-11 Ian Lance Taylor <iant@google.com>
  3981. * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
  3982. (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
  3983. (Target_arm::scan_reloc_for_stub): Likewise.
  3984. * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
  3985. * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
  3986. * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
  3987. * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
  3988. * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
  3989. 2012-07-10 Dodji Seketeli <dodji@redhat.com>
  3990. Ian Lance Taylor <iant@google.com>
  3991. PR gold/14309
  3992. * configure.ac: Test whether std::tr1::hash<off_t> works.
  3993. * gold.h: Add a specialization for std::tr1::hash<off_t> if
  3994. needed.
  3995. * output.h (class Output_fill): Add virtual destructor.
  3996. * configure, config.in: Rebuild.
  3997. 2012-06-22 Roland McGrath <mcgrathr@google.com>
  3998. * layout.cc (finalize): Define __ehdr_start symbol if applicable.
  3999. 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
  4000. * plugin.cc (Plugin::load): Handle position independent executables.
  4001. 2012-06-06 Cary Coutant <ccoutant@google.com>
  4002. * layout.cc (gdb_sections): Remove ".debug_" prefixes,
  4003. add .debug_macro.
  4004. (lines_only_debug_sections): Likewise.
  4005. (gdb_fast_lookup_sections): New static array.
  4006. (is_gdb_debug_section): Rename formal parameter.
  4007. (is_lines_only_debug_section): Likewise.
  4008. (is_gdb_fast_lookup_section): New function.
  4009. (Layout::include_section): Check for ".zdebug_" prefix; pass
  4010. section name suffix to is_gdb_debug_section, et al.; check for
  4011. fast-lookup sections when building .gdb_index.
  4012. * options.h (--strip-debug-gdb): Update GDB version number.
  4013. 2012-06-06 Cary Coutant <ccoutant@google.com>
  4014. * configure.ac: Add check for fallocate.
  4015. * configure: Regenerate.
  4016. * config.in: Regenerate.
  4017. * options.h (class General_options): Add --mmap-output-file and
  4018. --posix-fallocate options.
  4019. * output.cc: (posix_fallocate): Remove; replace with...
  4020. (gold_fallocate): New function.
  4021. (Output_file::map_no_anonymous): Call gold_fallocate.
  4022. (Output_file::map): Check --mmap-output-file option.
  4023. 2012-06-05 Jing Yu <jingyu@google.com>
  4024. * gold.h (textdomain): Add do {} to empty while(0).
  4025. (bindtextdomain): Likewise.
  4026. 2012-06-04 Cary Coutant <ccoutant@google.com>
  4027. * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
  4028. has_dynsym_index.
  4029. 2012-05-25 Sriraman Tallam <tmsriram@google.com>
  4030. * symtab.cc (Symbol_table::define_special_symbol):
  4031. Initialize *poldsym to prevent uninitialized variable errors.
  4032. 2012-05-23 Cary Coutant <ccoutant@google.com>
  4033. * layout.cc (Layout::section_name_mapping): Add rules to handle
  4034. exact match on .data.rel.ro.local or .data.rel.ro.
  4035. (Layout::output_section_name): Check for exact matches.
  4036. 2012-05-23 Cary Coutant <ccoutant@google.com>
  4037. * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
  4038. more carefully.
  4039. 2012-05-22 Cary Coutant <ccoutant@google.com>
  4040. * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
  4041. object before exporting symbol.
  4042. 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
  4043. * testsuite/tls_test.cc: Include "config.h" first.
  4044. * testsuite/tls_test_c.c: Likewise.
  4045. 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
  4046. Nick Clifton <nickc@redhat.com>
  4047. PR 14072
  4048. * configure.in: Add check that sysdep.h has been included before
  4049. any system header files.
  4050. * configure: Regenerate.
  4051. * config.in: Regenerate.
  4052. 2012-05-14 Cary Coutant <ccoutant@google.com>
  4053. * layout.cc (Layout::make_output_section): Mark .tdata section
  4054. as RELRO.
  4055. * testsuite/relro_test.cc: Add a TLS variable.
  4056. 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
  4057. PR gold/14091
  4058. * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
  4059. R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
  4060. R_X86_64_64.
  4061. 2012-05-08 Cary Coutant <ccoutant@google.com>
  4062. * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
  4063. (lines_only_debug_sections): Likewise.
  4064. 2012-05-02 Roland McGrath <mcgrathr@google.com>
  4065. * nacl.cc: New file.
  4066. * nacl.h: New file.
  4067. * Makefile.am (CCFILES, HFILES): Add them.
  4068. * Makefile.in: Regenerate.
  4069. * i386.cc (Output_data_plt_i386_nacl): New class.
  4070. (Output_data_plt_i386_nacl_exec): New class.
  4071. (Output_data_plt_i386_nacl_dyn): New class.
  4072. (Target_i386_nacl): New class.
  4073. (Target_selector_i386_nacl): New class.
  4074. (target_selector_i386): Use it instead of Target_selector_i386.
  4075. * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
  4076. (Target_x86_64_nacl): New class.
  4077. (Target_selector_x86_64_nacl): New class.
  4078. (target_selector_x86_64, target_selector_x32): Use it instead of
  4079. Target_selector_x86_64.
  4080. * arm.cc (Output_data_plt_arm_nacl): New class.
  4081. (Target_arm_nacl): New class.
  4082. (Target_selector_arm_nacl): New class.
  4083. (target_selector_arm, target_selector_armbe): Use it instead of
  4084. Target_selector_arm.
  4085. * target-select.cc (select_target): Take new Input_file* and off_t
  4086. arguments, pass them on to recognize method of selector.
  4087. * object.cc (make_elf_sized_object): Update caller.
  4088. * parameters.cc (parameters_force_valid_target): Likewise.
  4089. * incremental.cc (make_sized_incremental_binary): Likewise.
  4090. * target-select.h: Update decl.
  4091. (Target_selector::recognize): Take new Input_file* argument,
  4092. pass it on to do_recognize.
  4093. (Target_selector::do_recognize): Take new Input_file* argument.
  4094. * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
  4095. * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
  4096. * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
  4097. * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
  4098. * target.h (Target::Target_info): New members isolate_execinstr
  4099. and rosegment_gap.
  4100. (Target::isolate_execinstr, Target::rosegment_gap): New methods.
  4101. * arm.cc (Target_arm::arm_info): Update initializer.
  4102. * i386.cc (Target_i386::i386_info): Likewise.
  4103. * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
  4104. * sparc.cc (Target_sparc::sparc_info): Likewise.
  4105. * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
  4106. * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
  4107. * layout.cc (Layout::attach_allocated_section_to_segment):
  4108. Take new const Target* argument. If target->isolate_execinstr(), act
  4109. like --rosegment.
  4110. (Layout::find_first_load_seg): Take new const Target* argument;
  4111. if target->isolate_execinstr(), reject PF_X segments.
  4112. (Layout::relaxation_loop_body): Update caller.
  4113. (Layout::set_segment_offsets): If target->isolate_execinstr(),
  4114. reset file offset to zero when we hit LOAD_SEG, and then do a second
  4115. loop over the segments before LOAD_SEG to reassign offsets after
  4116. addresses have been determined. Handle target->rosegment_gap().
  4117. (Layout::attach_section_to_segment): Take new const Target* argument;
  4118. pass it to attach_allocated_section_to_segment.
  4119. (Layout::make_output_section): Update caller.
  4120. (Layout::attach_sections_to_segments): Take new const Target* argument;
  4121. pass it to attach_section_to_segment.
  4122. * gold.cc (queue_middle_tasks): Update caller.
  4123. * layout.h (Layout): Update method decls with new arguments.
  4124. * arm.cc (Target_arm::Target_arm): Take optional argument for the
  4125. Target_info pointer to use.
  4126. (Target_arm::do_make_data_plt): New virtual method.
  4127. (Target_arm::make_data_plt): New method that calls it.
  4128. (Target_arm::make_plt_entry): Use it.
  4129. (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
  4130. for the section alignment.
  4131. (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
  4132. method.
  4133. (Output_data_plt_arm::first_plt_entry_offset): Call it.
  4134. (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
  4135. method.
  4136. (Output_data_plt_arm::get_plt_entry_size): Call it.
  4137. (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
  4138. (Output_data_plt_arm::fill_plt_entry): New method that calls it.
  4139. (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
  4140. method.
  4141. (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
  4142. (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
  4143. method instead of sizeof(plt_entry).
  4144. (Output_data_plt_arm::add_entry): Likewise.
  4145. Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
  4146. (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
  4147. than static method.
  4148. (Target_arm::plt_entry_size): Likewise.
  4149. (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
  4150. Move to ...
  4151. (Output_data_plt_arm_standard): ... here, new class.
  4152. (Output_data_plt_arm::do_write): Move guts of PLT filling to...
  4153. (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
  4154. (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
  4155. * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
  4156. Take additional argument for the PLT entry size.
  4157. (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
  4158. Use get_plt_entry_size method rather than plt_entry_size variable.
  4159. (Output_data_plt_x86_64::reserve_slot): Likewise.
  4160. (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
  4161. (Output_data_plt_x86_64::add_entry): Likewise.
  4162. (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
  4163. (Output_data_plt_x86_64::address_for_global): Likewise.
  4164. (Output_data_plt_x86_64::address_for_local): Likewise.
  4165. (Output_data_plt_x86_64::set_final_data_size): Likewise.
  4166. (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
  4167. Make method non-static.
  4168. (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
  4169. method.
  4170. (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
  4171. (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
  4172. (Output_data_plt_x86_64::add_eh_frame): New method to call it.
  4173. (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
  4174. virtual method.
  4175. (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
  4176. (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
  4177. virtual method.
  4178. (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
  4179. (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
  4180. virtual method.
  4181. (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
  4182. (Output_data_plt_x86_64::plt_entry_size)
  4183. (Output_data_plt_x86_64::first_plt_entry)
  4184. (Output_data_plt_x86_64::plt_entry)
  4185. (Output_data_plt_x86_64::tlsdesc_plt_entry)
  4186. (Output_data_plt_x86_64::plt_eh_frame_fde_size)
  4187. (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
  4188. (Output_data_plt_x86_64_standard): ... here, new class.
  4189. (Target_x86_64::Target_x86_64): Take optional argument for the
  4190. Target_info pointer to use.
  4191. (Target_x86_64::do_make_data_plt): New virtual method.
  4192. (Target_x86_64::make_data_plt): New method to call it.
  4193. (Target_x86_64::init_got_plt_for_update): Use that.
  4194. Call this->plt_->add_eh_frame method here.
  4195. (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
  4196. (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
  4197. rather than static method.
  4198. (Target_x86_64::plt_entry_size): Likewise.
  4199. (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
  4200. rather than plt_entry_size variable. Move guts of PLT filling to...
  4201. (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
  4202. (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
  4203. (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
  4204. * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
  4205. additional argument for the section alignment.
  4206. Don't do add_eh_frame_for_plt here.
  4207. (Output_data_plt_i386::first_plt_entry_offset): Make the method
  4208. non-static. Use get_plt_entry_size method rather than plt_entry_size
  4209. variable.
  4210. (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
  4211. method.
  4212. (Output_data_plt_i386::get_plt_entry_size): Call it.
  4213. (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
  4214. (Output_data_plt_i386::add_eh_frame): New method to call it.
  4215. (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
  4216. method.
  4217. (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
  4218. (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
  4219. method.
  4220. (Output_data_plt_i386::fill_plt_entry): New method to call it.
  4221. (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
  4222. method instead of plt_entry_size.
  4223. (Output_data_plt_i386::plt_entry_size)
  4224. (Output_data_plt_i386::plt_eh_frame_fde_size)
  4225. (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
  4226. (Output_data_plt_i386_standard): ... here, new class.
  4227. (Output_data_plt_i386_exec): New class.
  4228. (Output_data_plt_i386::exec_first_plt_entry): Move to ...
  4229. (Output_data_plt_i386_exec::first_plt_entry): ... here.
  4230. (Output_data_plt_i386::exec_plt_entry): Move to ...
  4231. (Output_data_plt_i386_exec::plt_entry): ... here.
  4232. (Output_data_plt_i386_dyn): New class.
  4233. (Output_data_plt_i386::first_plt_entry): Move to ...
  4234. (Output_data_plt_i386_dyn::first_plt_entry): ... here.
  4235. (Output_data_plt_i386::dyn_plt_entry): Move to ...
  4236. (Output_data_plt_i386_dyn::plt_entry): ... here.
  4237. (Target_i386::Target_i386): Take optional argument for the Target_info
  4238. pointer to use.
  4239. (Target_i386::do_make_data_plt): New virtual method.
  4240. (Target_i386::make_data_plt): New method to call it.
  4241. (Target_i386::make_plt_section): Use that.
  4242. Call this->plt_->add_eh_frame method here.
  4243. (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
  4244. rather than plt_entry_size variable.
  4245. (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
  4246. (Output_data_plt_i386::address_for_local): Likewise.
  4247. (Output_data_plt_i386::do_write): Likewise.
  4248. Move guts of PLT filling to...
  4249. (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
  4250. (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
  4251. (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
  4252. (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
  4253. 2012-05-01 Cary Coutant <ccoutant@google.com>
  4254. * dwarf_reader.cc (Dwarf_die::read_attributes)
  4255. (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
  4256. (Dwarf_die::uint_attribute): Remove DW_FORM_null.
  4257. * reduced_debug_output.cc
  4258. (Output_reduced_debug_info_section::get_die_end): Remove
  4259. DW_FORM_GNU_ref_index. Add default case.
  4260. 2012-04-26 Mark Wielaard <mjw@redhat.com>
  4261. * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
  4262. * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
  4263. * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
  4264. DW_AT_high_pc as offset from DW_AT_low_pc.
  4265. * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
  4266. * testsuite/Makefile.in: Regenerate.
  4267. * testsuite/gdb_index_test_3.c: New test source file.
  4268. * testsuite/gdb_index_test_3.sh: New test source file.
  4269. 2012-04-25 Ian Lance Taylor <iant@google.com>
  4270. * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
  4271. pointer.
  4272. (Stub_addend_reader::operator()): Declare Arm_relocate_functions
  4273. as a class, not a struct.
  4274. (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
  4275. (Target_arm::apply_cortex_a8_workaround): Likewise.
  4276. * gc.h: Declare Reloc_types as a struct, not a class.
  4277. * object.h: Declare Symbols_data as a struct.
  4278. * reloc.h: Declare Read_relocs_data as a struct.
  4279. * target.h: Declare Relocate_info as a struct.
  4280. 2012-04-24 David S. Miller <davem@davemloft.net>
  4281. * sparc.cc (Target_sparc::Relocate::relax_call): New function.
  4282. (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
  4283. and R_SPARC_WPLT30.
  4284. 2012-04-24 Cary Coutant <ccoutant@google.com>
  4285. * incremental-dump.cc (find_input_containing_global): Replace
  4286. magic number with symbolic constant.
  4287. (dump_incremental_inputs): Update version number.
  4288. * incremental.cc (Output_section_incremental_inputs): Update version
  4289. number; import symbolic constants from Incremental_inputs_reader.
  4290. (Incremental_inputs::create_data_sections): Align relocations
  4291. section correctly for 64-bit targets.
  4292. (Output_section_incremental_inputs::set_final_data_size): Use symbolic
  4293. constants; add padding.
  4294. (Output_section_incremental_inputs::write_header): Add assert for
  4295. header_size.
  4296. (Output_section_incremental_inputs::write_input_files): Add assert
  4297. for input_entry_size.
  4298. (Output_section_incremental_inputs::write_info_blocks): Add padding;
  4299. add assert for object_info_size, input_section_entry_size,
  4300. global_sym_entry_size.
  4301. * incremental.h (Incremental_inputs_reader): Add symbolic constants
  4302. for data structure sizes; use them.
  4303. (Incremental_input_entry_reader): Import symbolic constants from
  4304. Incremental_inputs_reader; use them.
  4305. 2012-04-23 David S. Miller <davem@davemloft.net>
  4306. * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
  4307. and elf_flags_set_.
  4308. (Target_sparc::Target_sparc): Initialize new fields.
  4309. (Target_sparc::do_make_elf_object): New function.
  4310. (Target_sparc::do_adjust_elf_header): New function.
  4311. 2012-04-23 Cary Coutant <ccoutant@google.com>
  4312. * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
  4313. CU range table of gdb index.
  4314. 2012-04-20 David S. Miller <davem@davemloft.net>
  4315. * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
  4316. instead of false.
  4317. 2012-04-16 David S. Miller <davem@davemloft.net>
  4318. * sparc.cc (Target_sparc::got_address): New function.
  4319. (Sparc_relocate_functions::gdop_hix22): New function.
  4320. (Sparc_relocate_functions::gdop_lox10): New function.
  4321. (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
  4322. relocs.
  4323. (Target_sparc::Scan::local): Likewise if the global symbol is not
  4324. preemptible and is not IFUNC.
  4325. (Target_sparc::Relocate::relocate): Perform GOTDATA code
  4326. transformations for local and non-preemptible non-IFUNC global
  4327. symbols.
  4328. * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
  4329. writing out 64-bit part of ranges.
  4330. * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
  4331. -fpic and -fpie respectively.
  4332. * Makefile.in: Regenerate.
  4333. * sparc.cc (class Target_sparc): Add rela_ifunc_.
  4334. (Target_sparc::Target_sparc): Initialize new field.
  4335. (Target_sparc::do_plt_section_for_global): New function.
  4336. (Target_sparc::do_plt_section_for_local): New function.
  4337. (Target_sparc::reloc_needs_plt_for_ifunc): New function.
  4338. (Target_sparc::make_plt_section): New function, broken out of
  4339. make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
  4340. (Target_sparc::make_plt_entry): Call make_plt_section.
  4341. (Target_sparc::make_local_ifunc_plt_entry): New function.
  4342. (Target_sparc::rela_ifunc_section): New function.
  4343. (Target_sparc::plt_section): Remove const.
  4344. (Output_data_plt_sparc): Update declarations. Define Global_ifunc
  4345. and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
  4346. and ifunc_count_ fields.
  4347. (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
  4348. (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
  4349. (Output_data_plt_sparc::add_local_ifunc_entry): New function.
  4350. (Output_data_plt_sparc::rela_ifunc): New function.
  4351. (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
  4352. (Output_data_plt_sparc::has_ifunc_section): New function.
  4353. (Output_data_plt_sparc::entry_count): Include ifunc_count_.
  4354. (Output_data_plt_sparc::address_for_global): New function.
  4355. (Output_data_plt_sparc::address_for_local): New function.
  4356. (Output_data_plt_sparc::plt_index_to_offset): New function.
  4357. (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
  4358. and entry_count.
  4359. (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
  4360. entry_count.
  4361. (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
  4362. R_SPARC_JMP_IREL to switch.
  4363. (Target_sparc::Scan::check_non_pic): Likewise.
  4364. (Target_sparc::Scan::local): Handle IFUNC symbols.
  4365. (Target_sparc::Scan::local): Likewise.
  4366. (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
  4367. and plt_address_for_local.
  4368. (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
  4369. Define __rel_iplt_start and __rel_iplt_end if doing a static link.
  4370. * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
  4371. (class Output_data_reloc): Adjust calls to Output_reloc_type.
  4372. (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
  4373. * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
  4374. global relocs too.
  4375. (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
  4376. * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
  4377. calls.
  4378. * sparc.cc (Target_sparc::Scan::global): Likewise.
  4379. * x86_64.cc (Target_x86_64::Scan::global): Likewise.
  4380. 2012-04-16 Cary Coutant <ccoutant@google.com>
  4381. * archive.cc (Library_base::should_include_member): Check for
  4382. --export-dynamic-symbol.
  4383. * options.h (class General_options): Add --export-dynamic-symbol.
  4384. * symtab.cc (Symbol::should_add_dynsym_entry): Check for
  4385. --export-dynamic-symbol.
  4386. (Symbol_table::gc_mark_undef_symbols): Likewise.
  4387. (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
  4388. 2012-04-12 David S. Miller <davem@davemloft.net>
  4389. * sparc.cc (Reloc::wdisp10): New relocation method.
  4390. (Reloc::h34): Likewise.
  4391. (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
  4392. (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
  4393. R_SPARC_WDISP10.
  4394. (Target_sparc::Scan::local): Likewise.
  4395. (Target_sparc::Scan::global): Likewise.
  4396. (Target_sparc::Relocate::relocate): Likewise.
  4397. 2012-04-09 Cary Coutant <ccoutant@google.com>
  4398. * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
  4399. low_pc == 0.
  4400. 2012-04-06 Ian Lance Taylor <iant@google.com>
  4401. * timer.cc: #include <unistd.h>.
  4402. 2012-04-06 Roland McGrath <mcgrathr@google.com>
  4403. * configure.in (AC_CHECK_HEADERS): Add locale.h.
  4404. * config.in: Regenerate.
  4405. * configure: Regenerate.
  4406. 2012-04-05 Nick Clifton <nickc@redhat.com>
  4407. * configure.ac (AC_CHECK_FUNCS): Add setlocale.
  4408. (AM_LC_MESSAGES): Add.
  4409. * aclocal.m4: Regenerate.
  4410. * config.in: Regenerate.
  4411. * configure: Regenerate.
  4412. 2012-03-21 Cary Coutant <ccoutant@google.com>
  4413. * Makefile.am: Add gdb-index.cc, gdb-index.h.
  4414. * Makefile.in: Regenerate.
  4415. * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
  4416. (Sized_elf_reloc_mapper::symbol_section): New function.
  4417. (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
  4418. (make_elf_reloc_mapper): New function.
  4419. (Dwarf_abbrev_table::clear_abbrev_codes): New function.
  4420. (Dwarf_abbrev_table::do_read_abbrevs): New function.
  4421. (Dwarf_abbrev_table::do_get_abbrev): New function.
  4422. (Dwarf_ranges_table::read_ranges_table): New function.
  4423. (Dwarf_ranges_table::read_range_list): New function.
  4424. (Dwarf_pubnames_table::read_section): New function.
  4425. (Dwarf_pubnames_table::read_header): New function.
  4426. (Dwarf_pubnames_table::next_name): New function.
  4427. (Dwarf_die::Dwarf_die): New function.
  4428. (Dwarf_die::read_attributes): New function.
  4429. (Dwarf_die::skip_attributes): New function.
  4430. (Dwarf_die::set_name): New function.
  4431. (Dwarf_die::set_linkage_name): New function.
  4432. (Dwarf_die::attribute): New function.
  4433. (Dwarf_die::string_attribute): New function.
  4434. (Dwarf_die::int_attribute): New function.
  4435. (Dwarf_die::uint_attribute): New function.
  4436. (Dwarf_die::ref_attribute): New function.
  4437. (Dwarf_die::child_offset): New function.
  4438. (Dwarf_die::sibling_offset): New function.
  4439. (Dwarf_info_reader::check_buffer): New function.
  4440. (Dwarf_info_reader::parse): New function.
  4441. (Dwarf_info_reader::do_parse): New function.
  4442. (Dwarf_info_reader::do_read_string_table): New function.
  4443. (Dwarf_info_reader::lookup_reloc): New function.
  4444. (Dwarf_info_reader::get_string): New function.
  4445. (Dwarf_info_reader::visit_compilation_unit): New function.
  4446. (Dwarf_info_reader::visit_type_unit): New function.
  4447. (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
  4448. Sized_elf_reloc_mapper.
  4449. (Sized_dwarf_line_info::symbol_section): Remove function.
  4450. (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
  4451. (Sized_dwarf_line_info::read_line_mappings): Remove object
  4452. parameter, adjust callers.
  4453. (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
  4454. * dwarf_reader.h: Include <sys/types.h>.
  4455. (class Track_relocs): Remove forward declaration.
  4456. (class Elf_reloc_mapper): New class.
  4457. (class Sized_elf_reloc_mapper): New class.
  4458. (class Dwarf_abbrev_table): New class.
  4459. (class Dwarf_range_list): New class.
  4460. (class Dwarf_ranges_table): New class.
  4461. (class Dwarf_pubnames_table): New class.
  4462. (class Dwarf_die): New class.
  4463. (class Dwarf_info_reader): New class.
  4464. (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
  4465. (Sized_dwarf_line_info::symbol_section): Remove member function.
  4466. * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
  4467. base class.
  4468. * gdb-index.cc: New source file.
  4469. * gdb-index.h: New source file.
  4470. * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
  4471. and .debug_types sections, call Layout::add_to_gdb_index.
  4472. (Sized_relobj_incr::do_section_name): Implement.
  4473. (Sized_relobj_incr::do_section_contents): Adjust parameter list and
  4474. return type; Implement.
  4475. (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
  4476. return type.
  4477. * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
  4478. parameter list and return type.
  4479. (Sized_incr_dynobj::do_section_contents): Likewise.
  4480. * layout.cc: Include gdb-index.h.
  4481. (Layout::Layout): Initialize gdb_index_data_.
  4482. (Layout::init_fixed_output_section): Check for .gdb_index section.
  4483. (Layout::add_to_gdb_index): New function. Instantiate.
  4484. * layout.h: Add forward declaration for class Gdb_index.
  4485. (Layout::add_to_gdb_index): New member function.
  4486. (Layout::gdb_index_data_): New data member.
  4487. * main.cc: Include gdb-index.h.
  4488. (main): Print statistics for gdb index.
  4489. * object.cc (Object::section_contents): Move code into
  4490. do_section_contents.
  4491. (need_decompressed_section): Check for sections needed when building
  4492. gdb index.
  4493. (build_compressed_section_map): Likewise.
  4494. (Sized_relobj_file::do_read_symbols): Need local symbols when building
  4495. gdb index.
  4496. (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
  4497. sections; call Layout::add_to_gdb_index.
  4498. (Sized_relobj_file::do_decompressed_section_contents): Call
  4499. do_section_contents directly.
  4500. * object.h (Object::do_section_contents): Adjust parameter list and
  4501. return type.
  4502. (Object::do_decompressed_section_contents): Call do_section_contents
  4503. directly.
  4504. (Sized_relobj_file::do_section_contents): Adjust parameter list and
  4505. return type.
  4506. * options.h (class General_options): Add --gdb-index option.
  4507. * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
  4508. list and return type.
  4509. * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
  4510. * reloc.h (Track_relocs::checkpoint): New function.
  4511. (Track_relocs::reset): New function.
  4512. * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
  4513. New test cases.
  4514. * testsuite/Makefile.in: Regenerate.
  4515. * testsuite/gdb_index_test.cc: New test source file.
  4516. * testsuite/gdb_index_test_1.sh: New test source file.
  4517. * testsuite/gdb_index_test_2.sh: New test source file.
  4518. 2012-03-19 Doug Kwan <dougkwan@google.com>
  4519. * arm.cc (Target_arm::do_define_standard_symbols): New method.
  4520. (Target_arm::do_finalize_sections): Remove code which defines
  4521. __exidx_start and __exidx_end. Make symbol table parameter
  4522. anonymous as it is not used.
  4523. * gold.cc (queue_middle_tasks): Call target hook to define any
  4524. target-specific symbols.
  4525. * target.h (Target::define_standard_symbols): New method.
  4526. (Target::do_define_standard_symbols): Same.
  4527. * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
  4528. * testsuite/Makefile.in: Regenerate.
  4529. * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
  4530. and __exidx_end.
  4531. * testsuite/arm_exidx_test.sh: Check that no unused dynamic
  4532. relocations are generated for __exidx_start and __exidx_end.
  4533. 2012-03-16 Doug Kwan <dougkwan@google.com>
  4534. * testsuite/Makefile.am: Disable test initpri3b.
  4535. * testsuite/Makefile.in: Regenerate.
  4536. 2012-03-15 Doug Kwan <dougkwan@google.com>
  4537. * arm.cc (Target_arm::got_section): Make .got section read-only
  4538. if -z now is given.
  4539. 2012-03-15 Ian Lance Taylor <iant@google.com>
  4540. PR gold/13850
  4541. * layout.cc (Layout::make_output_section): Correctly mark
  4542. SHT_INIT_ARRAY, et. al., as relro.
  4543. 2012-03-14 Doug Kwan <dougkwan@google.com>
  4544. * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
  4545. dynamic relocations for protected symbols in shared objects.
  4546. 2012-03-13 Ian Lance Taylor <iant@google.com>
  4547. * resolve.cc (Symbol_table::resolve): When merging common symbols,
  4548. keep the larger alignment.
  4549. 2012-03-12 Cary Coutant <ccoutant@google.com>
  4550. * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
  4551. handling of DW_LNE_define_file.
  4552. 2012-03-12 Cary Coutant <ccoutant@google.com>
  4553. * reduced_debug_output.cc
  4554. (Output_reduced_debug_info_section::get_die_end): Add new FORM
  4555. codes to switch.
  4556. 2012-02-29 Cary Coutant <ccoutant@google.com>
  4557. * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
  4558. 2012-02-29 Cary Coutant <ccoutant@google.com>
  4559. * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
  4560. Call Object::decompressed_section_contents.
  4561. * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
  4562. New dtor.
  4563. (Sized_dwarf_line_info::buffer_start_): New data member.
  4564. * merge.cc (Output_merge_data::do_add_input_section): Call
  4565. Object::decompressed_section_contents.
  4566. (Output_merge_string::do_add_input_section): Likewise.
  4567. * object.cc (need_decompressed_section): New function.
  4568. (build_compressed_section_map): Decompress sections needed later.
  4569. (Sized_relobj_file::do_decompressed_section_contents): New function.
  4570. (Sized_relobj_file::do_discard_decompressed_sections): New function.
  4571. * object.h (Object::decompressed_section_contents): New function.
  4572. (Object::discard_decompressed_sections): New function.
  4573. (Object::do_decompressed_section_contents): New function.
  4574. (Object::do_discard_decompressed_sections): New function.
  4575. (Compressed_section_info): New type.
  4576. (Compressed_section_map): Include decompressed section contents.
  4577. (Sized_relobj_file::do_decompressed_section_contents): New function.
  4578. (Sized_relobj_file::do_discard_decompressed_sections): New function.
  4579. 2012-02-16 Cary Coutant <ccoutant@google.com>
  4580. * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
  4581. * testsuite/Makefile.in: Regenerate.
  4582. 2012-02-14 Cary Coutant <ccoutant@google.com>
  4583. * options.cc (General_options::finalize): Disallow -pie and -static.
  4584. 2012-02-03 Doug Kwan <dougkwan@google.com>
  4585. * arm.cc (Arm_relocate_functions::abs8,
  4586. Arm_relocate_functions::abs16): Use
  4587. Bits::has_signed_unsigned_overflow32.
  4588. (Arm_relocate_functions::thm_abs8): Correct range of
  4589. overflow check.
  4590. * reloc.h (Bits class): Change minimum number of bits from 0 to 1
  4591. in assertions.
  4592. 2012-02-02 Doug Kwan <dougkwan@google.com>
  4593. * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
  4594. position independent outputs, not just shared objects.
  4595. 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
  4596. * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
  4597. * configure: Regenerated.
  4598. 2012-01-27 Ian Lance Taylor <iant@google.com>
  4599. * reloc.h (Bits): New class with static functions, copied from
  4600. namespace utils in arm.cc.
  4601. * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
  4602. instead.
  4603. 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
  4604. * incremental.cc (write_info_blocks): Correct relocation offset.
  4605. 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
  4606. * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
  4607. (Relocate::tls_gd_to_le): Likewise.
  4608. 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
  4609. * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
  4610. 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
  4611. * configure.ac: Check if -mcmodel=medium works.
  4612. * configure: Regenerated.
  4613. 2012-01-24 Cary Coutant <ccoutant@google.com>
  4614. * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
  4615. definition and ...
  4616. (read_unsigned_LEB_128_x): ... this new function.
  4617. (read_signed_LEB_128): Replaced with inline definition and ...
  4618. (read_signed_LEB_128_x): ... this new function.
  4619. * int_encoding.h (read_unsigned_LEB_128_x): New function.
  4620. (read_unsigned_LEB_128): Add inline definition.
  4621. (read_signed_LEB_128_x): New function.
  4622. (read_signed_LEB_128): Add inline definition.
  4623. * testsuite/Makefile.am (leb128_unittest): New unit test.
  4624. * testsuite/Makefile.in: Regenerate.
  4625. * testsuite/leb128_unittest.cc: New unit test.
  4626. 2012-01-23 Ian Lance Taylor <iant@google.com>
  4627. PR gold/13617
  4628. * i386.cc (Target_i386::do_code_fill): When using a jmp
  4629. instruction, pad with nop instructions.
  4630. * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
  4631. 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
  4632. * x86_64.cc (gc_process_relocs): Add typename on types used in
  4633. template.
  4634. (scan_relocs): Likewise.
  4635. (relocate_section): Likewise.
  4636. (apply_relocation): Likewise.
  4637. 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
  4638. * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
  4639. (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
  4640. under x32.
  4641. 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
  4642. * x86_64.cc: Initial support for x32.
  4643. 2012-01-03 Cary Coutant <ccoutant@google.com>
  4644. * incremental.cc (Sized_incremental_binary::do_process_got_plt):
  4645. Use abstract base class for GOT.
  4646. * output.h (class Output_data_got_base): New abstract base class.
  4647. (class Output_data_got): Derive from new base class, adjust ctors.
  4648. (Output_data_got::reserve_slot): Make virtual; rename to
  4649. do_reserve_slot; Adjust callers.
  4650. * target.h (Sized_target::init_got_plt_for_update): Return
  4651. pointer to abstract base class.
  4652. * x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
  4653. 2011-12-18 Ian Lance Taylor <iant@google.com>
  4654. * object.h (Relobj::local_symbol_value): New function.
  4655. (Relobj::local_plt_offset): New function.
  4656. (Relobj::local_has_got_offset): New function.
  4657. (Relobj::local_got_offset): New function.
  4658. (Relobj::set_local_got_offset): New function.
  4659. (Relobj::do_local_symbol_value): New pure virtual function.
  4660. (Relobj::do_local_plt_offset): Likewise.
  4661. (Relobj::do_local_has_got_offset): Likewise.
  4662. (Relobj::do_local_got_offset): Likewise.
  4663. (Relobj::do_set_local_got_offset): Likewise.
  4664. (Sized_relobj::do_local_has_got_offset): Rename from
  4665. local_has_got_offset.
  4666. (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
  4667. (Sized_relobj::do_set_local_got_offset): Rename from
  4668. set_local_got_offset.
  4669. (Sized_relobj_file::do_local_plt_offset): Rename from
  4670. local_plt_offset.
  4671. (Sized_relobj_file::do_local_symbol_value): New function.
  4672. * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
  4673. local_plt_offset.
  4674. * output.cc (Output_data_got::Got_entry::write): Change object to
  4675. Relobj. Use local_symbol_value.
  4676. (Output_data_got::add_global_with_rel): Change rel_dyn to
  4677. Output_data_reloc_generic*. Use add_global_generic.
  4678. (Output_data_got::add_global_with_rela): Remove. Change all
  4679. callers to use add_global_with_rel.
  4680. (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
  4681. Output_data_reloc_generic*. Use add_global_generic.
  4682. (Output_data_got::add_global_pair_with_rela): Remove. Change all
  4683. callers to use add_global_pair_with_rel.
  4684. (Output_data_got::add_local): Change object to Relobj*.
  4685. (Output_data_got::add_local_plt): Likewise.
  4686. (Output_data_got::add_local_with_rel): Change object to Relobj*,
  4687. change rel_dyn to Output_data_reloc_generic*. Use
  4688. add_local_generic.
  4689. (Output_data_got::add_local_with_rela): Remove. Change all
  4690. callers to use all_local_with_rel.
  4691. (Output_data_got::add_local_pair_with_rel): Change object to
  4692. Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
  4693. add_output_section_generic.
  4694. (Output_data_got::add_local_pair_with_rela): Remove. Change all
  4695. callers to use add_local_pair_with_rel.
  4696. (Output_data_got::reserve_local): Change object to Relobj*.
  4697. * output.h: (class Output_data_reloc_generic): Add pure virtual
  4698. declarations for add_global_generic, add_local_generic,
  4699. add_output_section_generic.
  4700. (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
  4701. functions for Output_data_reloc_generic. Update declarations for
  4702. changes listed in output.cc.
  4703. (class Output_data_got): Change template parameter to got_size.
  4704. Don't define Rel_dyn or Rela_dyn. Update declarations per above.
  4705. * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
  4706. function.
  4707. (Sized_relobj_incr::do_local_plt_offset): New function.
  4708. * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
  4709. add_global_generic.
  4710. 2011-12-17 Cary Coutant <ccoutant@google.com>
  4711. * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
  4712. * resolve.cc (Symbol_table::resolve): Likewise.
  4713. * i386.cc (Target_i386::do_code_fill): Use char constants for nop
  4714. arrays.
  4715. * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
  4716. 2011-12-16 Ian Lance Taylor <iant@google.com>
  4717. * output.h (Output_data_reloc_generic::add): Only call
  4718. add_dynamic_reloc if this is a dynamic reloc section.
  4719. 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
  4720. PR gold/13505
  4721. * target-reloc.h (apply_relocation): Replace <64, false> with
  4722. <size, big_endian>.
  4723. 2011-11-25 Nick Clifton <nickc@redhat.com>
  4724. * po/it.po: New Italian translation.
  4725. 2011-11-17 Sterling Augustine <saugustine@google.com>
  4726. * script.cc (script_include_directive): Implement.
  4727. (read_script_file): New local variables name and search_path. Update
  4728. comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
  4729. * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
  4730. * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
  4731. 2011-11-11 Sterling Augustine <saugustine@google.com>
  4732. * yyscript.y (section_cmd): Add support for INCLUDE directive.
  4733. (file_or_sections_cmd): Likewise.
  4734. 2011-11-11 Doug Kwan <dougkwan@google.com>
  4735. * arm.cc (Target_arm::do_make_elf_object): Allow executable also
  4736. if --just-symbols is given.
  4737. 2011-11-10 Doug Kwan <dougkwan@google.com>
  4738. PR gold/13362
  4739. * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
  4740. when processing data relocs.
  4741. * reloc.h (Relocate_functions::rel_unaligned): New method.
  4742. (Relocate_functions::pcrel_unaligned): Ditto.
  4743. (Relocate_functions::rel32_unaligned): Ditto.
  4744. (Relocate_functions::pcrel32_unaligned): Ditto.
  4745. 2011-11-09 Doug Kwan <dougkwan@google.com>
  4746. PR gold/13362
  4747. * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
  4748. Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
  4749. * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
  4750. RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
  4751. (Relocate_functions::rel_unaligned): New.
  4752. (Relocate_functions::rel32_unaligned): New.
  4753. * target-reloc.h (relocate_for_relocatable): Add code to handle
  4754. RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
  4755. * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
  4756. arm_unaligned_reloc_r): New targets.
  4757. * testsuite/Makefile.in: Regenerate.
  4758. * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
  4759. linking.
  4760. 2011-11-02 Ian Lance Taylor <iant@google.com>
  4761. * configure.ac: Add --with-lib-path option. Define LIB_PATH and
  4762. NATIVE_LINKER.
  4763. * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
  4764. * options.cc (General_options::finalize): Use library search path
  4765. from configure script if specified. If not native and no sysroot,
  4766. only search TOOLLIBDIR.
  4767. * options.h (Search_directory::Search_directory): Change name to
  4768. const std::string&.
  4769. (General_options::add_to_library_path_with_sysroot): Change arg to
  4770. const std::string&.
  4771. * configure, Makefile.in, config.in: Rebuild.
  4772. 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
  4773. * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
  4774. we are working around the ARM1176 Erratum.
  4775. * options.h (General_options::fix_arm1176): Add option.
  4776. * testsuite/Makefile.am: Add testcases, and keep current ones
  4777. working.
  4778. * testsuite/Makefile.in: Regenerate.
  4779. * testsuite/arm_fix_1176.s: New file.
  4780. * testsuite/arm_fix_1176.sh: Likewise.
  4781. 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
  4782. * arm.cc (Target_arm::Target_arm): Remove initialisation of
  4783. may_use_blx_.
  4784. (Target_arm::may_use_blx): Remove method.
  4785. (Target_arm::set_may_use_blx): Likewise.
  4786. (Target_arm::may_use_v4t_interworking): New method.
  4787. (Target_arm::may_use_v5t_interworking): Likewise.
  4788. (Target_arm::may_use_blx_): Remove member variable.
  4789. (Arm_relocate_functions::arm_branch_common): Check for v5T
  4790. interworking.
  4791. (Arm_relocate_functions::thumb_branch_common): Likewise.
  4792. (Reloc_stub::stub_type_for_reloc): Likewise.
  4793. (Target_arm::do_finalize_sections): Correct interworking checks.
  4794. * testsuite/Makefile.am: Add new tests.
  4795. * testsuite/Makefile.in: Regenerate.
  4796. * testsuite/arm_farcall_arm_arm.s: New test.
  4797. * testsuite/arm_farcall_arm_arm.sh: Likewise.
  4798. * testsuite/arm_farcall_arm_thumb.s: Likewise.
  4799. * testsuite/arm_farcall_arm_thumb.sh: Likewise.
  4800. * testsuite/arm_farcall_thumb_arm.s: Likewise.
  4801. * testsuite/arm_farcall_thumb_arm.sh: Likewise.
  4802. * testsuite/arm_farcall_thumb_thumb.s: Likewise.
  4803. * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
  4804. 2011-10-31 Cary Coutant <ccoutant@google.com>
  4805. PR gold/13023
  4806. * expression.cc (Expression::eval_with_dot): Add
  4807. is_section_dot_assignment parameter.
  4808. (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
  4809. absolute and assigning to dot within a section.
  4810. * script-sections.cc
  4811. (Output_section_element_assignment::set_section_addresses): Pass
  4812. dot_section to set_if_absolute.
  4813. (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
  4814. as is_section_dot_assignment flag to eval_with_dot.
  4815. (Output_section_element_dot_assignment::set_section_addresses):
  4816. Likewise.
  4817. * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
  4818. parameter. Also set value if relative to dot_section; set the
  4819. symbol's output_section.
  4820. * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
  4821. parameter. Adjust all callers.
  4822. (Expression::eval_maybe_dot): Likewise.
  4823. (Symbol_assignment::set_if_absolute): Add dot_section parameter.
  4824. Adjust all callers.
  4825. * testsuite/script_test_2.t: Test assignment of an absolute value
  4826. to dot within an output section element.
  4827. 2011-10-31 Cary Coutant <ccoutant@google.com>
  4828. * options.h (class General_options): Add --[no-]gnu-unique options.
  4829. * symtab.cc (Symbol_table::sized_write_globals): Convert
  4830. STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
  4831. 2011-10-31 Cary Coutant <ccoutant@google.com>
  4832. PR gold/13359
  4833. * i386.cc (Target_i386::Relocate::relocate_tls): Remove
  4834. unnecessary assertion.
  4835. * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
  4836. 2011-10-31 Sriraman Tallam <tmsriram@google.com>
  4837. * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
  4838. gc_mark_symbol.
  4839. * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
  4840. gc_mark_symbol.
  4841. Change to just keep the section associated with symbol.
  4842. (Symbol_table::add_from_relobj): Mark symbols as not garbage when
  4843. they are externally visible and --export-dynamic is turned on.
  4844. (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
  4845. 2011-10-19 Ian Lance Taylor <iant@google.com>
  4846. PR gold/13163
  4847. * script-sections.cc
  4848. (Output_section_element_dot_assignment::needs_output_section): New
  4849. function.
  4850. 2011-10-19 Ian Lance Taylor <iant@google.com>
  4851. PR gold/13204
  4852. * layout.cc (Layout::segment_precedes): Don't assert failure if a
  4853. --section-start option was seen.
  4854. * options.h (General_options::any_section_start): New function.
  4855. 2011-10-18 David S. Miller <davem@davemloft.net>
  4856. PR binutils/13301
  4857. * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
  4858. member to track relocation locations that have moved during TLS
  4859. reloc optimizations.
  4860. (Target_sparc::Relocate::Relocate): Initialize to NULL.
  4861. (Target_sparc::Relocate::relocate): Adjust view down by 4
  4862. bytes if it matches reloc_adjust_addr_.
  4863. (Target_sparc::Relocate::relocate_tls): Always move the
  4864. __tls_get_addr call delay slot instruction forward 4 bytes when
  4865. performing relaxation.
  4866. 2011-10-18 Cary Coutant <ccoutant@google.com>
  4867. * output.cc (posix_fallocate): Return 0 on success, errno on failure.
  4868. (Output_file::map_no_anonymous): Check for non-zero
  4869. return code from posix_fallocate.
  4870. 2011-10-17 Cary Coutant <ccoutant@google.com>
  4871. PR gold/13245
  4872. * plugin.cc (is_visible_from_outside): Check for symbols
  4873. referenced from dynamic objects.
  4874. * resolve.cc (Symbol_table::resolve): Don't count references
  4875. from dynamic objects as references from real ELF files.
  4876. * testsuite/plugin_test_2.sh: Adjust expected result.
  4877. 2011-10-17 Cary Coutant <ccoutant@google.com>
  4878. * gold.cc: Include timer.h.
  4879. (queue_middle_tasks): Stamp time.
  4880. (queue_final_tasks): Likewise.
  4881. * main.cc (main): Store timer in parameters. Print timers
  4882. for each pass.
  4883. * parameters.cc (Parameters::Parameters): Initialize timer_.
  4884. (Parameters::set_timer): New function.
  4885. (set_parameters_timer): New function.
  4886. * parameters.h (Parameters::set_timer): New function.
  4887. (Parameters::timer): New function.
  4888. (Parameters::timer_): New data member.
  4889. (set_parameters_timer): New function.
  4890. * timer.cc (Timer::stamp): New function.
  4891. (Timer::get_pass_time): New function.
  4892. * timer.h (Timer::stamp): New function.
  4893. (Timer::get_pass_time): New function.
  4894. (Timer::pass_times_): New data member.
  4895. 2011-10-17 Cary Coutant <ccoutant@google.com>
  4896. * readsyms.cc (Read_symbols::run): Don't queue an unblocker
  4897. task for members of lib groups.
  4898. 2011-10-17 Cary Coutant <ccoutant@google.com>
  4899. PR gold/13288
  4900. * fileread.cc (File_read::find_view): Add assert.
  4901. (File_read::make_view): Move bounds check (replace with assert)...
  4902. (File_read::find_or_make_view): ... to here.
  4903. 2011-10-12 Cary Coutant <ccoutant@google.com>
  4904. * output.cc (Output_file::open_base_file): Handle case where
  4905. ::read returns less than requested size.
  4906. 2011-10-10 Cary Coutant <ccoutant@google.com>
  4907. * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
  4908. Initialize defined_count_.
  4909. (Sized_relobj_incr::do_add_symbols): Count defined symbols.
  4910. (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
  4911. (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
  4912. (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
  4913. (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
  4914. * incremental.h (Sized_relobj_incr::defined_count_): New data
  4915. member.
  4916. (Sized_incr_dynobj::defined_count_): New data member.
  4917. * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
  4918. Return zeroes instead of internal error.
  4919. 2011-10-10 Cary Coutant <ccoutant@google.com>
  4920. PR gold/13249
  4921. * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
  4922. (Output_reloc::symbol_value): Return PLT offset if flag is set.
  4923. * output.h (class Output_reloc): Add use_plt_offset flag.
  4924. (Output_reloc::type_): Adjust size of bit field.
  4925. (Output_reloc::use_plt_offset_): New bit field.
  4926. (class Output_data_reloc): Adjust all calls to Output_reloc_type.
  4927. (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
  4928. flag. Adjust all callers.
  4929. * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
  4930. creating RELATIVE relocations.
  4931. 2011-10-10 Nick Clifton <nickc@redhat.com>
  4932. * po/es.po: Updated Spanish translation.
  4933. * po/fi.po: Updated Finnish translation.
  4934. 2011-10-03 Diego Novillo <dnovillo@google.com>
  4935. * options.cc (parse_uint): Fix dereference of RETVAL.
  4936. 2011-09-29 Sriraman Tallam <tmsriram@google.com>
  4937. * layout.h (section_order_map_): New member.
  4938. (get_section_order_map): New member function.
  4939. * output.cc (Output_section::add_input_section): Check for patterns
  4940. only when --section-ordering-file is specified.
  4941. * gold.cc (queue_middle_tasks): Delay updating order of sections till
  4942. output_sections have been formed.
  4943. * layout.cc (Layout_Layout): Initialize section_order_map_.
  4944. * plugin.cc (update_section_order): Store order in order_map. Do not
  4945. update the order.
  4946. * testsuite/Makefile.am: Add test case for plugin_final_layout.
  4947. * testsuite/Makefile.in: Regenerate.
  4948. * testsuite/plugin_section_order.c: New file.
  4949. * testsuite/plugin_final_layout.cc: New file.
  4950. * testsuite/plugin_final_layout.sh: New file.
  4951. 2011-09-29 Cary Coutant <ccoutant@google.com>
  4952. * incremental.cc (Sized_incremental_binary::do_process_got_plt):
  4953. Check for NULL.
  4954. * symtab.cc (Symbol_table::add_from_relobj): Ignore version
  4955. symbols during incremental update.
  4956. (Symbol_table::add_from_dynobj): Likewise.
  4957. 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  4958. Ian Lance Taylor <iant@google.com>
  4959. * symtab.cc (Symbol_table::define_special_symbol): Always
  4960. canonicalize version string.
  4961. 2011-09-26 Cary Coutant <ccoutant@google.com>
  4962. * gold.cc (queue_initial_tasks): Move option checks ...
  4963. * options.cc (General_options::finalize): ... to here. Disable
  4964. some options; make others fatal.
  4965. 2011-09-26 Cary Coutant <ccoutant@google.com>
  4966. gcc PR lto/47247
  4967. * plugin.cc (get_symbols_v2): New function.
  4968. (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
  4969. (is_referenced_from_outside): New function.
  4970. (Pluginobj::get_symbol_resolution_info): Add version parameter, return
  4971. LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
  4972. (get_symbols): Pass version parameter.
  4973. (get_symbols_v2): New function.
  4974. * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
  4975. parameter.
  4976. * testsuite/plugin_test.c (get_symbols_v2): New static variable.
  4977. (onload): Add LDPT_GET_SYMBOLS_V2.
  4978. (all_symbols_read_hook): Use get_symbols_v2; check for
  4979. LDPR_PREVAILING_DEF_IRONLY_EXP.
  4980. * testsuite/plugin_test_3.sh: Update expected results.
  4981. 2011-09-23 Simon Baldwin <simonb@google.com>
  4982. * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
  4983. configuration options.
  4984. * configure: Regenerate.
  4985. * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
  4986. * Makefile.in: Regenerate.
  4987. * testsuite/Makefile.in: Regenerate.
  4988. 2011-09-19 Sriraman Tallam <tmsriram@google.com>
  4989. * plugin.h (should_defer_layout): Modify to check for any_claimed_.
  4990. 2011-09-19 Cary Coutant <ccoutant@google.com>
  4991. * incremental.cc (can_incremental_update): Fix typo in comment.
  4992. * incremental.h (can_incremental_update): Likewise.
  4993. 2011-09-18 Cary Coutant <ccoutant@google.com>
  4994. * incremental.cc (can_incremental_update): New function.
  4995. * incremental.h (can_incremental_update): New function.
  4996. * layout.cc (Layout::init_fixed_output_section): Call it.
  4997. (Layout::make_output_section): Don't allow patch space in .eh_frame.
  4998. * object.cc (Sized_relobj_file::do_layout): Call
  4999. can_incremental_update.
  5000. 2011-09-13 Cary Coutant <ccoutant@google.com>
  5001. * configure.ac: Check for glibc support for gnu_indirect_function
  5002. support with static linking, setting automake conditional
  5003. IFUNC_STATIC.
  5004. * Makefile.in: Regenerate.
  5005. * configure: Regenerate.
  5006. * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
  5007. (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
  5008. for IFUNC_STATIC.
  5009. * testsuite/Makefile.in: Regenerate.
  5010. 2011-09-13 Cary Coutant <ccoutant@google.com>
  5011. * incremental.cc (Sized_relobj_incr::do_layout): Call
  5012. report_comdat_group for kept comdat sections.
  5013. * testsuite/Makefile.am (incremental_comdat_test_1): New test.
  5014. * testsuite/Makefile.in: Regenerate.
  5015. * testsuite/incr_comdat_test_1.cc: New source file.
  5016. * testsuite/incr_comdat_test_2_v1.cc: New source file.
  5017. * testsuite/incr_comdat_test_2_v2.cc: New source file.
  5018. * testsuite/incr_comdat_test_2_v3.cc: New source file.
  5019. 2011-09-13 Ian Lance Taylor <iant@google.com>
  5020. * object.cc (Sized_relobj_file::do_layout): Remove unused local
  5021. variable external_symbols_offset.
  5022. 2011-09-12 Ian Lance Taylor <iant@google.com>
  5023. * object.cc (Sized_relobj_file::do_layout): Remove assertion which
  5024. triggered if object has no symbols.
  5025. 2011-09-09 David S. Miller <davem@davemloft.net>
  5026. * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
  5027. (Output_fill_debug_line::do_write): Likewise.
  5028. 2011-08-29 Cary Coutant <ccoutant@google.com>
  5029. * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
  5030. casts to match formatting specs.
  5031. (Output_fill_debug_line::do_minimum_hole_size): Likewise.
  5032. 2011-08-26 Cary Coutant <ccoutant@google.com>
  5033. * layout.cc (Free_list::allocate): Provide guarantee of minimum
  5034. remaining hole size when allocating.
  5035. (Layout::make_output_section): Set fill methods for debug sections.
  5036. * layout.h (Free_list::Free_list_node): Move from private to
  5037. public.
  5038. (Free_list::set_min_hole_size): New function.
  5039. (Free_list::begin, Free_list::end): New functions.
  5040. (Free_list::min_hole_): New data member.
  5041. * output.cc: Include dwarf.h.
  5042. (Output_fill_debug_info::do_minimum_hole_size): New function.
  5043. (Output_fill_debug_info::do_write): New function.
  5044. (Output_fill_debug_line::do_minimum_hole_size): New function.
  5045. (Output_fill_debug_line::do_write): New function.
  5046. (Output_section::Output_section): Initialize new data member.
  5047. (Output_section::set_final_data_size): Ensure patch space is larger
  5048. than minimum hole size.
  5049. (Output_section::do_write): Fill holes in debug sections.
  5050. * output.h (Output_fill): New class.
  5051. (Output_fill_debug_info): New class.
  5052. (Output_fill_debug_line): New class.
  5053. (Output_section::set_free_space_fill): New function.
  5054. (Output_section::free_space_fill_): New data member.
  5055. * testsuite/Makefile.am (incremental_test_3): Add
  5056. --incremental-patch option.
  5057. (incremental_test_4): Likewise.
  5058. (incremental_test_5): Likewise.
  5059. (incremental_test_6): Likewise.
  5060. (incremental_copy_test): Likewise.
  5061. (incremental_common_test_1): Likewise.
  5062. * testsuite/Makefile.in: Regenerate.
  5063. 2011-08-26 Nick Clifton <nickc@redhat.com>
  5064. * po/es.po: Updated Spanish translation.
  5065. 2011-08-01 Cary Coutant <ccoutant@google.com>
  5066. * testsuite/Makefile.am (justsyms_exec): New testcase.
  5067. * testsuite/Makefile.in: Regenerate.
  5068. * testsuite/justsyms_exec.c: New source file.
  5069. * testsuite/justsyms_lib.c: New source file.
  5070. 2011-08-01 Cary Coutant <ccoutant@google.com>
  5071. * layout.cc (Layout::set_segment_offsets): Don't realign text
  5072. segment if -Ttext was specified.
  5073. * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
  5074. file type.
  5075. * object.h (Sized_relobj_file::e_type): New function.
  5076. (Sized_relobj_file::e_type_): New data member.
  5077. * symtab.cc (Symbol_table::add_from_relobj): Don't add section
  5078. base address for ET_EXEC files.
  5079. * target.cc (Target::do_make_elf_object_implementation): Allow
  5080. ET_EXEC files with --just-symbols option.
  5081. 2011-07-28 Cary Coutant <ccoutant@google.com>
  5082. * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
  5083. Add thread_number parameter.
  5084. (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
  5085. * workqueue-threads.cc
  5086. (Workqueue_threader_threadpool::should_cancel_thread): Cancel
  5087. current thread if its thread number is greater than desired thread
  5088. count.
  5089. * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
  5090. Add thread_number parameter.
  5091. (Workqueue::should_cancel_thread): Likewise.
  5092. (Workqueue::find_runnable_or_wait): Pass thread_number to
  5093. should_cancel_thread.
  5094. * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
  5095. parameter.
  5096. 2011-07-22 Sriraman Tallam <tmsriram@google.com>
  5097. * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
  5098. only after checking if it cannot be forced local.
  5099. * symtab.h (is_externally_visible): Check if the symbol is not forced
  5100. local.
  5101. 2011-07-15 Ian Lance Taylor <iant@google.com>
  5102. * options.h (class General_options): Add --print-output-format.
  5103. Move -EL next to -EB, for better --help output.
  5104. * target-select.cc: Include <cstdio>, "options.h", and
  5105. "parameters.h".
  5106. (Target_selector::do_target_bfd_name): New function.
  5107. (print_output_format): New function.
  5108. * target-select.h (class Target_selector): Update declarations.
  5109. (Target_selector::target_bfd_name): New function.
  5110. (print_output_format): Declare.
  5111. * main.cc: Include "target-select.h".
  5112. (main): Handle --print-output-format.
  5113. * gold.cc: Include "target-select.h".
  5114. (queue_initial_tasks): Handle --print-output-format when there are
  5115. no input files.
  5116. * parameters.cc (parameters_force_valid_target): Give a better
  5117. error message if -EB/-EL does not match target.
  5118. * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
  5119. function.
  5120. 2011-07-15 Ian Lance Taylor <iant@google.com>
  5121. * i386.cc (class Output_data_plt_i386): Add layout_ field.
  5122. (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
  5123. (Output_data_plt_i386::do_write): Write address of .dynamic
  5124. section to first entry in .got.plt section.
  5125. * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
  5126. (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
  5127. Initialize layout_.
  5128. (Output_data_plt_x86_64::do_write): Write address of .dynamic
  5129. section to first entry in .got.plt section.
  5130. * layout.h (Layout::dynamic_section): New function.
  5131. 2011-07-13 Sriraman Tallam <tmsriram@google.com>
  5132. * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
  5133. to claim_file call.
  5134. * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
  5135. input_section_position_, and input_section_glob_.
  5136. (read_layout_from_file): Call function section_ordering_specified.
  5137. * layout.h (is_section_ordering_specified): New function.
  5138. (section_ordering_specified): New function.
  5139. (section_ordering_specified_): New boolean member.
  5140. * main.cc(main): Call load_plugins after layout object is defined.
  5141. * output.cc (Output_section::add_input_section): Use
  5142. function section_ordering_specified to check if section ordering is
  5143. needed.
  5144. * output.cc (Output_section::add_relaxed_input_section): Use
  5145. function section_ordering_specified to check if section ordering is
  5146. needed.
  5147. (Output_section::update_section_layout): New function.
  5148. (Output_section::sort_attached_input_sections): Check if input section
  5149. must be reordered.
  5150. * output.h (Output_section::update_section_layout): New function.
  5151. * plugin.cc (get_section_count): New function.
  5152. (get_section_type): New function.
  5153. (get_section_name): New function.
  5154. (get_section_contents): New function.
  5155. (update_section_order): New function.
  5156. (allow_section_ordering): New function.
  5157. (Plugin::load): Add the new interfaces to the transfer vector.
  5158. (Plugin_manager::load_plugins): New parameter.
  5159. (Plugin_manager::all_symbols_read): New parameter.
  5160. (Plugin_manager::claim_file): New parameter. Save the elf object for
  5161. unclaimed objects.
  5162. (Plugin_manager::get_elf_object): New function.
  5163. (Plugin_manager::get_view): Change to directly use the bool to check
  5164. if get_view is called from claim_file_hook.
  5165. * plugin.h (input_objects): New function
  5166. (Plugin__manager::load_plugins): New parameter.
  5167. (Plugin_manager::claim_file): New parameter.
  5168. (Plugin_manager::get_elf_object): New function.
  5169. (Plugin_manager::in_claim_file_handler): New function.
  5170. (Plugin_manager::in_claim_file_handler_): New member.
  5171. (layout): New function.
  5172. * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
  5173. handler with an extra parameter. Make the elf object before calling
  5174. claim_file handler.
  5175. * testsuite/plugin_test.c (get_section_count): New function pointer.
  5176. (get_section_type): New function pointer.
  5177. (get_section_name): New function pointer.
  5178. (get_section_contents): New function pointer.
  5179. (update_section_order): New function pointer.
  5180. (allow_section_ordering): New function pointer.
  5181. (onload): Check if the new interfaces exist.
  5182. 2011-07-13 Ian Lance Taylor <iant@google.com>
  5183. * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
  5184. relro section.
  5185. * x86_64.cc (Target_x86_64::got_section): Likewise.
  5186. * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
  5187. (relro_now_test_SOURCES): New variable.
  5188. (relro_now_test_DEPENDENCIES): New variable.
  5189. (relro_now_test_LDFLAGS): New variable.
  5190. (relro_now_test_LDADD): New variable.
  5191. (relro_now_test.so): New target.
  5192. * testsuite/Makefile.in: Rebuild.
  5193. 2011-07-12 Ian Lance Taylor <iant@google.com>
  5194. PR gold/12980
  5195. * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
  5196. GLOB_DAT relocation rather than a RELATIVE relocation for a
  5197. protected symbol when creating a shared library.
  5198. * x86_64.cc (Target_x86_64::Scan::global): Likewise.
  5199. * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
  5200. * testsuite/protected_main_1.cc (main): Test that protected
  5201. function has same address.
  5202. 2011-07-11 Ian Lance Taylor <iant@google.com>
  5203. PR gold/12979
  5204. * options.h (class General_options): Add -Bgroup.
  5205. * options.cc (General_options::finalize): If -Bgroup is set,
  5206. default to --unresolved-symbols=report-all.
  5207. * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
  5208. * target-reloc.h (issue_undefined_symbol_error): Handle
  5209. --unresolved-symbols=report-all.
  5210. 2011-07-08 Ian Lance Taylor <iant@google.com>
  5211. PR gold/11985
  5212. * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
  5213. if linker script discards key sections.
  5214. (Layout::create_dynamic_symtab): Likewise.
  5215. (Layout::assign_local_dynsym_offsets): Likewise.
  5216. (Layout::sized_create_version_sections): Likewise.
  5217. (Layout::create_interp): Likewise.
  5218. (Layout::finish_dynamic_section): Likewise.
  5219. (Layout::set_dynamic_symbol_size): Likewise.
  5220. 2011-07-08 Ian Lance Taylor <iant@google.com>
  5221. PR gold/12386
  5222. * options.h (class General_options): Add --unresolved-symbols.
  5223. * target-reloc.h (issue_undefined_symbol_error): Check
  5224. --unresolved-symbols. Add comments.
  5225. 2011-07-08 Ian Lance Taylor <iant@google.com>
  5226. * testsuite/odr_violation2.cc (Ordering::operator()): Make
  5227. expression more complex.
  5228. 2011-07-08 Ian Lance Taylor <iant@google.com>
  5229. PR gold/11317
  5230. * target-reloc.h (issue_undefined_symbol_error): New inline
  5231. function, broken out of relocate_section.
  5232. (relocate_section): Call issue_undefined_symbol_error.
  5233. * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
  5234. there is no TLS segment if we are about to issue an undefined
  5235. symbol error.
  5236. * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
  5237. 2011-07-08 Ian Lance Taylor <iant@google.com>
  5238. PR gold/12279
  5239. * resolve.cc (Symbol_table::should_override): Add fromtype
  5240. parameter. Change all callers. Give error when linking together
  5241. TLS and non-TLS symbol.
  5242. (Symbol_table::should_override_with_special): Add fromtype
  5243. parameter. Change all callers.
  5244. * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
  5245. there is no TLS segment if we have reported some errors.
  5246. * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
  5247. 2011-07-08 Ian Lance Taylor <iant@google.com>
  5248. PR gold/12372
  5249. * target.h (Target::plt_address_for_global): New function.
  5250. (Target::plt_address_for_local): New function.
  5251. (Target::plt_section_for_global): Remove.
  5252. (Target::plt_section_for_local): Remove.
  5253. (Target::do_plt_address_for_global): New virtual function.
  5254. (Target::do_plt_address_for_local): New virtual function.
  5255. (Target::do_plt_section_for_global): Remove.
  5256. (Target::do_plt_section_for_local): Remove.
  5257. (Target::register_global_plt_entry): Add Symbol_table and Layout
  5258. parameters.
  5259. * output.cc (Output_data_got::Got_entry::write): Use
  5260. plt_address_for_global and plt_address_for_local.
  5261. * layout.cc (Layout::add_target_dynamic_tags): Use size and
  5262. address of output section.
  5263. * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
  5264. got_irelative_, and irelative_count_ fields. Update
  5265. declarations.
  5266. (Output_data_plt_i386::has_irelative_section): New function.
  5267. (Output_data_plt_i386::entry_count): Add irelative_count_.
  5268. (Output_data_plt_i386::set_final_data_size): Likewise.
  5269. (class Target_i386): Add got_irelative_ and rel_irelative_
  5270. fields. Update declarations.
  5271. (Target_i386::Target_i386): Initialize new fields.
  5272. (Target_i386::do_plt_address_for_global): New function replacing
  5273. do_plt_section_for_global.
  5274. (Target_i386::do_plt_address_for_local): New function replacing
  5275. do_plt_section_for_local.
  5276. (Target_i386::got_section): Create got_irelative_.
  5277. (Target_i386::rel_irelative_section): New function.
  5278. (Output_data_plt_i386::Output_data_plt_i386): Initialize new
  5279. fields. Don't define __rel_iplt_{start,end}.
  5280. (Output_data_plt_i386::add_entry): Add symtab and layout
  5281. parameters. Change all callers. Use different PLT and GOT for
  5282. IFUNC symbols.
  5283. (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
  5284. layout parameters. Change all callers. Use different PLT and
  5285. GOT.
  5286. (Output_data_plt_i386::rel_tls_desc): Fix formatting.
  5287. (Output_data_plt_i386::rel_irelative): New function.
  5288. (Output_data_plt_i386::address_for_global): New function.
  5289. (Output_data_plt_i386::address_for_local): New function.
  5290. (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
  5291. IRELATIVE GOT when changing IFUNC GOT entries.
  5292. (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
  5293. reloc.
  5294. (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
  5295. if we didn't create an IRELATIVE GOT.
  5296. (Target_i386::Relocate::relocate): Use plt_address_for_global and
  5297. plt_address_for_local.
  5298. (Target_i386::do_dynsym_value): Use plt_address_for_global.
  5299. * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
  5300. got_irelative_, and irelative_count_ fields. Update
  5301. declarations.
  5302. (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
  5303. Initialize new fields. Remove symtab parameter. Change all
  5304. callers.
  5305. (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
  5306. irelative_count_.
  5307. (Output_data_plt_x86_64::has_irelative_section): New function.
  5308. (Output_data_plt_x86_64::entry_count): Add irelative_count_.
  5309. (class Target_x86_64): Add got_irelative_ and rel_irelative_
  5310. fields. Update declarations.
  5311. (Target_x86_64::Target_x86_64): Initialize new fields.
  5312. (Target_x86_64::do_plt_address_for_global): New function replacing
  5313. do_plt_section_for_global.
  5314. (Target_x86_64::do_plt_address_for_local): New function replacing
  5315. do_plt_section_for_local.
  5316. (Target_x86_64::got_section): Create got_irelative_.
  5317. (Target_x86_64::rela_irelative_section): New function.
  5318. (Output_data_plt_x86_64::init): Remove symtab parameter. Change
  5319. all callers. Don't create __rel_iplt_{start,end}.
  5320. (Output_data_plt_x86_64::add_entry): Add symtab and layout
  5321. parameters. Change all callers. Use different PLT and GOT for
  5322. IFUNC symbols.
  5323. (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
  5324. layout parameters. Change all callers. Use different PLT and
  5325. GOT.
  5326. (Output_data_plt_x86_64::add_relocation): Add symtab and layout
  5327. parameters. Change all callers. Use different PLT and GOT for
  5328. IFUNC symbols.
  5329. (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
  5330. (Output_data_plt_x86_64::rela_irelative): New function.
  5331. (Output_data_plt_x86_64::address_for_global): New function.
  5332. (Output_data_plt_x86_64::address_for_local): New function.
  5333. (Output_data_plt_x86_64::set_final_data_size): Likewise.
  5334. (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
  5335. (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
  5336. (Target_x86_64::register_global_plt_entry): Add symtab and layout
  5337. parameters.
  5338. (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
  5339. reloc.
  5340. (Target_x86_64::do_finalize_sections): Create the __rela_iplt
  5341. symbols if we didn't create an IRELATIVE GOT.
  5342. (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
  5343. plt_address_for_local.
  5344. (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
  5345. * testsuite/ifuncvar1.c: New test file.
  5346. * testsuite/ifuncvar2.c: New test file.
  5347. * testsuite/ifuncvar3.c: New test file.
  5348. * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
  5349. (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
  5350. (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
  5351. (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
  5352. * testsuite/Makefile.in: Rebuild.
  5353. 2011-07-07 Cary Coutant <ccoutant@google.com>
  5354. * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
  5355. (two_file_test_1_ndebug.o): Likewise.
  5356. (two_file_test_1b_ndebug.o): Likewise.
  5357. (two_file_test_2_ndebug.o): Likewise.
  5358. (two_file_test_main_ndebug.o): Likewise.
  5359. (incremental_test_2): Link with no-debug versions.
  5360. 2011-07-06 Cary Coutant <ccoutant@google.com>
  5361. * incremental.cc
  5362. (Output_section_incremental_inputs::write_info_blocks): Check for
  5363. hidden and internal symbols.
  5364. 2011-07-06 Cary Coutant <ccoutant@google.com>
  5365. * incremental.cc (Sized_incremental_binary::do_file_has_changed):
  5366. Check disposition for startup file.
  5367. (Incremental_inputs::report_command_line): Ignore
  5368. --incremental-startup-unchanged option.
  5369. * options.cc (General_options::parse_incremental_startup_unchanged):
  5370. New function.
  5371. (General_options::General_options): Initialize new data member.
  5372. * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
  5373. (General_options): Add --incremental-startup-unchanged option.
  5374. (General_options::incremental_startup_disposition): New function.
  5375. (General_options::incremental_startup_disposition_): New data member.
  5376. 2011-07-06 Cary Coutant <ccoutant@google.com>
  5377. * incremental.cc (Sized_incremental_binary::setup_readers): Pass
  5378. input file index to Script_info ctor.
  5379. (Sized_incremental_binary::do_file_has_changed): Find the
  5380. command-line argument for files named in scripts.
  5381. * incremental.h (Script_info::Script_info): New ctor
  5382. with input file index.
  5383. (Script_info::input_file_index): New function.
  5384. (Script_info::input_file_index_): New data member.
  5385. (Incremental_binary::get_library): Add const.
  5386. (Incremental_binary::get_script_info): Add const.
  5387. * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
  5388. * testsuite/Makefile.am (incremental_test_5): New test case.
  5389. (incremental_test_6): New test case.
  5390. * testsuite/Makefile.in: Regenerate.
  5391. 2011-07-06 Cary Coutant <ccoutant@google.com>
  5392. * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
  5393. debug output when command lines differ.
  5394. 2011-07-06 Cary Coutant <ccoutant@google.com>
  5395. * incremental.cc (Incremental_inputs::report_command_line): Ignore
  5396. --incremental-patch option.
  5397. * layout.cc (Free_list::allocate): Extend allocation beyond original
  5398. end if enabled.
  5399. (Layout::make_output_section): Mark sections that should get
  5400. patch space.
  5401. * options.cc (parse_percent): New function.
  5402. * options.h (parse_percent): New function.
  5403. (DEFINE_percent): New macro.
  5404. (General_options): Add --incremental-patch option.
  5405. * output.cc (Output_section::Output_section): Initialize new data
  5406. members.
  5407. (Output_section::add_input_section): Print section name when out
  5408. of patch space.
  5409. (Output_section::add_output_section_data): Likewise.
  5410. (Output_section::set_final_data_size): Add patch space when
  5411. doing --incremental-full.
  5412. (Output_section::do_reset_address_and_file_offset): Remove patch
  5413. space.
  5414. (Output_segment::set_section_list_addresses): Print debug output
  5415. only if --incremental-update.
  5416. * output.h (Output_section::set_is_patch_space_allowed): New function.
  5417. (Output_section::is_patch_space_allowed_): New data member.
  5418. (Output_section::patch_space_): New data member.
  5419. * parameters.cc (Parameters::incremental_full): New function.
  5420. * parameters.h (Parameters::incremental_full): New function
  5421. * testsuite/Makefile.am (incremental_test_2): Add test for
  5422. --incremental-patch option.
  5423. * testsuite/Makefile.in: Regenerate.
  5424. * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
  5425. (t18): Remove function body.
  5426. 2011-07-05 Doug Kwan <dougkwan@google.com>
  5427. PR gold/12771
  5428. * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
  5429. Arm_Address type for relocation result.
  5430. (Arm_relocate_functions::abs16): Use unaligned access. Also fix
  5431. overflow check.
  5432. (Arm_relocate_functions::abs32): Use unaligned access.
  5433. (Arm_relocate_functions::rel32): Ditto.
  5434. (Arm_relocate_functions::prel31): Ditto.
  5435. (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
  5436. * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
  5437. static data relocations.
  5438. * testsuite/Makefile.in: Regnerate.
  5439. * testsuite/arm_unaligned_reloc.{s,sh}: New files.
  5440. 2011-07-05 Ian Lance Taylor <iant@google.com>
  5441. PR gold/12392
  5442. * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
  5443. symbols if necessary.
  5444. * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
  5445. 2011-07-05 Ian Lance Taylor <iant@google.com>
  5446. PR gold/12952
  5447. * resolve.cc (Symbol::override_base_with_special): Simply override
  5448. version with special symbol version, ignoring previous version.
  5449. 2011-07-05 Ian Lance Taylor <iant@google.com>
  5450. * object.cc (Sized_relobj_file::include_section_group): Add
  5451. information to comment about signature location.
  5452. 2011-07-02 Ian Lance Taylor <iant@google.com>
  5453. PR gold/12957
  5454. * options.h (class General_options): Add -f and -F.
  5455. * options.cc (General_options::finalize): Fatal error if -f/-F
  5456. are used without -shared.
  5457. * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
  5458. 2011-07-02 Ian Lance Taylor <iant@google.com>
  5459. * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
  5460. 2011-07-01 Ian Lance Taylor <iant@google.com>
  5461. PR gold/12525
  5462. PR gold/12952
  5463. * resolve.cc (Symbol::override_base_with_special): Don't override
  5464. the version if the overriding symbol has a different name.
  5465. * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
  5466. all callers. If we give an error about an undefined version,
  5467. define the base version if necessary.
  5468. * dynobj.h (class Versions): Update declaration.
  5469. * testsuite/weak_alias_test_5.cc: New file.
  5470. * testsuite/weak_alias_test.script: New file.
  5471. * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
  5472. and versioned_alias have the right value, and call t2.
  5473. * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
  5474. weak_alias_test_5.so.
  5475. (weak_alias_test_LDADD): Likewise.
  5476. (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
  5477. * testsuite/Makefile.in: Rebuild.
  5478. 2011-07-01 Ian Lance Taylor <iant@google.com>
  5479. PR gold/12525
  5480. * options.h (class General_options): Support -z notext.
  5481. * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
  5482. -Wl,-z,notext.
  5483. (two_file_shared_nonpic.so): Likewise.
  5484. (two_file_shared_mixed.so): Likewise.
  5485. (two_file_shared_mixed_1.so): Likewise.
  5486. (weak_undef_lib_nonpic.so): Likewise.
  5487. (alt/weak_undef_lib_nonpic.so): Likewise.
  5488. (tls_test_shared_nonpic.so): Likewise.
  5489. * testsuite/Makefile.in: Rebuild.
  5490. 2011-07-01 Ian Lance Taylor <iant@google.com>
  5491. PR gold/12525
  5492. * configure.ac: Test whether static linking works, setting
  5493. the automake conditional HAVE_STATIC.
  5494. * testsuite/Makefile.am: Disable tests using -static if
  5495. HAVE_STATIC is not true.
  5496. * configure, testsuite/Makefile.in: Rebuild.
  5497. 2011-07-01 Ian Lance Taylor <iant@google.com>
  5498. PR gold/12525
  5499. * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
  5500. Assert if we see DW_EH_PE_indirect.
  5501. * target.h (Target::ehframe_datarel_base): New function.
  5502. (Target::do_ehframe_datarel_base): New target function.
  5503. * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
  5504. * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
  5505. function.
  5506. 2011-07-01 Ian Lance Taylor <iant@google.com>
  5507. PR gold/12571
  5508. * options.h (class General_options): Add
  5509. --ld-generated-unwind-info.
  5510. * ehframe.cc (Fde::write): Add address parameter. Change all
  5511. callers. If associated with PLT, fill in address and size.
  5512. (Cie::set_output_offset): Only add merge mapping if there is an
  5513. object.
  5514. (Cie::write): Add address parameter. Change all callers.
  5515. (Eh_frame::add_ehframe_for_plt): New function.
  5516. * ehframe.h (class Fde): Update declarations. Move shndx_ and
  5517. input_offset_ fields into union u_, with new plt field.
  5518. (Fde::Fde): Adjust for new union field.
  5519. (Fde::Fde) [Output_data version]: New constructor.
  5520. (Fde::add_mapping): Only add merge mapping if there is an object.
  5521. (class Cie): Update declarations.
  5522. (class Eh_frame): Declare add_ehframe_for_plt.
  5523. * layout.cc (Layout::layout_eh_frame): Break out code into
  5524. make_eh_frame_section, and call it.
  5525. (Layout::make_eh_frame_section): New function.
  5526. (Layout::add_eh_frame_for_plt): New function.
  5527. * layout.h (class Layout): Update declarations.
  5528. * merge.cc (Merge_map::add_mapping): Add assertion.
  5529. * i386.cc: Include "dwarf.h".
  5530. (class Output_data_plt_i386): Make first_plt_entry,
  5531. dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
  5532. plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
  5533. and plt_eh_frame_fde.
  5534. (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
  5535. boundary. Call add_eh_frame_for_plt if appropriate.
  5536. * x86_64.cc: Include "dwarf.h".
  5537. (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
  5538. first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
  5539. plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
  5540. and plt_eh_frame_fde.
  5541. (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
  5542. appropriate.
  5543. 2011-06-29 Ian Lance Taylor <iant@google.com>
  5544. PR gold/12629
  5545. * object.cc (Sized_relobj_file::layout_section): Change shdr
  5546. parameter to be const.
  5547. (Sized_relobj_file::layout_eh_frame_section): New function, broken
  5548. out of do_layout.
  5549. (Sized_relobj_file::do_layout): Defer .eh_frame sections if
  5550. appropriate. Call layout_eh_frame_section.
  5551. (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
  5552. sections.
  5553. * object.h (class Sized_relobj_file): Update declarations.
  5554. 2011-06-29 Ian Lance Taylor <iant@google.com>
  5555. PR gold/12652
  5556. * script.cc (Token::integer_value): Accept trailing M/m/K/k
  5557. modifier.
  5558. (Lex::gather_token): Accept trailing M/m/K/k for integers.
  5559. 2011-06-29 Ian Lance Taylor <iant@google.com>
  5560. PR gold/12675
  5561. * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
  5562. SHT_X86_64_UNWIND.
  5563. * layout.cc (Layout::layout_eh_frame): Likewise.
  5564. 2011-06-29 Ian Lance Taylor <iant@google.com>
  5565. PR gold/12695
  5566. * layout.cc (Layout::symtab_section_shndx): New function.
  5567. * layout.h (class Layout): Declare symtab_section_shndx.
  5568. * output.cc (Output_section::write_header): Call it.
  5569. 2011-06-29 Ian Lance Taylor <iant@google.com>
  5570. PR gold/12818
  5571. * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
  5572. symbols which are not used in a relocation.
  5573. 2011-06-28 Ian Lance Taylor <iant@google.com>
  5574. PR gold/12898
  5575. * layout.cc (Layout::segment_precedes): Don't crash if a linker
  5576. script create indistinguishable segments.
  5577. (Layout::set_segment_offsets): Use stable_sort when sorting
  5578. segments. Pass this to Compare_segments constructor.
  5579. * layout.h (class Layout): Make segment_precedes non-static.
  5580. (class Compare_segments): Change from struct to class. Add
  5581. layout_ field. Add constructor.
  5582. * script-sections.cc
  5583. (Script_sections::attach_sections_using_phdrs_clause): Rename
  5584. local orphan to is_orphan. Don't report failure to put empty
  5585. section in segment. On attachment failure, report name of
  5586. section, and attach to first PT_LOAD segment.
  5587. 2011-06-28 Ian Lance Taylor <iant@google.com>
  5588. PR gold/12934
  5589. * target-select.cc (Target_selector::Target_selector): Add
  5590. emulation parameter. Change all callers.
  5591. (select_target_by_bfd_name): Rename from select_target_by_name.
  5592. Change all callers.
  5593. (select_target_by_emulation): New function.
  5594. (supported_emulation_names): New function.
  5595. * target-select.h (class Target_selector): Add emulation_ field.
  5596. Update declarations.
  5597. (Target_selector::recognize_by_bfd_name): Rename from
  5598. recognize_by_name. Change all callers.
  5599. (Target_selector::supported_bfd_names): Rename from
  5600. supported_names. Change all callers.
  5601. (Target_selector::recognize_by_emulation): New function.
  5602. (Target_selector::supported_emulations): New function.
  5603. (Target_selector::emulation): New function.
  5604. (Target_selector::do_recognize_by_bfd_name): Rename from
  5605. do_recognize_by_name. Change all callers.
  5606. (Target_selector::do_supported_bfd_names): Rename from
  5607. do_supported_names. Change all callers.
  5608. (Target_selector::do_recognize_by_emulation): New function.
  5609. (Target_selector::do_supported_emulations): New function.
  5610. (select_target_by_bfd_name): Change name in declaration.
  5611. (select_target_by_emulation): Declare.
  5612. (supported_emulation_names): Declare.
  5613. * parameters.cc (parameters_force_valid_target): Try to find
  5614. target based on emulation from -m option.
  5615. * options.h (class General_options): Change doc string for -m.
  5616. * options.cc (help): Print emulations.
  5617. (General_options::parse_V): Likewise.
  5618. * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
  5619. Add emulation parameter. Change all callers.
  5620. 2011-06-28 Ian Lance Taylor <iant@google.com>
  5621. * target.h (class Target): Add osabi_ field.
  5622. (Target::osabi): New function.
  5623. (Target::set_osabi): New function.
  5624. (Target::Target): Initialize osabi_.
  5625. (Target::do_adjust_elf_header): Make pure virtual.
  5626. (Sized_target::do_adjust_elf_header): Declare.
  5627. * target.cc (Sized_target::do_adjust_elf_header): New function.
  5628. (class Sized_target): Instantiate all versions.
  5629. * freebsd.h (class Target_freebsd): Remove.
  5630. (Target_selector_freebsd::do_recognize): Call set_osabi on
  5631. Target.
  5632. (Target_selector_freebsd::do_recognize_by_name): Likewise.
  5633. (Target_selector_freebsd::set_osabi): Remove.
  5634. * i386.cc (class Target_i386): Inherit from Sized_target rather
  5635. than Target_freebsd.
  5636. * x86_64.cc (class Target_x86_64): Likewise.
  5637. 2011-06-28 Ian Lance Taylor <iant@google.com>
  5638. * target.h (Target::can_check_for_function_pointers): Rewrite.
  5639. Make non-virtual.
  5640. (Target::can_icf_inline_merge_sections): Likewise.
  5641. (Target::section_may_have_icf_unsafe_poineters): Likewise.
  5642. (Target::Target_info): Add can_icf_inline_merge_sections field.
  5643. (Target::do_can_check_for_function_pointers): New virtual
  5644. function.
  5645. (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
  5646. * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
  5647. from can_check_for_function_pointers, move in file.
  5648. (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
  5649. section_may_have_icf_unsafe_poineters, move in file.
  5650. (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
  5651. * i386.cc (Target_i386::do_can_check_for_function_pointers):
  5652. Rename from can_check_for_function_pointers, move in file.
  5653. (Target_i386::can_icf_inline_merge_sections): Remove.
  5654. (Target_i386::i386_info): Initialize
  5655. can_icf_inline_merge_sections.
  5656. * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
  5657. Initialize can_icf_inline_merge_sections.
  5658. * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
  5659. * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
  5660. Rename from can_check_for_function_pointers, move in file.
  5661. (Target_x86_64::can_icf_inline_merge_sections): Remove.
  5662. (Target_x86_64::x86_64_info): Initialize
  5663. can_icf_inline_merge_sections.
  5664. * testsuite/testfile.cc (Target_test::test_target_info):
  5665. Likewise.
  5666. * icf.cc (get_section_contents): Correct formatting.
  5667. 2011-06-27 Ian Lance Taylor <iant@google.com>
  5668. * symtab.cc (Symbol::versioned_name): New function.
  5669. (Symbol_table::add_to_final_symtab): Use versioned_name when
  5670. appropriate.
  5671. (Symbol_table::sized_write_symbol): Likewise.
  5672. * symtab.h (class Symbol): Declare versioned_name.
  5673. * stringpool.h (class Stringpool_template): Add variant of add
  5674. which takes a std::basic_string.
  5675. * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
  5676. (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
  5677. (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
  5678. (ver_test_12.o): New target.
  5679. * testsuite/Makefile.in: Rebuild.
  5680. 2011-06-27 Doug Kwan <dougkwan@google.com>
  5681. * arm.cc (Arm_relocate_functions::thm_jump8,
  5682. Arm_relocate_functions::thm_jump11): Use a wider signed
  5683. type to compute offset.
  5684. * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
  5685. arm_thm_jump8.
  5686. * testsuite/Makefile.in: Regenerate.
  5687. * testsuite/arm_branch_in_range.sh: Check test results of
  5688. arm_thm_jump11 and arm_thm_jump8.
  5689. * testsuite/arm_thm_jump11.s: New test source file.
  5690. * testsuite/arm_thm_jump11.t: New linker script.
  5691. * testsuite/arm_thm_jump8.s: New test source file.
  5692. * testsuite/arm_thm_jump8.t: New linker script.
  5693. 2011-06-24 Ian Lance Taylor <iant@google.com>
  5694. * layout.cc: Include "object.h".
  5695. (ctors_sections_in_init_array): New static variable.
  5696. (Layout::is_ctors_in_init_array): New function.
  5697. (Layout::layout): Add entry to ctors_sections_in_init_array if
  5698. appropriate.
  5699. * layout.h (class Layout): Declare is_ctors_in_init_array.
  5700. * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
  5701. is_ctors_reverse_view is set.
  5702. (Sized_relobj_file::write_sections): Add layout parameter. Change
  5703. all callers. Set is_ctors_reverse_view field of View_size.
  5704. (Sized_relobj_file::reverse_words): New function.
  5705. * object.h (Sized_relobj_file::View_size): Add
  5706. is_ctors_reverse_view field.
  5707. (class Sized_relobj_file): Update declarations.
  5708. * testsuite/initpri3.c: New test.
  5709. * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
  5710. initpri3b.
  5711. (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
  5712. (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
  5713. (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
  5714. (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
  5715. * testsuite/Makefile.in: Rebuild.
  5716. 2011-06-24 Cary Coutant <ccoutant@google.com>
  5717. * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
  5718. (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
  5719. (debug_msg_cdebug.err): New targets.
  5720. * testsuite/Makefile.in: Regenerate.
  5721. * testsuite/debug_msg.sh: Check output of link with compressed debug.
  5722. Fix checks for link with shared library.
  5723. 2011-06-24 Doug Kwan <dougkwan@google.com>
  5724. * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
  5725. skip empty text sections.
  5726. * testsuite/arm_exidx_test.s: Test handling of an empty text section.
  5727. 2011-06-22 Ian Lance Taylor <iant@google.com>
  5728. PR gold/12910
  5729. * options.h (class General_options): Add --ctors-in-init-array.
  5730. * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
  5731. friends as SHT_PROGBITS for merging sections.
  5732. (Layout::layout): Remove special handling of .init_array and
  5733. friends. Don't sort if doing relocatable link. Sort for .ctors
  5734. and .dtors if ctors_in_init_array.
  5735. (Layout::make_output_section): Force correct section types for
  5736. .init_array and friends. Don't sort if doing relocatable link,
  5737. Don't sort .ctors and .dtors if ctors_in_init_array.
  5738. (Layout::section_name_mapping): Remove .ctors. and .dtorso.
  5739. (Layout::output_section_name): Add relobj parameter. Change all
  5740. callers. Handle .ctors. and .dtors. in code rather than table.
  5741. Handle .ctors and .dtors if ctors_in_init_array.
  5742. (Layout::match_file_name): New function, moved from output.cc.
  5743. * layout.h (class Layout): Update declarations.
  5744. * output.cc: Include "layout.h".
  5745. (Input_section_sort_entry::get_priority): New function.
  5746. (Input_section_sort_entry::match_file_name): Just call
  5747. Layout::match_file_name.
  5748. (Output_section::Input_section_sort_init_fini_compare::operator()):
  5749. Handle .ctors and .dtors. Sort by explicit priority rather than
  5750. by name.
  5751. * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
  5752. * testsuite/initpri2.c: New test.
  5753. * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
  5754. (check_PROGRAMS): Add initpri2.
  5755. (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
  5756. (initpri2_LDFLAGS, initpri2_LDADD): New variables.
  5757. * configure, testsuite/Makefile.in: Rebuild.
  5758. 2011-06-19 Ian Lance Taylor <iant@google.com>
  5759. PR gold/12880
  5760. * layout.cc (Layout::attach_allocated_section_to_segment): Add a
  5761. .interp section to a PT_INTERP segment even if we have seen a
  5762. --dynamic-linker option. Don't do it if we have seen a PHDRS
  5763. clause in a linker script.
  5764. (Layout::finalize): Don't create a .interp section if we've
  5765. already create a PT_INTERP segment.
  5766. (Layout::create_interp): Always call choose_output_section (revert
  5767. patch of 2011-06-17). Don't create PT_INTERP segment.
  5768. * script-sections.cc
  5769. (Script_sections::create_note_and_tls_segments): Add a .interp
  5770. section to a PT_INTERP segment even if we have seen a
  5771. --dynamic-linker option.
  5772. 2011-06-18 Ian Lance Taylor <iant@google.com>
  5773. * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
  5774. merely because a non-PT_LOAD segment has a dynamic reloc.
  5775. 2011-06-18 Ian Lance Taylor <iant@google.com>
  5776. * layout.cc (Layout::finish_dynamic_section): Don't create
  5777. DT_FLAGS entry if not needed.
  5778. 2011-06-18 Ian Lance Taylor <iant@google.com>
  5779. PR gold/12745
  5780. * layout.cc (Layout::layout_eh_frame): Correct handling of
  5781. writable .eh_frame section.
  5782. 2011-06-17 Ian Lance Taylor <iant@google.com>
  5783. PR gold/12893
  5784. * resolve.cc (Symbol_table::resolve): Don't give an error if a
  5785. symbol is redefined with the exact same object and value.
  5786. 2011-06-17 Ian Lance Taylor <iant@google.com>
  5787. PR gold/12880
  5788. * layout.h (class Layout): Add interp_segment_ field.
  5789. * layout.cc (Layout::Layout): Initialize interp_segment_ field.
  5790. (Layout::attach_allocated_section_to_segment): If making shared
  5791. library, put .interp section in PT_INTERP segment.
  5792. (Layout::finalize): Also call create_interp if -dynamic-linker
  5793. option was used.
  5794. (Layout::create_interp): Assert that there is no PT_INTERP
  5795. segment. If not using a SECTIONS clause, use make_output_section.
  5796. (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
  5797. * script-sections.cc
  5798. (Script_sections::create_note_and_tls_segments): If making shared
  5799. library, put .interp section in PT_INTERP segment.
  5800. 2011-06-17 Ian Lance Taylor <iant@google.com>
  5801. * object.cc (Sized_relobj_file::do_layout): Keep warning sections
  5802. when making a shared library.
  5803. 2011-06-17 Ian Lance Taylor <iant@google.com>
  5804. * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
  5805. parameter. Change all callers. Don't issue warning about PC32
  5806. against locally defined symbol.
  5807. 2011-06-16 Ian Lance Taylor <iant@google.com>
  5808. * symtab.cc (Warnings::issue_warning): Don't warn if relocation
  5809. occurs in same object.
  5810. 2011-06-14 Alan Modra <amodra@gmail.com>
  5811. * po/POTFILES.in: Regenerate.
  5812. 2011-06-09 Ian Lance Taylor <iant@google.com>
  5813. * script-sections.cc
  5814. (Orphan_output_section::set_section_addresses): For a relocatable
  5815. link set address to 0.
  5816. 2011-06-09 Cary Coutant <ccoutant@google.com>
  5817. PR gold/12804
  5818. * gold.cc (queue_initial_tasks): Warn if --incremental is
  5819. used with --compress-debug-sections.
  5820. * object.cc (Sized_relobj_file::do_layout): Report
  5821. uncompressed size of compressed input sections.
  5822. 2011-06-08 Cary Coutant <ccoutant@google.com>
  5823. PR gold/12804
  5824. * testsuite/two_file_test_2_v1.cc: Change initialization of
  5825. v2 to keep it in .data.
  5826. 2011-06-07 Cary Coutant <ccoutant@google.com>
  5827. * common.cc (Symbol_table::do_allocate_commons_list): Call
  5828. gold_fallback.
  5829. * errors.cc (Errors::fatal): Adjust call to gold_exit.
  5830. (Errors::fallback): New function.
  5831. (gold_fallback): New function.
  5832. * errors.h (Errors::fallback): New function.
  5833. * gold.cc (gold_exit): Change status parameter to enum; adjust
  5834. all callers.
  5835. (queue_initial_tasks): Call gold_fallback.
  5836. * gold.h: Include cstdlib.
  5837. (Exit_status): New enum type.
  5838. (gold_exit): Change status parameter to enum.
  5839. (gold_fallback): New function.
  5840. * layout.cc (Layout::set_section_offsets): Call gold_fallback.
  5841. (Layout::create_symtab_sections): Likewise.
  5842. (Layout::create_shdrs): Likewise.
  5843. * main.cc (main): Adjust call to gold_exit.
  5844. * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
  5845. (Output_data_got::add_got_entry_pair): Likewise.
  5846. (Output_section::add_input_section): Likewise.
  5847. (Output_section::add_output_section_data): Likewise.
  5848. (Output_segment::set_section_list_addresses): Likewise.
  5849. * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
  5850. 2011-06-07 Cary Coutant <ccoutant@google.com>
  5851. * layout.cc (Layout::set_segment_offsets): Don't adjust layout
  5852. for incremental links.
  5853. * output.cc (Output_segment::set_section_list_addresses): Remove
  5854. FIXME and test for TLS or BSS.
  5855. 2011-06-07 Cary Coutant <ccoutant@google.com>
  5856. * testsuite/Makefile.am: Add incremental_copy_test,
  5857. incremental_common_test_1.
  5858. * testsuite/Makefile.in: Regenerate.
  5859. * testsuite/common_test_1_v1.c: New source file.
  5860. * testsuite/common_test_1_v2.c: New source file.
  5861. * testsuite/copy_test_v1.cc: New source file.
  5862. 2011-06-07 Cary Coutant <ccoutant@google.com>
  5863. * common.cc (Symbol_table::do_allocate_commons_list): For incremental
  5864. update, allocate common from bss section's free list.
  5865. * incremental-dump.cc (dump_incremental_inputs): Print flag for
  5866. linker-defined symbols.
  5867. * incremental.cc (Sized_incremental_binary::do_process_got_plt):
  5868. Skip GOT and PLT entries that are no longer referenced.
  5869. (Output_section_incremental_inputs::write_info_blocks): Mark
  5870. linker-defined symbols.
  5871. (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
  5872. * output.cc (Output_section::allocate): New function.
  5873. * output.h (Output_section::allocate): New function.
  5874. * resolve.cc (Symbol_table::report_resolve_problem): Add case for
  5875. linker-defined symbols.
  5876. (Symbol::override_base_with_special): Copy is_predefined_ flag.
  5877. * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
  5878. (Symbol::init_base_output_data): Likewise.
  5879. (Symbol::init_base_output_segment): Likewise.
  5880. (Symbol::init_base_constant): Likewise.
  5881. (Sized_symbol::init_output_data): Likewise.
  5882. (Sized_symbol::init_output_segment): Likewise.
  5883. (Sized_symbol::init_constant): Likewise.
  5884. (Symbol_table::do_define_in_output_data): Likewise.
  5885. (Symbol_table::do_define_in_output_segment): Likewise.
  5886. (Symbol_table::do_define_as_constant): Likewise.
  5887. * symtab.h (Symbol::is_predefined): New function.
  5888. (Symbol::init_base_output_data): Add is_predefined parameter.
  5889. (Symbol::init_base_output_segment): Likewise.
  5890. (Symbol::init_base_constant): Likewise.
  5891. (Symbol::is_predefined_): New data member.
  5892. (Sized_symbol::init_output_data): Add is_predefined parameter.
  5893. (Sized_symbol::init_output_segment): Likewise.
  5894. (Sized_symbol::init_constant): Likewise.
  5895. (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
  5896. 2011-06-07 Cary Coutant <ccoutant@google.com>
  5897. * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
  5898. instead of emit_copy_reloc.
  5899. (Copy_relocs::emit_copy_reloc): Refactor.
  5900. (Copy_relocs::make_copy_reloc): New function.
  5901. (Copy_relocs::add_copy_reloc): Remove.
  5902. * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
  5903. section.
  5904. (Copy_relocs::make_copy_reloc): New function.
  5905. (Copy_relocs::add_copy_reloc): Remove.
  5906. * gold.cc (queue_middle_tasks): Emit old COPY relocations from
  5907. unchanged input files.
  5908. * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
  5909. * incremental.cc (Sized_incremental_binary::do_reserve_layout):
  5910. Reserve BSS space for COPY relocations.
  5911. (Sized_incremental_binary::do_emit_copy_relocs): New function.
  5912. (Output_section_incremental_inputs::write_info_blocks): Record
  5913. whether a symbol is copied from a shared object.
  5914. (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
  5915. * incremental.h (enum Incremental_shlib_symbol_flags): New type.
  5916. (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
  5917. (Incremental_input_entry_reader::get_output_symbol_index): Add
  5918. is_copy parameter.
  5919. (Incremental_binary::emit_copy_relocs): New function.
  5920. (Incremental_binary::do_emit_copy_relocs): New function.
  5921. (Sized_incremental_binary::Sized_incremental_binary): Initialize
  5922. new data member.
  5923. (Sized_incremental_binary::add_copy_reloc): New function.
  5924. (Sized_incremental_binary::do_emit_copy_relocs): New function.
  5925. (Sized_incremental_binary::Copy_reloc): New struct.
  5926. (Sized_incremental_binary::Copy_relocs): New typedef.
  5927. (Sized_incremental_binary::copy_relocs_): New data member.
  5928. * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
  5929. * symtab.h (Symbol_table::add_from_incrobj): Change return type.
  5930. * target.h (Sized_target::emit_copy_reloc): New function.
  5931. * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
  5932. 2011-06-02 Cary Coutant <ccoutant@google.com>
  5933. PR gold/12163
  5934. * archive.cc (Archive::Archive): Initialize new data member.
  5935. (Archive::include_all_members): Return if archive has already been
  5936. included.
  5937. * archive.h (Archive::include_all_members_): New data member.
  5938. 2011-06-02 Nick Clifton <nickc@redhat.com>
  5939. * dynobj.h: Fix spelling mistake in comment.
  5940. * output.cc: Likewise.
  5941. 2011-05-31 Doug Kwan <dougkwan@google.com>
  5942. Asier Llano
  5943. PR gold/12826
  5944. * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
  5945. arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
  5946. * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
  5947. redundant arm_exidx_test.so.
  5948. * testsuite/Makefile.in: Regenerate.
  5949. (check_SCRIPTS): Add pr12826.sh
  5950. (check_DATA): Add pr12826.stdout
  5951. (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
  5952. * testsuite/pr12826.sh: New file.
  5953. * testsuite/pr12826_1.s: Ditto.
  5954. * testsuite/pr12826_1.s: Ditto.
  5955. 2011-05-30 Ian Lance Taylor <iant@google.com>
  5956. * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
  5957. sections.
  5958. 2011-05-29 Ian Lance Taylor <iant@google.com>
  5959. PR gold/12804
  5960. * testsuite/Makefile.am: Use different file name for two_file_test
  5961. temporary file for each incremental test.
  5962. * testsuite/Makefile.in: Rebuild.
  5963. 2011-05-29 Ian Lance Taylor <iant@google.com>
  5964. * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
  5965. binary input file is empty.
  5966. 2011-05-27 Ian Lance Taylor <iant@google.com>
  5967. * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
  5968. (ver_test_9.so): Likewise.
  5969. * testsuite/Makefile.in: Rebuild.
  5970. 2011-05-26 Cary Coutant <ccoutant@google.com>
  5971. * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
  5972. * incremental.cc (Incremental_inputs::report_input_section): Fix
  5973. comment, indentation.
  5974. (Incremental_inputs::report_comdat_group): New function.
  5975. (Output_section_incremental_inputs::set_final_data_size): Adjust size
  5976. of data for incremental input file entry.
  5977. (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
  5978. group count, COMDAT group signatures.
  5979. (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
  5980. an unchanged input file.
  5981. * incremental.h (Incremental_object_entry::Incremental_object_entry):
  5982. Initialize new data member.
  5983. (Incremental_object_entry::add_comdat_group): New function.
  5984. (Incremental_object_entry::get_comdat_group_count): New function.
  5985. (Incremental_object_entry::get_comdat_signature_key): New function.
  5986. (Incremental_object_entry::groups_): New data member.
  5987. (Incremental_inputs::report_comdat_group): New function.
  5988. (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
  5989. data for incremental input file entry.
  5990. (Incremental_input_entry_reader::get_comdat_group_count): New function.
  5991. (Incremental_input_entry_reader::get_input_section): Adjust size of
  5992. data for incremental input file entry.
  5993. (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
  5994. (Incremental_input_entry_reader::get_comdat_group_signature): New
  5995. function.
  5996. * object.cc (Sized_relobj::include_section_group): Report kept
  5997. COMDAT groups for incremental links.
  5998. 2011-05-24 David Meyer <pdox@google.com>
  5999. * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
  6000. with name parameter. Add found_name parameter.
  6001. * fileread.cc (Input_file::find_file): Adjust code accordingly.
  6002. * dirsearch.h (class Dirsearch): Update declaration.
  6003. 2011-05-24 Ian Lance Taylor <iant@google.com>
  6004. * archive.cc (Library_base::should_include_member): Pull in object
  6005. from archive if it defines the entry symbol.
  6006. * parameters.cc (Parameters::entry): New function.
  6007. * parameters.h (class Parameters): Declare entry.
  6008. * output.h (class Output_file_header): Remove entry_ field.
  6009. * output.cc (Output_file_header::Output_file_header): Remove entry
  6010. parameter. Change all callers.
  6011. (Output_file_header::entry): Use parameters->entry.
  6012. * gold.cc (queue_middle_tasks): Likewise.
  6013. * plugin.cc (Plugin_hook::run): Likewise.
  6014. 2011-05-24 Cary Coutant <ccoutant@google.com>
  6015. * gold.cc (queue_initial_tasks): Pass incremental base filename
  6016. to Output_file::open_base_file; don't print error message.
  6017. * incremental-dump.cc (main): Adjust call to
  6018. Output_file::open_for_modification.
  6019. * incremental-dump.cc (main): Likewise.
  6020. * incremental.cc (Incremental_inputs::report_command_line):
  6021. Ignore --incremental-base option when comparing command lines.
  6022. Ignore parameter when given as separate argument.
  6023. * options.h (class General_options): Add --incremental-base.
  6024. * output.cc (Output_file::Output_file):
  6025. (Output_file::open_base_file): Add base_name and writable parameters;
  6026. read base file into new file; print error message here.
  6027. (Output_file::map_no_anonymous): Add writable parameter; adjust all
  6028. callers.
  6029. * output.h (Output_file::open_for_modification): Rename to...
  6030. (Output_file::open_base_file): ...this; add base_name and
  6031. writable parameters; adjust all callers.
  6032. (Output_file::map_no_anonymous): Add writable parameter; adjust all
  6033. callers.
  6034. * testsuite/Makefile.am (incremental_test_4): Test
  6035. --incremental-base.
  6036. * testsuite/Makefile.in: Regenerate.
  6037. 2011-05-24 Cary Coutant <ccoutant@google.com>
  6038. * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
  6039. incremental_test_4.
  6040. * testsuite/Makefile.in: Regenerate.
  6041. * testsuite/two_file_test_1_v1.cc: New test source file.
  6042. * testsuite/two_file_test_1b_v1.cc: New test source file.
  6043. * testsuite/two_file_test_2_v1.cc: New test source file.
  6044. 2011-05-24 Cary Coutant <ccoutant@google.com>
  6045. * dynobj.h (Dynobj::do_dynobj): New function.
  6046. * incremental-dump.cc (dump_incremental_inputs): Print as_needed
  6047. flag and soname for shared objects.
  6048. * incremental.cc (Incremental_inputs::report_object): Make
  6049. either Incremental_object_entry or Incremental_dynobj_entry; add
  6050. soname to string table.
  6051. (Incremental_inputs::report_input_section): Add assertion.
  6052. (Output_section_incremental_inputs::set_final_data_size): Adjust
  6053. type of input file entry for shared libraries; adjust size of
  6054. shared library info entry.
  6055. (Output_section_incremental_inputs::write_input_files): Write
  6056. as_needed flag for shared libraries.
  6057. (Output_section_incremental_inputs::write_info_blocks): Adjust type
  6058. of input file entry for shared libraries; write soname.
  6059. (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
  6060. soname from incremental info.
  6061. * incremental.h (enum Incremental_input_flags): Add
  6062. INCREMENTAL_INPUT_AS_NEEDED.
  6063. (Incremental_input_entry::Incremental_input_entry): Initialize new
  6064. data member.
  6065. (Incremental_input_entry::set_as_needed): New function.
  6066. (Incremental_input_entry::as_needed): New function.
  6067. (Incremental_input_entry::do_dynobj_entry): New function.
  6068. (Incremental_input_entry::as_needed_): New data member.
  6069. (Incremental_object_entry::Incremental_object_entry): Don't check
  6070. for shared library.
  6071. (Incremental_object_entry::do_type): Likewise.
  6072. (class Incremental_dynobj_entry): New class.
  6073. (Incremental_input_entry_reader::as_needed): New function.
  6074. (Incremental_input_entry_reader::get_soname): New function.
  6075. (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
  6076. (Incremental_input_entry_reader::get_output_symbol_index): Adjust
  6077. size of shared library info entry.
  6078. * layout.cc (Layout::finish_dynamic_section): Don't test for
  6079. incremental link when adding DT_NEEDED entries.
  6080. * object.h (Object::Object): Initialize new data member.
  6081. (Object::dynobj): New function.
  6082. (Object::set_as_needed): New function.
  6083. (Object::as_needed): New function.
  6084. (Object::do_dynobj): New function.
  6085. (Object::as_needed_): New data member.
  6086. 2011-05-24 Cary Coutant <ccoutant@google.com>
  6087. * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
  6088. info; adjust display of GOT entries.
  6089. * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
  6090. vector of input objects; remove file_status_.
  6091. (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
  6092. (Sized_incremental_binary::do_process_got_plt): Adjust calls to
  6093. got_plt reader; call target hooks to reserve GOT entries.
  6094. (Output_section_incremental_inputs::set_final_data_size): Adjust size
  6095. of input file info header and GOT info entry.
  6096. (Output_section_incremental_inputs::write_info_blocks): Write dynamic
  6097. relocation info.
  6098. (Got_plt_view_info::got_descriptor): Remove.
  6099. (Got_plt_view_info::sym_index): New data member.
  6100. (Got_plt_view_info::input_index): New data member.
  6101. (Local_got_offset_visitor::visit): Write input file index.
  6102. (Global_got_offset_visitor::visit): Write 0 for input file index.
  6103. (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
  6104. with sym_index and input_index.
  6105. (Output_section_incremental_inputs::write_got_plt): Adjust size of
  6106. incremental info GOT entry; replace got_descriptor with input_index.
  6107. (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
  6108. map from input file index to object.
  6109. (Sized_relobj_incr::do_layout): Replace direct data member reference
  6110. with accessor function.
  6111. (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
  6112. * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
  6113. Adjust size of input file info header.
  6114. (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
  6115. (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
  6116. (Incremental_input_entry_reader::get_input_section): Adjust size of
  6117. input file info header.
  6118. (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
  6119. of incremental info GOT entry.
  6120. (Incremental_got_plt_reader::get_got_desc): Remove.
  6121. (Incremental_got_plt_reader::get_got_symndx): New function.
  6122. (Incremental_got_plt_reader::get_got_input_index): New function.
  6123. (Sized_incremental_binary::Sized_incremental_binary): Remove
  6124. file_status_; add input_objects_.
  6125. (Sized_incremental_binary::~Sized_incremental_binary): Remove.
  6126. (Sized_incremental_binary::set_file_is_unchanged): Remove.
  6127. (Sized_incremental_binary::file_is_unchanged): Remove.
  6128. (Sized_incremental_binary::set_input_object): New function.
  6129. (Sized_incremental_binary::input_object): New function.
  6130. (Sized_incremental_binary::file_status_): Remove.
  6131. (Sized_incremental_binary::input_objects_): New data member.
  6132. (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
  6133. references.
  6134. (Sized_relobj_incr::invalid_address): Move to base class.
  6135. (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
  6136. class.
  6137. (Sized_relobj_incr::do_output_section_offset): Likewise.
  6138. (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
  6139. (Sized_relobj_incr::section_offsets_): Likewise.
  6140. * object.cc (Sized_relobj::do_for_all_local_got_entries): New
  6141. function.
  6142. (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
  6143. (Sized_relobj_file::layout_section): Replace refs to section_offsets_
  6144. with accessor function.
  6145. (Sized_relobj_file::do_layout): Likewise.
  6146. (Sized_relobj_file::do_layout_deferred_sections): Likewise.
  6147. (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
  6148. (Sized_relobj_file::compute_final_local_value): Replace refs to
  6149. section_offsets_ with accessor function.
  6150. (Sized_relobj_file::do_finalize_local_symbols): Likewise.
  6151. * object.h (Relobj::Relobj): Initialize new data members.
  6152. (Relobj::add_dyn_reloc): New function.
  6153. (Relobj::first_dyn_reloc): New function.
  6154. (Relobj::dyn_reloc_count): New function.
  6155. (Relobj::first_dyn_reloc_): New data member.
  6156. (Relobj::dyn_reloc_count_): New data member.
  6157. (Sized_relobj): Rename Sized_relobj_base to this; adjust all
  6158. references.
  6159. (Sized_relobj::Address): New typedef.
  6160. (Sized_relobj::invalid_address): Move here from child class.
  6161. (Sized_relobj::Sized_relobj): Initialize new data members.
  6162. (Sized_relobj::sized_relobj): New function.
  6163. (Sized_relobj::is_output_section_offset_invalid): Move here from
  6164. child class.
  6165. (Sized_relobj::get_output_section_offset): Likewise.
  6166. (Sized_relobj::local_has_got_offset): Likewise.
  6167. (Sized_relobj::local_got_offset): Likewise.
  6168. (Sized_relobj::set_local_got_offset): Likewise.
  6169. (Sized_relobj::do_for_all_local_got_entries): Likewise.
  6170. (Sized_relobj::clear_got_offsets): New function.
  6171. (Sized_relobj::section_offsets): Move here from child class.
  6172. (Sized_relobj::do_output_section_offset): Likewise.
  6173. (Sized_relobj::do_set_section_offset): Likewise.
  6174. (Sized_relobj::Local_got_offsets): Likewise.
  6175. (Sized_relobj::local_got_offsets_): Likewise.
  6176. (Sized_relobj::section_offsets_): Likewise.
  6177. (Sized_relobj_file): Rename Sized_relobj to this; adjust all
  6178. references.
  6179. (Sized_relobj_file::is_output_section_offset_invalid): Move to base
  6180. class.
  6181. (Sized_relobj_file::sized_relobj): New function
  6182. (Sized_relobj_file::local_has_got_offset): Move to base class.
  6183. (Sized_relobj_file::local_got_offset): Likewise.
  6184. (Sized_relobj_file::set_local_got_offset): Likewise.
  6185. (Sized_relobj_file::get_output_section_offset): Likewise.
  6186. (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
  6187. (Sized_relobj_file::do_output_section_offset): Likewise.
  6188. (Sized_relobj_file::do_set_section_offset): Likewise.
  6189. (Sized_relobj_file::Local_got_offsets): Likewise.
  6190. (Sized_relobj_file::local_got_offsets_): Likewise.
  6191. (Sized_relobj_file::section_offsets_): Likewise.
  6192. * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
  6193. (all constructors).
  6194. (set_needs_dynsym_index): Convert relobj to derived class pointer.
  6195. (Output_reloc::get_symbol_index): Likewise.
  6196. (Output_reloc::local_section_offset): Likewise.
  6197. (Output_reloc::get_address): Likewise.
  6198. (Output_reloc::symbol_value): Likewise.
  6199. (Output_data_got::reserve_slot): Move to class definition.
  6200. (Output_data_got::reserve_local): New function.
  6201. (Output_data_got::reserve_slot_for_global): Remove.
  6202. (Output_data_got::reserve_global): New function.
  6203. * output.h (Output_reloc::Output_reloc): Adjust type of relobj
  6204. (all constructors, two instantiations).
  6205. (Output_reloc::get_relobj): New function (two instantiations).
  6206. (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
  6207. (Output_data_reloc_base::add): Convert relobj to derived class pointer.
  6208. (Output_data_reloc::add_global): Adjust type of relobj.
  6209. (Output_data_reloc::add_global_relative): Likewise.
  6210. (Output_data_reloc::add_symbolless_global_addend): Likewise.
  6211. (Output_data_reloc::add_local): Likewise.
  6212. (Output_data_reloc::add_local_relative): Likewise.
  6213. (Output_data_reloc::add_symbolless_local_addend): Likewise.
  6214. (Output_data_reloc::add_local_section): Likewise.
  6215. (Output_data_reloc::add_output_section): Likewise.
  6216. (Output_data_reloc::add_absolute): Likewise.
  6217. (Output_data_reloc::add_target_specific): Likewise.
  6218. (Output_data_got::reserve_slot): Move definition here.
  6219. (Output_data_got::reserve_local): New function.
  6220. (Output_data_got::reserve_global): New function.
  6221. * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
  6222. section_offsets_ with accessor function.
  6223. (Sized_relobj_file::write_sections): Likewise.
  6224. (Sized_relobj_file::do_relocate_sections): Likewise.
  6225. * target.h (Sized_target::reserve_local_got_entry): New function.
  6226. (Sized_target::reserve_global_got_entry): New function.
  6227. * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
  6228. (Target_x86_64::reserve_global_got_entry): New function.
  6229. (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
  6230. 2011-05-23 Cary Coutant <ccoutant@google.com>
  6231. * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
  6232. * incremental-dump.cc (dump_incremental_inputs): Mask high-order
  6233. bit when checking got_type.
  6234. * incremental.cc (Sized_incremental_binary::setup_readers):
  6235. Store symbol table and string table locations; initialize bit vector
  6236. of file status flags.
  6237. (Sized_incremental_binary::do_reserve_layout): Set bit flag for
  6238. unchanged files.
  6239. (Sized_incremental_binary::do_process_got_plt): New function.
  6240. (Sized_incremental_binary::get_symtab_view): Use stored locations.
  6241. (Output_section_incremental_inputs::set_final_data_size): Record
  6242. file index for each input file.
  6243. (Output_section_incremental_inputs::write_got_plt): Store file index
  6244. instead of input entry offset for each GOT entry.
  6245. * incremental.h
  6246. (Incremental_input_entry::Incremental_input_entry): Initialize new
  6247. data member.
  6248. (Incremental_input_entry::set_offset): Store file index.
  6249. (Incremental_input_entry::get_file_index): New function.
  6250. (Incremental_input_entry::file_index_): New data member.
  6251. (Incremental_binary::process_got_plt): New function.
  6252. (Incremental_binary::do_process_got_plt): New function.
  6253. (Sized_incremental_binary::Sized_incremental_binary): Initialize new
  6254. data members.
  6255. (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
  6256. (Sized_incremental_binary::set_file_is_unchanged): New function.
  6257. (Sized_incremental_binary::file_is_unchanged): New function.
  6258. (Sized_incremental_binary::do_process_got_plt): New function.
  6259. (Sized_incremental_binary::file_status_): New data member.
  6260. (Sized_incremental_binary::main_symtab_loc_): New data member.
  6261. (Sized_incremental_binary::main_strtab_loc_): New data member.
  6262. * output.cc (Output_data_got::Got_entry::write): Add case
  6263. RESERVED_CODE.
  6264. (Output_data_got::add_global): Call add_got_entry.
  6265. (Output_data_got::add_global_plt): Likewise.
  6266. (Output_data_got::add_global_with_rel): Likewise.
  6267. (Output_data_got::add_global_with_rela): Likewise.
  6268. (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
  6269. (Output_data_got::add_global_pair_with_rela): Likewise.
  6270. (Output_data_got::add_local): Call add_got_entry.
  6271. (Output_data_got::add_local_plt): Likewise.
  6272. (Output_data_got::add_local_with_rel): Likewise.
  6273. (Output_data_got::add_local_with_rela): Likewise.
  6274. (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
  6275. (Output_data_got::add_local_pair_with_rela): Likewise.
  6276. (Output_data_got::reserve_slot): New function.
  6277. (Output_data_got::reserve_slot_for_global): New function.
  6278. (Output_data_got::add_got_entry): New function.
  6279. (Output_data_got::add_got_entry_pair): New function.
  6280. (Output_section::add_output_section_data): Edit FIXME.
  6281. * output.h
  6282. (Output_section_data_build::Output_section_data_build): New
  6283. constructor with size parameter.
  6284. (Output_data_space::Output_data_space): Likewise.
  6285. (Output_data_got::Output_data_got): Initialize new data member; new
  6286. constructor with size parameter.
  6287. (Output_data_got::add_constant): Call add_got_entry.
  6288. (Output_data_got::reserve_slot): New function.
  6289. (Output_data_got::reserve_slot_for_global): New function.
  6290. (class Output_data_got::Got_entry): Add RESERVED_CODE.
  6291. (Output_data_got::add_got_entry): New function.
  6292. (Output_data_got::add_got_entry_pair): New function.
  6293. (Output_data_got::free_list_): New data member.
  6294. * target.h (Sized_target::init_got_plt_for_update): New function.
  6295. (Sized_target::register_global_plt_entry): New function.
  6296. * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
  6297. Initialize new data member; call init; add constructor with PLT count.
  6298. (Output_data_plt_x86_64::init): New function.
  6299. (Output_data_plt_x86_64::add_relocation): New function.
  6300. (Output_data_plt_x86_64::reserve_slot): New function.
  6301. (Output_data_plt_x86_64::free_list_): New data member.
  6302. (Target_x86_64::init_got_plt_for_update): New function.
  6303. (Target_x86_64::register_global_plt_entry): New function.
  6304. (Output_data_plt_x86_64::add_entry): Allocate from free list for
  6305. incremental updates.
  6306. (Output_data_plt_x86_64::add_relocation): New function.
  6307. * testsuite/object_unittest.cc (Object_test): Set default options.
  6308. 2011-05-16 Ian Lance Taylor <iant@google.com>
  6309. * options.h (class General_options): Make -i a synonym for -r.
  6310. 2011-05-16 Ian Lance Taylor <iant@google.com>
  6311. * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
  6312. 2011-05-10 Cary Coutant <ccoutant@google.com>
  6313. * object.cc (Sized_relobj::do_count_local_symbols): Check for
  6314. strip_all (-s).
  6315. 2011-05-06 Ian Lance Taylor <iant@google.com>
  6316. * layout.cc (Layout::layout): If the output section flags change,
  6317. update the ordering.
  6318. 2011-04-25 Cary Coutant <ccoutant@google.com>
  6319. * incremental-dump.cc (dump_incremental_inputs): Print local
  6320. symbol info for each input file.
  6321. * incremental.cc
  6322. (Output_section_incremental_inputs::set_final_data_size): Add local
  6323. symbol info to input file entries in incremental info.
  6324. (Output_section_incremental_inputs::write_info_blocks): Likewise.
  6325. (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
  6326. (Sized_incr_relobj::do_add_symbols): Cosmetic change.
  6327. (Sized_incr_relobj::do_count_local_symbols): Replace stub with
  6328. implementation.
  6329. (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
  6330. (Sized_incr_relobj::do_relocate): Write the local symbols.
  6331. (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
  6332. * incremental.h (Incremental_inputs_reader::get_symbol_offset):
  6333. Adjust size of input file header.
  6334. (Incremental_inputs_reader::get_local_symbol_offset): New function.
  6335. (Incremental_inputs_reader::get_local_symbol_count): New function.
  6336. (Incremental_inputs_reader::get_input_section): Adjust size of input
  6337. file header.
  6338. (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
  6339. (Sized_incr_relobj::This): New typedef.
  6340. (Sized_incr_relobj::sym_size): New const data member.
  6341. (Sized_incr_relobj::Local_symbol): New struct.
  6342. (Sized_incr_relobj::do_output_local_symbol_count): New function.
  6343. (Sized_incr_relobj::do_local_symbol_offset): New function.
  6344. (Sized_incr_relobj::local_symbol_count_): New data member.
  6345. (Sized_incr_relobj::output_local_dynsym_count_): New data member.
  6346. (Sized_incr_relobj::local_symbol_index_): New data member.
  6347. (Sized_incr_relobj::local_symbol_offset_): New data member.
  6348. (Sized_incr_relobj::local_dynsym_offset_): New data member.
  6349. (Sized_incr_relobj::local_symbols_): New data member.
  6350. * object.h (Relobj::output_local_symbol_count): New function.
  6351. (Relobj::local_symbol_offset): New function.
  6352. (Relobj::do_output_local_symbol_count): New function.
  6353. (Relobj::do_local_symbol_offset): New function.
  6354. (Sized_relobj::do_output_local_symbol_count): New function.
  6355. (Sized_relobj::do_local_symbol_offset): New function.
  6356. 2011-04-22 Vladimir Simonov <sv@sw.ru>
  6357. * descriptors.cc (set_close_on_exec): New function.
  6358. (Descriptors::open): Use set_close_on_exec.
  6359. * output.cc (S_ISLNK): Define if not defined.
  6360. 2011-04-22 Cary Coutant <ccoutant@google.com>
  6361. * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
  6362. global symbol map.
  6363. (Sized_incremental_binary::do_apply_incremental_relocs): New function.
  6364. (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
  6365. (Sized_incr_relobj::do_relocate): Remap section indices in incremental
  6366. relocations.
  6367. (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
  6368. (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
  6369. (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
  6370. * incremental.h
  6371. (Incremental_inputs_reader::global_symbol_reader_at_offset): New
  6372. function.
  6373. (Incremental_binary::apply_incremental_relocs): New function.
  6374. (Incremental_binary::do_apply_incremental_relocs): New function.
  6375. (Sized_incremental_binary::Sized_incremental_binary): Initialize new
  6376. data member.
  6377. (Sized_incremental_binary::add_global_symbol): New function.
  6378. (Sized_incremental_binary::global_symbol): New function.
  6379. (Sized_incremental_binary::do_apply_incremental_relocs): New function.
  6380. (Sized_incremental_binary::symbol_map_): New data member.
  6381. * layout.cc (Layout_task_runner::run): Apply incremental relocations.
  6382. * target.h (Sized_target::apply_relocation): New function.
  6383. * target-reloc.h (apply_relocation): New function.
  6384. * x86_64.cc (Target_x86_64::apply_relocation): New function.
  6385. 2011-04-22 Doug Kwan <dougkwan@google.com>
  6386. * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
  6387. flag of a SHT_ARM_EXIDX section.
  6388. * testsuite/Makefile.am (arm_exidx_test): New test rules.
  6389. * testsuite/Makefile.in: Regenerate.
  6390. * testsuite/arm_exidx_test.s: New file.
  6391. * testsuite/arm_exidx_test.sh: Same.
  6392. 2011-04-20 Cary Coutant <ccoutant@google.com>
  6393. PR gold/12689
  6394. * archive.h (Incremental_archive_entry::Archive_member):
  6395. Initialize arg_serial_ (second constructor).
  6396. 2011-04-17 Ian Lance Taylor <iant@google.com>
  6397. * object.cc (Relocate_info::location): Simplify location string.
  6398. * errors.cc (Errors::error_at_location): Don't print program
  6399. name.
  6400. (Errors::warning_at_location): Likewise.
  6401. (Errors::undefined_symbol): Likewise.
  6402. * testsuite/debug_msg.sh: Update accordingly.
  6403. 2011-04-14 Cary Coutant <ccoutant@google.com>
  6404. * layout.cc (Layout::symtab_section_offset): New function.
  6405. * layout.h (Layout::symtab_section_offset): New function.
  6406. * reloc.cc (Sized_relobj::do_relocate): Call it.
  6407. 2011-04-12 Ian Lance Taylor <iant@google.com>
  6408. * configure.ac: Check for sys/mman.h and mmap. Check for mremap
  6409. with MREMAP_MAYMOVE.
  6410. * output.h (class Output_file): Add map_is_allocated_ field.
  6411. * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
  6412. not available, provide stubs. If mremap is not available, #define
  6413. it to gold_mremap.
  6414. (MREMAP_MAYMOVE): Define if not defined.
  6415. (Output_file::Output_file): Initialize map_is_allocated_.
  6416. (Output_file::resize): Check map_is_allocated_.
  6417. (Output_file::map_anonymous): If mmap fails, use malloc.
  6418. (Output_file::unmap): Don't do anything for an anonymous map.
  6419. * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
  6420. is not available, provide stubs.
  6421. (File_read::View::~View): Use free rather than delete[].
  6422. (File_read::make_view): Use malloc rather than new[]. If mmap
  6423. fails, use malloc.
  6424. (File_read::find_or_make_view): Use malloc rather than new[].
  6425. * gold.h: Remove HAVE_REMAP code.
  6426. * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
  6427. exists. Rename mremap to gold_mremap. If mmap is not available
  6428. don't do anything.
  6429. * configure, config.in: Rebuild.
  6430. 2011-04-11 Ian Lance Taylor <iant@google.com>
  6431. * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
  6432. initialize local variable v.
  6433. 2011-04-11 Cary Coutant <ccoutant@google.com>
  6434. * archive.cc (Archive::include_member): Adjust call to
  6435. report_object.
  6436. (Add_archive_symbols::run): Track argument serial numbers.
  6437. (Lib_group::include_member): Likewise.
  6438. (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
  6439. * archive.h (Incremental_archive_entry::Archive_member):
  6440. Initialize arg_serial_.
  6441. (Archive_member::arg_serial_): New data member.
  6442. * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
  6443. (Sized_dynobj::do_add_symbols): Track symbols when doing an
  6444. incremental link.
  6445. (Sized_dynobj::do_for_all_local_got_entries): New function.
  6446. * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
  6447. function.
  6448. * fileread.cc (get_mtime): New function.
  6449. * fileread.h (get_mtime): New function.
  6450. * gold.cc (queue_initial_tasks): Check for incremental update.
  6451. (process_incremental_input): New function.
  6452. (queue_middle_tasks): Don't force valid target for incremental
  6453. update.
  6454. * incremental-dump.cc (find_input_containing_global): Adjust
  6455. size of symbol info entry.
  6456. (dump_incremental_inputs): Dump argument serial number and
  6457. in_system_directory flag; bias shndx by 1; print symbol names
  6458. when dumping per-file symbol lists; use new symbol info readers.
  6459. * incremental.cc
  6460. (Output_section_incremental_inputs:update_data_size): New function.
  6461. (Sized_incremental_binary::setup_readers): Setup input readers
  6462. for each input file; build maps for files added from libraries
  6463. and scripts.
  6464. (Sized_incremental_binary::check_input_args): New function.
  6465. (Sized_incremental_binary::do_check_inputs): Build map of argument
  6466. serial numbers to input arguments.
  6467. (Sized_incremental_binary::do_file_has_changed): Rename
  6468. do_file_is_unchanged to this; compare file modification times.
  6469. (Sized_incremental_binary::do_init_layout): New function.
  6470. (Sized_incremental_binary::do_reserve_layout): New function.
  6471. (Sized_incremental_binary::do_get_input_reader): Remove.
  6472. (Sized_incremental_binary::get_symtab_view): New function.
  6473. (Incremental_checker::can_incrementally_link_output_file): Remove.
  6474. (Incremental_inputs::report_command_line): Exclude --debug options.
  6475. (Incremental_inputs::report_archive_begin): Add parameter; track
  6476. argument serial numbers; don't put input file entry for archive
  6477. before archive members.
  6478. (Incremental_inputs::report_archive_end): Put input file entry
  6479. for archive after archive members.
  6480. (Incremental_inputs::report_object): Add parameter; track argument
  6481. serial numbers and in_system_directory flag.
  6482. (Incremental_inputs::report_script): Add parameter; track argument
  6483. serial numbers.
  6484. (Output_section_incremental_inputs::set_final_data_size): Adjust
  6485. size of symbol info entry; check for forwarding symbols.
  6486. (Output_section_incremental_inputs::write_input_files): Write
  6487. in_system_directory flag and argument serial number.
  6488. (Output_section_incremental_inputs::write_info_blocks): Map section
  6489. indices between incremental info and original input file; store
  6490. input section index for each symbol.
  6491. (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
  6492. change operator() to visit().
  6493. (class Global_got_offset_visitor): Likewise.
  6494. (class Global_symbol_visitor_got_plt):
  6495. (Output_section_incremental_inputs::write_got_plt): Use new visitor
  6496. classes.
  6497. (Sized_incr_relobj::Sized_incr_relobj): New constructor.
  6498. (Sized_incr_relobj::do_read_symbols): New function.
  6499. (Sized_incr_relobj::do_layout): New function.
  6500. (Sized_incr_relobj::do_layout_deferred_sections): New function.
  6501. (Sized_incr_relobj::do_add_symbols): New function.
  6502. (Sized_incr_relobj::do_should_include_member): New function.
  6503. (Sized_incr_relobj::do_for_all_global_symbols): New function.
  6504. (Sized_incr_relobj::do_for_all_local_got_entries): New function.
  6505. (Sized_incr_relobj::do_section_size): New function.
  6506. (Sized_incr_relobj::do_section_name): New function.
  6507. (Sized_incr_relobj::do_section_contents): New function.
  6508. (Sized_incr_relobj::do_section_flags): New function.
  6509. (Sized_incr_relobj::do_section_entsize): New function.
  6510. (Sized_incr_relobj::do_section_address): New function.
  6511. (Sized_incr_relobj::do_section_type): New function.
  6512. (Sized_incr_relobj::do_section_link): New function.
  6513. (Sized_incr_relobj::do_section_info): New function.
  6514. (Sized_incr_relobj::do_section_addralign): New function.
  6515. (Sized_incr_relobj::do_initialize_xindex): New function.
  6516. (Sized_incr_relobj::do_get_global_symbol_counts): New function.
  6517. (Sized_incr_relobj::do_read_relocs): New function.
  6518. (Sized_incr_relobj::do_gc_process_relocs): New function.
  6519. (Sized_incr_relobj::do_scan_relocs): New function.
  6520. (Sized_incr_relobj::do_count_local_symbols): New function.
  6521. (Sized_incr_relobj::do_finalize_local_symbols): New function.
  6522. (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
  6523. (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
  6524. (Sized_incr_relobj::do_relocate): New function.
  6525. (Sized_incr_relobj::do_set_section_offset): New function.
  6526. (Sized_incr_dynobj::Sized_incr_dynobj): New function.
  6527. (Sized_incr_dynobj::do_read_symbols): New function.
  6528. (Sized_incr_dynobj::do_layout): New function.
  6529. (Sized_incr_dynobj::do_add_symbols): New function.
  6530. (Sized_incr_dynobj::do_should_include_member): New function.
  6531. (Sized_incr_dynobj::do_for_all_global_symbols): New function.
  6532. (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
  6533. (Sized_incr_dynobj::do_section_size): New function.
  6534. (Sized_incr_dynobj::do_section_name): New function.
  6535. (Sized_incr_dynobj::do_section_contents): New function.
  6536. (Sized_incr_dynobj::do_section_flags): New function.
  6537. (Sized_incr_dynobj::do_section_entsize): New function.
  6538. (Sized_incr_dynobj::do_section_address): New function.
  6539. (Sized_incr_dynobj::do_section_type): New function.
  6540. (Sized_incr_dynobj::do_section_link): New function.
  6541. (Sized_incr_dynobj::do_section_info): New function.
  6542. (Sized_incr_dynobj::do_section_addralign): New function.
  6543. (Sized_incr_dynobj::do_initialize_xindex): New function.
  6544. (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
  6545. (make_sized_incremental_object): New function.
  6546. (Incremental_library::copy_unused_symbols): New function.
  6547. (Incremental_library::do_for_all_unused_symbols): New function.
  6548. * incremental.h (enum Incremental_input_flags): New type.
  6549. (class Incremental_checker): Remove.
  6550. (Incremental_input_entry::Incremental_input_entry): Add argument
  6551. serial number.
  6552. (Incremental_input_entry::arg_serial): New function.
  6553. (Incremental_input_entry::set_is_in_system_directory): New function.
  6554. (Incremental_input_entry::is_in_system_directory): New function.
  6555. (Incremental_input_entry::arg_serial_): New data member.
  6556. (Incremental_input_entry::is_in_system_directory_): New data member.
  6557. (class Script_info): Move here from script.h.
  6558. (Script_info::Script_info): Add filename parameter.
  6559. (Script_info::filename): New function.
  6560. (Script_info::filename_): New data member.
  6561. (Incremental_script_entry::Incremental_script_entry): Add argument
  6562. serial number.
  6563. (Incremental_object_entry::Incremental_object_entry): Likewise.
  6564. (Incremental_object_entry::add_input_section): Build list of input
  6565. sections with map to original shndx.
  6566. (Incremental_object_entry::get_input_section_index): New function.
  6567. (Incremental_object_entry::shndx_): New data member.
  6568. (Incremental_object_entry::name_key_): Rename; adjust all refs.
  6569. (Incremental_object_entry::sh_size_): Rename; adjust all refs.
  6570. (Incremental_archive_entry::Incremental_archive_entry): Add argument
  6571. serial number.
  6572. (Incremental_inputs::report_archive_begin): Likewise.
  6573. (Incremental_inputs::report_object): Likewise.
  6574. (Incremental_inputs::report_script): Likewise.
  6575. (class Incremental_global_symbol_reader): New class.
  6576. (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
  6577. and store flags and input file type.
  6578. (Incremental_input_entry_reader::arg_serial): New function.
  6579. (Incremental_input_entry_reader::type): Extract type from flags.
  6580. (Incremental_input_entry_reader::is_in_system_directory): New function.
  6581. (Incremental_input_entry_reader::get_input_section_count): Call
  6582. accessor function for type.
  6583. (Incremental_input_entry_reader::get_symbol_offset): Call accessor
  6584. function for type; adjust size of global symbol entry.
  6585. (Incremental_input_entry_reader::get_global_symbol_count): Call
  6586. accessor function for type.
  6587. (Incremental_input_entry_reader::get_object_count): Likewise.
  6588. (Incremental_input_entry_reader::get_object_offset): Likewise.
  6589. (Incremental_input_entry_reader::get_member_count): Likewise.
  6590. (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
  6591. (Incremental_input_entry_reader::get_member_offset): Likewise.
  6592. (Incremental_input_entry_reader::get_unused_symbol): Likewise.
  6593. (Incremental_input_entry_reader::Global_symbol_info): Remove.
  6594. (Incremental_input_entry_reader::get_global_symbol_info): Remove.
  6595. (Incremental_input_entry_reader::get_global_symbol_reader): New
  6596. function.
  6597. (Incremental_input_entry_reader::get_output_symbol_index): New
  6598. function.
  6599. (Incremental_input_entry_reader::type_): Remove.
  6600. (Incremental_input_entry_reader::flags_): New data member.
  6601. (Incremental_inputs_reader::input_file_offset): New function.
  6602. (Incremental_inputs_reader::input_file_index): New function.
  6603. (Incremental_inputs_reader::input_file): Call input_file_offset.
  6604. (Incremental_inputs_reader::input_file_at_offset): New function.
  6605. (Incremental_relocs_reader::get_r_type): Reformat.
  6606. (Incremental_relocs_reader::get_r_shndx): Reformat.
  6607. (Incremental_relocs_reader::get_r_offset): Reformat.
  6608. (Incremental_relocs_reader::data): New function.
  6609. (Incremental_binary::Incremental_binary): Initialize new data members.
  6610. (Incremental_binary::check_inputs): Add cmdline parameter.
  6611. (Incremental_binary::file_is_unchanged): Remove.
  6612. (Input_reader::arg_serial): New function.
  6613. (Input_reader::get_unused_symbol_count): New function.
  6614. (Input_reader::get_unused_symbol): New function.
  6615. (Input_reader::do_arg_serial): New function.
  6616. (Input_reader::do_get_unused_symbol_count): New function.
  6617. (Input_reader::do_get_unused_symbol): New function.
  6618. (Incremental_binary::input_file_count): New function.
  6619. (Incremental_binary::get_input_reader): Change signature to use
  6620. index instead of filename.
  6621. (Incremental_binary::file_has_changed): New function.
  6622. (Incremental_binary::get_input_argument): New function.
  6623. (Incremental_binary::get_library): New function.
  6624. (Incremental_binary::get_script_info): New function.
  6625. (Incremental_binary::init_layout): New function.
  6626. (Incremental_binary::reserve_layout): New function.
  6627. (Incremental_binary::output_file): New function.
  6628. (Incremental_binary::do_check_inputs): New function.
  6629. (Incremental_binary::do_file_is_unchanged): Remove.
  6630. (Incremental_binary::do_file_has_changed): New function.
  6631. (Incremental_binary::do_init_layout): New function.
  6632. (Incremental_binary::do_reserve_layout): New function.
  6633. (Incremental_binary::do_input_file_count): New function.
  6634. (Incremental_binary::do_get_input_reader): Change signature.
  6635. (Incremental_binary::input_args_map_): New data member.
  6636. (Incremental_binary::library_map_): New data member.
  6637. (Incremental_binary::script_map_): New data member.
  6638. (Sized_incremental_binary::Sized_incremental_binary): Initialize
  6639. new data members.
  6640. (Sized_incremental_binary::output_section): New function.
  6641. (Sized_incremental_binary::inputs_reader): Add const.
  6642. (Sized_incremental_binary::symtab_reader): Add const.
  6643. (Sized_incremental_binary::relocs_reader): Add const.
  6644. (Sized_incremental_binary::got_plt_reader): Add const.
  6645. (Sized_incremental_binary::get_symtab_view): New function.
  6646. (Sized_incremental_binary::Inputs_reader): New typedef.
  6647. (Sized_incremental_binary::Input_entry_reader): New typedef.
  6648. (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
  6649. (Sized_incremental_binary::do_file_is_unchanged): Remove.
  6650. (Sized_incremental_binary::do_file_has_changed): New function.
  6651. (Sized_incremental_binary::do_init_layout): New function.
  6652. (Sized_incremental_binary::do_reserve_layout): New function.
  6653. (Sized_input_reader::Inputs_reader): Remove.
  6654. (Sized_input_reader::Input_entry_reader): Remove.
  6655. (Sized_input_reader::do_arg_serial): New function.
  6656. (Sized_input_reader::do_get_unused_symbol_count): New function.
  6657. (Sized_input_reader::do_get_unused_symbol): New function.
  6658. (Sized_incremental_binary::do_input_file_count): New function.
  6659. (Sized_incremental_binary::do_get_input_reader): Change signature;
  6660. use index instead of filename.
  6661. (Sized_incremental_binary::section_map_): New data member.
  6662. (Sized_incremental_binary::input_entry_readers_): New data member.
  6663. (class Sized_incr_relobj): New class.
  6664. (class Sized_incr_dynobj): New class.
  6665. (make_sized_incremental_object): New function.
  6666. (class Incremental_library): New class.
  6667. * layout.cc (Free_list::num_lists): New static data member.
  6668. (Free_list::num_nodes): New static data member.
  6669. (Free_list::num_removes): New static data member.
  6670. (Free_list::num_remove_visits): New static data member.
  6671. (Free_list::num_allocates): New static data member.
  6672. (Free_list::num_allocate_visits): New static data member.
  6673. (Free_list::init): New function.
  6674. (Free_list::remove): New function.
  6675. (Free_list::allocate): New function.
  6676. (Free_list::dump): New function.
  6677. (Free_list::print_stats): New function.
  6678. (Layout_task_runner::run): Resize output file for incremental updates.
  6679. (Layout::Layout): Initialize new data members.
  6680. (Layout::set_incremental_base): New function.
  6681. (Layout::init_fixed_output_section): New function.
  6682. (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
  6683. incremental updates.
  6684. (Layout::create_gold_note): Do not create gold note section for
  6685. incremental updates.
  6686. (Layout::set_segment_offsets): Do not recalculate RELRO alignment
  6687. for incremental updates.
  6688. (Layout::set_section_offsets): For incremental updates, allocate space
  6689. from free list.
  6690. (Layout::create_symtab_sections): Layout with offsets relative to
  6691. start of section; for incremental updates, allocate space from free
  6692. list.
  6693. (Layout::create_shdrs): For incremental updates, allocate space from
  6694. free list.
  6695. (Layout::finish_dynamic_section): For incremental updates, do not
  6696. check --as-needed (fixed in subsequent patch).
  6697. * layout.h (class Free_list): New class.
  6698. (Layout::set_incremental_base): New function.
  6699. (Layout::incremental_base): New function.
  6700. (Layout::init_fixed_output_section): New function.
  6701. (Layout::allocate): New function.
  6702. (Layout::incremental_base_): New data member.
  6703. (Layout::free_list_): New data member.
  6704. * main.cc (main): Print Free_list statistics.
  6705. * object.cc (Relobj::finalize_incremental_relocs): Add
  6706. clear_counts parameter; clear counts only when clear_counts is set.
  6707. (Sized_relobj::Sized_relobj): Initialize new base class.
  6708. (Sized_relobj::do_layout): Don't report special sections.
  6709. (Sized_relobj::do_for_all_local_got_entries): New function.
  6710. (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
  6711. symtab_off to all symbol table offsets.
  6712. (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
  6713. * object.h (class Got_offset_list): Move to top of file.
  6714. (Object::Object): Allow case where input_file == NULL.
  6715. (Object::~Object): Likewise.
  6716. (Object::input_file): Assert that input_file != NULL.
  6717. (Object::lock): Allow case where input_file == NULL.
  6718. (Object::unlock): Likewise.
  6719. (Object::is_locked): Likewise.
  6720. (Object::token): Likewise.
  6721. (Object::release): Likewise.
  6722. (Object::is_incremental): New function.
  6723. (Object::get_mtime): New function.
  6724. (Object::for_all_local_got_entries): New function.
  6725. (Object::clear_view_cache_marks): Allow case where input_file == NULL.
  6726. (Object::set_is_in_system_directory): New function.
  6727. (Object::is_in_system_directory): New function.
  6728. (Object::do_is_incremental): New function.
  6729. (Object::do_get_mtime): New function.
  6730. (Object::do_for_all_local_got_entries): New function.
  6731. (Object::is_in_system_directory_): New data member.
  6732. (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
  6733. (class Sized_relobj_base): New class.
  6734. (class Sized_relobj): Derive from Sized_relobj_base.
  6735. (class Sized_relobj::Symbols): Redeclare from base class.
  6736. (class Sized_relobj::local_got_offset_list): Remove.
  6737. (class Sized_relobj::Output_sections): Redeclare from base class.
  6738. (class Sized_relobj::do_for_all_local_got_entries): New function.
  6739. (class Sized_relobj::write_local_symbols): Add offset parameter.
  6740. (class Sized_relobj::local_symbol_offset_): Update comment.
  6741. (class Sized_relobj::local_dynsym_offset_): Update comment.
  6742. * options.cc (Input_arguments::add_file): Remove const.
  6743. * options.h (Input_file_argument::Input_file_argument):
  6744. Initialize arg_serial_ (all constructors).
  6745. (Input_file_argument::set_arg_serial): New function.
  6746. (Input_file_argument::arg_serial): New function.
  6747. (Input_file_argument::arg_serial_): New data member.
  6748. (Input_arguments::Input_arguments): Initialize file_count_.
  6749. (Input_arguments::add_file): Remove const.
  6750. (Input_arguments::number_of_input_files): New function.
  6751. (Input_arguments::file_count_): New data member.
  6752. (Command_line::number_of_input_files): Call
  6753. Input_arguments::number_of_input_files.
  6754. * output.cc (Output_segment_headers::Output_segment_headers):
  6755. Set current size.
  6756. (Output_section::Input_section::current_data_size): New function.
  6757. (Output_section::Output_section): Initialize new data members.
  6758. (Output_section::add_input_section): Don't do merge sections for
  6759. an incremental link; allocate space from free list for an
  6760. incremental update.
  6761. (Output_section::add_output_section_data): Allocate space from
  6762. free list for an incremental update.
  6763. (Output_section::update_data_size): New function.
  6764. (Output_section::set_fixed_layout): New function.
  6765. (Output_section::reserve): New function.
  6766. (Output_segment::set_section_addresses): Remove const.
  6767. (Output_segment::set_section_list_addresses): Remove const; allocate
  6768. space from free list for an incremental update.
  6769. (Output_segment::set_offset): Adjust size of RELRO segment for an
  6770. incremental update.
  6771. * output.h (Output_data::current_data_size): Move here from
  6772. child classes.
  6773. (Output_data::pre_finalize_data_size): New function.
  6774. (Output_data::update_data_size): New function.
  6775. (Output_section_headers::update_data_size): new function.
  6776. (Output_section_data_build::current_data_size): Move to Output_data.
  6777. (Output_data_strtab::update_data_size): New function.
  6778. (Output_section::current_data_size): Move to Output_data.
  6779. (Output_section::set_fixed_layout): New function.
  6780. (Output_section::has_fixed_layout): New function.
  6781. (Output_section::reserve): New function.
  6782. (Output_section::update_data_size): New function.
  6783. (Output_section::has_fixed_layout_): New data member.
  6784. (Output_section::free_list_): New data member.
  6785. (Output_segment::set_section_addresses): Remove const.
  6786. (Output_segment::set_section_list_addresses): Remove const.
  6787. * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
  6788. New function.
  6789. * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
  6790. New function.
  6791. * readsyms.cc (Read_symbols::do_read_symbols): Add library
  6792. parameter when calling Add_symbols constructor; store argument
  6793. serial number for members of a lib group.
  6794. (Add_symbols::locks): Allow case where token == NULL.
  6795. (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
  6796. (Read_member::~Read_member): New function.
  6797. (Read_member::is_runnable): New function.
  6798. (Read_member::locks): New function.
  6799. (Read_member::run): New function.
  6800. (Check_script::~Check_script): New function.
  6801. (Check_script::is_runnable): New function.
  6802. (Check_script::locks): New function.
  6803. (Check_script::run): New function.
  6804. (Check_library::~Check_library): New function.
  6805. (Check_library::is_runnable): New function.
  6806. (Check_library::locks): New function.
  6807. (Check_library::run): New function.
  6808. * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
  6809. (Add_symbols::library_): New data member.
  6810. (class Read_member): New class.
  6811. (class Check_script): New class.
  6812. (class Check_library): New class.
  6813. * reloc.cc (Read_relocs::is_runnable): Allow case where
  6814. token == NULL.
  6815. (Read_relocs::locks): Likewise.
  6816. (Scan_relocs::locks): Likewise.
  6817. (Relocate_task::locks): Likewise.
  6818. (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
  6819. to clear counters.
  6820. (Sized_relobj::incremental_relocs_scan): Fix comment.
  6821. (Sized_relobj::do_relocate): Pass output file offset to
  6822. write_local_symbols.
  6823. (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
  6824. from class declaration.
  6825. * script.cc (read_input_script): Allocate Script_info; pass
  6826. argument serial number to report_script.
  6827. * script.h (class Script_info): Move to incremental.h.
  6828. * symtab.cc (Symbol_table::add_from_incrobj): New function.
  6829. * symtab.h (Symbol_table::add_from_incrobj): New function.
  6830. (Symbol_table::set_file_offset): New function.
  6831. 2011-04-05 Cary Coutant <ccoutant@google.com>
  6832. * incremental-dump.cc (dump_incremental_inputs): Change signature
  6833. to take a Sized_incremental_binary; change caller. Use readers
  6834. in Sized_incremental_binary.
  6835. * incremental.cc
  6836. (Sized_incremental_binary::find_incremental_inputs_sections):
  6837. Rename do_find_incremental_inputs_sections to this.
  6838. (Sized_incremental_binary::setup_readers): New function.
  6839. (Sized_incremental_binary::do_check_inputs): Check
  6840. has_incremental_info_ flag; move setup code to setup_readers;
  6841. use input readers.
  6842. (Sized_incremental_binary::do_file_is_unchanged): New function.
  6843. (Sized_incremental_binary::do_get_input_reader): New function.
  6844. * incremental.h (class Incremental_binary): Move to end of file.
  6845. (Incremental_binary::file_is_unchanged): New function.
  6846. (Incremental_binary::do_file_is_unchanged): New function.
  6847. (Incremental_binary::Input_reader): New class.
  6848. (Incremental_binary::get_input_reader): New function.
  6849. (class Sized_incremental_binary): Move to end of file.
  6850. (Sized_incremental_binary::Sized_incremental_binary): Setup the
  6851. input section reader classes.
  6852. (Sized_incremental_binary::has_incremental_info): New function.
  6853. (Sized_incremental_binary::inputs_reader): New function.
  6854. (Sized_incremental_binary::symtab_reader): New function.
  6855. (Sized_incremental_binary::relocs_reader): New function.
  6856. (Sized_incremental_binary::got_plt_reader): New function.
  6857. (Sized_incremental_binary::do_file_is_unchanged): New function.
  6858. (Sized_incremental_binary::Sized_input_reader): New class.
  6859. (Sized_incremental_binary::get_input_reader): New function.
  6860. (Sized_incremental_binary::find_incremental_inputs_sections):
  6861. Rename do_find_incremental_inputs_sections to this.
  6862. (Sized_incremental_binary::setup_readers): New function.
  6863. (Sized_incremental_binary::has_incremental_info_): New data member.
  6864. (Sized_incremental_binary::inputs_reader_): New data member.
  6865. (Sized_incremental_binary::symtab_reader_): New data member.
  6866. (Sized_incremental_binary::relocs_reader_): New data member.
  6867. (Sized_incremental_binary::got_plt_reader_): New data member.
  6868. (Sized_incremental_binary::current_input_file_): New data member.
  6869. 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
  6870. PR gold/12640
  6871. * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
  6872. violation.
  6873. 2011-03-30 Cary Coutant <ccoutant@google.com>
  6874. * archive.cc (Archive::include_member): Adjust call to report_object.
  6875. (Add_archive_symbols::run): Add script_info to call to
  6876. report_archive_begin.
  6877. (Lib_group::include_member): Adjust call to report_object.
  6878. (Add_lib_group_symbols::run): Adjust call to report_object.
  6879. * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
  6880. blocks. Add object count for script input files.
  6881. * incremental.cc (Incremental_inputs::report_archive_begin): Add
  6882. script_info parameter; change all callers.
  6883. (Incremental_inputs::report_object): Add script_info parameter;
  6884. change all callers.
  6885. (Incremental_inputs::report_script): Store backpointer to
  6886. incremental info entry.
  6887. (Output_section_incremental_inputs::set_final_data_size): Record
  6888. additional information for scripts.
  6889. (Output_section_incremental_inputs::write_info_blocks): Likewise.
  6890. * incremental.h (Incremental_script_entry::add_object): New function.
  6891. (Incremental_script_entry::get_object_count): New function.
  6892. (Incremental_script_entry::get_object): New function.
  6893. (Incremental_script_entry::objects_): New data member; adjust
  6894. constructor.
  6895. (Incremental_inputs::report_archive_begin): Add script_info parameter.
  6896. (Incremental_inputs::report_object): Add script_info parameter.
  6897. (Incremental_inputs_reader::get_object_count): New function.
  6898. (Incremental_inputs_reader::get_object_offset): New function.
  6899. * options.cc (Input_arguments::add_file): Return reference to
  6900. new input argument.
  6901. * options.h (Input_argument::set_script_info): New function.
  6902. (Input_argument::script_info): New function.
  6903. (Input_argument::script_info_): New data member; adjust all
  6904. constructors.
  6905. (Input_file_group::add_file): Return reference to new input argument.
  6906. (Input_file_lib::add_file): Likewise.
  6907. (Input_arguments::add_file): Likewise.
  6908. * readsyms.cc (Add_symbols::run): Adjust call to report_object.
  6909. * script.cc (Parser_closure::Parser_closure): Add script_info
  6910. parameter; adjust all callers.
  6911. (Parser_closure::script_info): New function.
  6912. (Parser_closure::script_info_): New data member.
  6913. (read_input_script): Report scripts earlier to incremental info.
  6914. (script_add_file): Set script_info in Input_argument.
  6915. (script_add_library): Likewise.
  6916. * script.h (Script_options::Script_info): Rewrite class.
  6917. 2011-03-29 Cary Coutant <ccoutant@google.com>
  6918. * archive.cc (Library_base::should_include_member): Move
  6919. method here from class Archive.
  6920. (Archive::Archive): Initialize base class.
  6921. (Archive::should_include_member): Move to base class.
  6922. (Archive::do_for_all_unused_symbols): New function.
  6923. (Add_archive_symbols::run): Remove redundant access to
  6924. incremental_inputs.
  6925. (Lib_group::Lib_group): Initialize base class.
  6926. (Lib_group::do_filename): New function.
  6927. (Lib_group::include_member): Pass pointer to Lib_group to
  6928. report_object.
  6929. (Lib_group::do_for_all_unused_symbols): New function.
  6930. (Add_lib_group_symbols::run): Report archive information for
  6931. incremental links.
  6932. * archive.h (class Library_base): New base class.
  6933. (class Archive): Derive from Library_base.
  6934. (Archive::filename): Move to base class.
  6935. (Archive::set_incremental_info): Likewise.
  6936. (Archive::incremental_info): Likewise.
  6937. (Archive::Should_include): Likewise.
  6938. (Archive::should_include_member): Likewise.
  6939. (Archive::Armap_entry): Remove.
  6940. (Archive::Unused_symbol_iterator): Remove.
  6941. (Archive::unused_symbols_begin): Remove.
  6942. (Archive::unused_symbols_end): Remove.
  6943. (Archive::do_filename): New function.
  6944. (Archive::do_get_mtime): New function.
  6945. (Archive::do_for_all_unused_symbols): New function.
  6946. (Archive::task_): Move to base class.
  6947. (Archive::incremental_info_): Likewise.
  6948. (class Lib_group): Derive from Library_base.
  6949. (Lib_group::do_filename): New function.
  6950. (Lib_group::do_get_mtime): New function.
  6951. (Lib_group::do_for_all_unused_symbols): New function.
  6952. (Lib_group::task_): Move to base class.
  6953. * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
  6954. function.
  6955. * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
  6956. function.
  6957. * incremental.cc (Incremental_inputs::report_archive_begin):
  6958. Use Library_base; call library's get_mtime; add incremental inputs
  6959. entry before members.
  6960. (class Unused_symbol_visitor): New class.
  6961. (Incremental_inputs::report_archive_end): Use Library_base; use
  6962. visitor class to record unused symbols; don't add incremental inputs
  6963. entry after members.
  6964. (Incremental_inputs::report_object): Use Library_base.
  6965. * incremental.h
  6966. (Incremental_archive_entry::Incremental_archive_entry): Remove
  6967. unused Archive parameter.
  6968. (Incremental_inputs::report_archive_begin): Use Library_base.
  6969. (Incremental_inputs::report_archive_end): Likewise.
  6970. (Incremental_inputs::report_object): Likewise.
  6971. * object.cc (Sized_relobj::do_for_all_global_symbols): New
  6972. function.
  6973. * object.h (Object::for_all_global_symbols): New function.
  6974. (Object::do_for_all_global_symbols): New function.
  6975. (Sized_relobj::do_for_all_global_symbols): New function.
  6976. * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
  6977. function.
  6978. * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
  6979. function.
  6980. 2011-03-27 Ian Lance Taylor <iant@google.com>
  6981. * archive.cc (Archive::interpret_header): Return -1 if something
  6982. goes wrong. Change callers accordingly.
  6983. 2011-03-25 Cary Coutant <ccoutant@google.com>
  6984. * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
  6985. * testsuite/Makefile.in: Regenerate.
  6986. 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
  6987. * plugin.cc (get_view): New.
  6988. (Plugin::load): Pass get_view to the plugin.
  6989. (Plugin_manager::get_view): New.
  6990. 2011-03-21 Ian Lance Taylor <iant@google.com>
  6991. * testsuite/final_layout.sh: Rewrite to not use dc.
  6992. * testsuite/relro_test.sh: Fail if dc is not present.
  6993. 2011-03-21 Sriraman Tallam <tmsriram@google.com>
  6994. * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
  6995. Change == to -eq.
  6996. * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
  6997. * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
  6998. Change == to -eq.
  6999. * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
  7000. * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
  7001. 2011-03-14 Ian Lance Taylor <iant@google.com>
  7002. * script-sections.cc (Sort_output_sections::script_compare):
  7003. Rename from is_before, change return type.
  7004. (Sort_output_sections::operator()): Adjust accordingly.
  7005. 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
  7006. PR gold/12572
  7007. * testsuite/odr_violation2.cc: Add comment to make all error line
  7008. numbers double digits.
  7009. * testsuite/debug_msg.sh: Adjust expected errors.
  7010. 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
  7011. * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
  7012. but mark earlier ones as non-canonical
  7013. (offset_to_iterator): Update search target and example
  7014. (do_addr2line): Return extra lines in a vector*
  7015. (format_file_lineno): Extract from do_addr2line
  7016. (one_addr2line): Add vector* out-param
  7017. * dwarf_reader.h (Offset_to_lineno_entry): New field recording
  7018. when a lineno entry appeared last for its instruction
  7019. (Dwarf_line_info): Add vector* out-param
  7020. * object.cc (Relocate_info): Pass NULL for the vector* out-param
  7021. * symtab.cc (Odr_violation_compare): Include the lineno in the
  7022. comparison again.
  7023. (linenos_from_loc): New. Combine the canonical line for an
  7024. address with its other lines.
  7025. (True_if_intersect): New. Helper functor to make
  7026. std::set_intersection a query.
  7027. (detect_odr_violations): Compare sets of lines instead of just
  7028. one line for each function. This became less deterministic, but
  7029. has fewer false positives.
  7030. * symtab.h: Declarations.
  7031. * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
  7032. mix an optimized and non-optimized object in the same binary
  7033. (odr_violation2.so): Same.
  7034. * testsuite/Makefile.in: Regenerate from Makefile.am.
  7035. * testsuite/debug_msg.cc (main): Make OdrDerived classes.
  7036. * testsuite/debug_msg.sh: Update line numbers and add
  7037. assertions.
  7038. * testsuite/odr_violation1.cc: Use OdrDerived, in a
  7039. non-optimized context.
  7040. * testsuite/odr_violation2.cc: Make sure Ordering::operator()
  7041. isn't inlined, and use OdrDerived in an optimized context.
  7042. * testsuite/odr_header1.h: Defines OdrDerived, where
  7043. optimization will change the
  7044. first-instruction-in-the-destructor's file and line number.
  7045. * testsuite/odr_header2.h: Defines OdrBase.
  7046. 2011-03-09 Ian Lance Taylor <iant@google.com>
  7047. * fileread.cc (File_read::clear_views): Don't delete the whole
  7048. file view.
  7049. 2011-03-08 Ian Lance Taylor <iant@google.com>
  7050. PR gold/12525
  7051. * fileread.cc: #include <climits>.
  7052. (GOLD_IOV_MAX): Define.
  7053. (File_read::read_multiple): Limit number of entries by iov_max.
  7054. * fileread.h (class File_read): Always set max_readv_entries to
  7055. 128.
  7056. 2011-03-07 Ian Lance Taylor <iant@google.com>
  7057. PR gold/12525
  7058. * options.h (class General_options): Add -dy and -dn.
  7059. 2011-03-02 Cary Coutant <ccoutant@google.com>
  7060. * testsuite/script_test_9.t: Add TLS segment.
  7061. 2011-03-02 Simon Baldwin <simonb@google.com>
  7062. * configure.ac: Add check for gnu_indirect_function support in
  7063. the toolchain building binutils.
  7064. * configure: Rebuild.
  7065. 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
  7066. * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
  7067. plugin only symbols.
  7068. (Symbol_table::sized_finalize_symbol) Mark symbol only present
  7069. in plugin files as not needed in the symbol table.
  7070. 2011-02-11 Sriraman Tallam <tmsriram@google.com>
  7071. * output.cc (Output_section::add_input_section): Delay fill
  7072. generation for section ordering.
  7073. 2011-02-09 Ian Lance Taylor <iant@google.com>
  7074. PR gold/12316
  7075. * object.h (class Sized_relobj): Remove clear_local_symbols.
  7076. * reloc.cc (Sized_relobj::do_relocate): Don't call
  7077. clear_local_symbols.
  7078. 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
  7079. * plugin.cc (is_visible_from_outside): Return true for symbols
  7080. in the -u option.
  7081. 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
  7082. * symtab.cc (Odr_violation_compare::operator()): Sort by just the
  7083. filename.
  7084. 2011-02-02 Sriraman Tallam <tmsriram@google.com>
  7085. * icf.h (is_section_foldable_candidate): Change type of parameter
  7086. to std::string.
  7087. * icf.cc (Icf::find_identical_sections): Change type of local variable
  7088. section_name to be std::string.
  7089. (is_function_ctor_or_dtor): Change type of parameter to std::string.
  7090. 2011-01-25 Ian Lance Taylor <iant@google.com>
  7091. * script.cc (script_add_extern): Rewrite to use
  7092. add_symbol_reference.
  7093. 2011-01-25 Doug Kwan <dougkwan@google.com>
  7094. * icf.cc (get_section_contents): Always lock section's object.
  7095. 2011-01-24 Ian Lance Taylor <iant@google.com>
  7096. * options.h (class General_options): Accept
  7097. --no-detect-odr-violations.
  7098. 2011-01-24 Ian Lance Taylor <iant@google.com>
  7099. * version.cc (version_string): Bump to 1.11.
  7100. 2011-01-24 Ian Lance Taylor <iant@google.com>
  7101. * plugin.cc (class Plugin_rescan): Define new class.
  7102. (Plugin_manager::claim_file): Set any_claimed_.
  7103. (Plugin_manager::save_archive): New function.
  7104. (Plugin_manager::save_input_group): New function.
  7105. (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
  7106. necessary.
  7107. (Plugin_manager::new_undefined_symbol): New function.
  7108. (Plugin_manager::rescan): New function.
  7109. (Plugin_manager::rescannable_defines): New function.
  7110. (Plugin_manager::add_input_file): Set any_added_.
  7111. * plugin.h (class Plugin_manager): define new fields rescannable_,
  7112. undefined_symbols_, any_claimed_, and any_added_. Declare
  7113. Plugin_rescan as friend. Declare new functions.
  7114. (Plugin_manager::Rescannable): Define type.
  7115. (Plugin_manager::Rescannable_list): Define type.
  7116. (Plugin_manager::Undefined_symbol_list): Define type.
  7117. (Plugin_manager::Plugin_manager): Initialize new fields.
  7118. * archive.cc (Archive::defines_symbol): New function.
  7119. (Add_archive_symbols::run): Pass archive to plugins if any.
  7120. * archive.h (class Archive): Declare defines_symbol.
  7121. * readsyms.cc (Input_group::~Input_group): New function.
  7122. (Finish_group::run): Pass input_group to plugins if any.
  7123. * readsyms.h (class Input_group): Declare destructor.
  7124. * symtab.cc (add_from_object): Pass undefined symbol to plugins if
  7125. any.
  7126. 2011-01-10 Ian Lance Taylor <iant@google.com>
  7127. * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
  7128. section as relro.
  7129. (Layout::set_segment_offsets): Reset increase_relro before calling
  7130. set_section_addresses a second time.
  7131. 2011-01-04 Cary Coutant <ccoutant@google.com>
  7132. * script-sections.cc (Sort_output_sections::operator()): Sort TLS
  7133. sections before NOBITS sections.
  7134. 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
  7135. * version.cc (print_version): Update copyright to 2011.
  7136. 2010-12-23 Cary Coutant <ccoutant@google.com>
  7137. * output.h (Output_data_reloc::add_output_section): Pass OD instead
  7138. of OS to this->add. Add OD parameter to second form of the function.
  7139. 2010-12-20 Ian Lance Taylor <iant@google.com>
  7140. * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
  7141. second of two consecutive entries with same offset.
  7142. 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  7143. * testsuite/Makefile.am (ifuncmain2static_LDADD)
  7144. (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
  7145. (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
  7146. to avoid unneeded links against $(LDADD).
  7147. * testsuite/Makefile.in: Regenerate.
  7148. 2010-12-15 Ian Lance Taylor <iant@google.com>
  7149. PR gold/12324
  7150. * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
  7151. for R_X86_64_32 and R_X86_64_PC32.
  7152. * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
  7153. ver_matching_def_pic.o.
  7154. (ver_matching_def_pic.o): New target.
  7155. 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  7156. * fileread.cc (file_counts_lock, file_counts_initialize_lock)
  7157. (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
  7158. Move definition before File_read::View member definitions.
  7159. (File_read::View::~View): Initialize and hold lock before
  7160. updating current_mapped_bytes.
  7161. 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  7162. * dwarf_reader.cc: Remove outdated comment.
  7163. * gold-threads.cc: Fix typo in error message.
  7164. * archive.cc: Fix typos in comments.
  7165. * archive.h: Likewise.
  7166. * arm-reloc-property.cc: Likewise.
  7167. * arm-reloc-property.h: Likewise.
  7168. * arm-reloc.def: Likewise.
  7169. * arm.cc: Likewise.
  7170. * attributes.h: Likewise.
  7171. * cref.cc: Likewise.
  7172. * ehframe.cc: Likewise.
  7173. * fileread.h: Likewise.
  7174. * gold.h: Likewise.
  7175. * i386.cc: Likewise.
  7176. * icf.cc: Likewise.
  7177. * incremental.h: Likewise.
  7178. * int_encoding.cc: Likewise.
  7179. * layout.h: Likewise.
  7180. * main.cc: Likewise.
  7181. * merge.h: Likewise.
  7182. * object.cc: Likewise.
  7183. * object.h: Likewise.
  7184. * options.cc: Likewise.
  7185. * readsyms.cc: Likewise.
  7186. * reduced_debug_output.cc: Likewise.
  7187. * reloc.cc: Likewise.
  7188. * script-sections.cc: Likewise.
  7189. * sparc.cc: Likewise.
  7190. * symtab.h: Likewise.
  7191. * target-reloc.h: Likewise.
  7192. * target.cc: Likewise.
  7193. * target.h: Likewise.
  7194. * timer.cc: Likewise.
  7195. * timer.h: Likewise.
  7196. * x86_64.cc: Likewise.
  7197. 2010-12-09 Cary Coutant <ccoutant@google.com>
  7198. * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
  7199. stack.
  7200. * layout.h (Layout::layout_gnu_stack): Add pointer to Object
  7201. parameter; change all callers.
  7202. * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
  7203. * options.h (warn_execstack): New option.
  7204. 2010-12-07 Doug Kwan <dougkwan@google.com>
  7205. * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
  7206. like function call relocations.
  7207. 2010-12-07 Ian Lance Taylor <iant@google.com>
  7208. * archive.cc (Archive::get_elf_object_for_member): Permit
  7209. punconfigured to be NULL.
  7210. (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
  7211. (Archive::include_member): Pass NULL to get_elf_object_for_member
  7212. if we searched for the archive and this is the first included
  7213. object.
  7214. 2010-12-01 Ian Lance Taylor <iant@google.com>
  7215. * dwarf_reader.h (class Sized_dwarf_line_info): Add
  7216. track_relocs_type_ field.
  7217. * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
  7218. Set track_relocs_type_.
  7219. (Sized_dwarf_line_info::process_one_opcode): Ignore the section
  7220. contents when using RELA relocs.
  7221. (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
  7222. reloc_map_.
  7223. * reloc.cc (Track_relocs::next_addend): New function.
  7224. * reloc.h (class Track_relocs): Declare next_addend.
  7225. 2010-12-01 Ian Lance Taylor <iant@google.com>
  7226. * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
  7227. virtual destructor.
  7228. 2010-12-01 Ian Lance Taylor <iant@google.com>
  7229. * README: Update compilers known to work and fail.
  7230. 2010-11-23 Matthias Klose <doko@ubuntu.com>
  7231. * configure.in: For --enable-gold, handle value `default' instead of
  7232. `both*'. Always install ld as ld.bfd, install as ld if gold is
  7233. not the default.
  7234. * configure: Regenerate.
  7235. 2010-11-18 Doug Kwan <dougkwan@google.com>
  7236. * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
  7237. and right_alignment to be zero. Store result alignment only if it is
  7238. greater than existing alignment.
  7239. 2010-11-16 Cary Coutant <ccoutant@google.com>
  7240. PR gold/12220
  7241. * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
  7242. Check for ".zdebug_line".
  7243. 2010-11-16 Doug Kwan <dougkwan@google.com>
  7244. Cary Coutant <ccoutant@google.com>
  7245. * output.h (Output_segment::set_section_addresses): Pass increase_relro
  7246. by reference; adjust all callers.
  7247. * output.cc (Output_segment::set_section_addresses): Adjust references
  7248. to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
  7249. list is empty.
  7250. (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
  7251. end at page boundary.
  7252. 2010-11-16 Cary Coutant <ccoutant@google.com>
  7253. PR gold/12220
  7254. * layout.cc (Layout::choose_output_section): Transform names of
  7255. compressed sections even when using a script with a SECTIONS clause.
  7256. (Layout::output_section_name): Remove code to transform
  7257. compressed debug section names.
  7258. * output.cc (Output_section::add_input_section): Use uncompressed
  7259. section size when tracking input sections.
  7260. 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
  7261. * symtab.h (Symbol::NON_PIC_REF): Remove.
  7262. (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
  7263. (Symbol::FUNCTION_CALL): Renumber. Reword comment.
  7264. (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
  7265. (Symbol::use_plt_offset): Take a flags argument and pass it
  7266. directly to needs_dynamic_reloc. Restrict check for undefined
  7267. weak symbols to function calls.
  7268. * arm.cc (Target_arm::Scan::get_reference_flags): New function.
  7269. (Target_arm::Scan::global): Use it.
  7270. (Target_arm::Scan::scan_reloc_for_stub): Likewise.
  7271. (Target_arm::Relocate::relocate): Likewise.
  7272. (Target_arm::Relocate::should_apply_static_reloc): Replace flags
  7273. parameter with an r_type parameter. Use get_reference_flags
  7274. to get the flags.
  7275. (Target_arm::Relocate::relocate): Update accordingly.
  7276. * i386.cc (Target_i386::Scan::get_reference_flags): New function.
  7277. (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
  7278. (Target_i386::Scan::global): Likewise.
  7279. (Target_i386::Relocate::relocate): Likewise.
  7280. (Target_i386::Relocate::should_apply_static_reloc): Replace flags
  7281. parameter with an r_type parameter. Use get_reference_flags
  7282. to get the flags.
  7283. (Target_i386::Relocate::relocate): Update accordingly.
  7284. * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
  7285. (Target_powerpc::Scan::global): Use it.
  7286. (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
  7287. (Target_powerpc::Relocate::relocate): Likewise.
  7288. * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
  7289. (Target_sparc::Scan::global): Use it.
  7290. (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
  7291. (Target_sparc::Relocate::relocate): Likewise.
  7292. * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
  7293. (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
  7294. (Target_x86_64::Scan::global): Likewise.
  7295. (Target_x86_64::Relocate::relocate): Likewise.
  7296. 2010-11-08 Doug Kwan <dougkwan@google.com>
  7297. Cary Coutant <ccoutant@google.com>
  7298. * arm.cc (Arm_exidx_merge_section::build_contents): New method.
  7299. (Arm_exidx_merge_section::section_contents_): New data member.
  7300. (Arm_input_section::Arm_input_section): Initialize original_contents_.
  7301. (Arm_input_section::~Arm_input_section): De-allocate memory.
  7302. (Arm_input_section::original_contents_): New data member.
  7303. (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
  7304. in parameters instead of calling Object::section_contents without
  7305. locking.
  7306. (Arm_output_section::group_section): New parameter TASK. Pass it
  7307. to callees that need locking objects.
  7308. (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
  7309. to lock EXIDX input sections. Fix a formatting issue. Call
  7310. Arm_exidx_merged_section::build_contents to create merged section
  7311. contents.
  7312. (Arm_output_section::create_stub_group): New parameter TASK. Use it
  7313. to lock object of stub table owner.
  7314. (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
  7315. TEXT_SIZE to initialize data member TEXT_SIZE_.
  7316. (Arm_exidx_input_section::addralign): Fix typo in comment.
  7317. (Arm_exidx_input_section::text_size): New method.
  7318. (Target_arm::do_relax): New parameter TASK. Pass it to callees
  7319. that require locking objects. Lock objects before scanning for stubs
  7320. and updating local symbols.
  7321. (Arm_input_section<big_endian>::init): Copy contents of original
  7322. input section.
  7323. (Arm_input_section<big_endian>::do_write): Use saved contents of
  7324. original input section instead of calling Object::section_contents
  7325. without locking.
  7326. (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
  7327. size without calling Object::section_size().
  7328. (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
  7329. for size. Allocate a buffer for merged EXIDX entries.
  7330. (Arm_exidx_merged_section::build_contents): New method.
  7331. (Arm_exidx_merged_section::do_write): Move merge section contents
  7332. building code to Arm_exidx_merged_section::build_contetns. Write
  7333. out contetns in buffer instead of building it on the fly.
  7334. (Arm_relobj::make_exidx_input_section): Also pass text section size
  7335. to Arm_exidx_input_section constructor.
  7336. (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
  7337. (Arm_dynobj::do_read_symbols): Fix memory leak.
  7338. * layout.cc (Layout::finalize): Pass TASK to Target::relax().
  7339. * target.h: (class Task): Add forward declaration.
  7340. (Target::relax): Add new parameter TASK and pass it to
  7341. Target::do_relax().
  7342. (Target::do_relax):: New parameter TASK. Fix a formatting issue.
  7343. 2010-11-05 Cary Coutant <ccoutant@google.com>
  7344. PR gold/10708
  7345. * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
  7346. object when reading from the file.
  7347. * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
  7348. second layout pass.
  7349. * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
  7350. when reading section contents.
  7351. (get_section_contents): Likewise.
  7352. (icf::find_identical_sections): Likewise.
  7353. * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
  7354. object when reading from the file.
  7355. * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
  7356. the object when doing deferred section layout.
  7357. 2010-11-03 Nick Clifton <nickc@redhat.com>
  7358. PR gold/12001
  7359. * script.h (class Symbol_assignment: name): New member. Returns
  7360. the name of the symbol.
  7361. * scrfipt.cc (Script_options::is_pending_assignment): New member.
  7362. Returns true if the given symbol name is on the list of
  7363. assignments wating to be processed.
  7364. * archive.cc (should_incldue_member): If the symbol is undefined,
  7365. check to see if it is on the list of symbols pending assignment.
  7366. 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
  7367. * script-sections.cc (Script_sections::find_memory_region): Check
  7368. for a NULL output section pointer.
  7369. 2010-10-29 Doug Kwan <dougkwan@google.com>
  7370. * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
  7371. Output_section::add_relaxed_input_section.
  7372. * output.cc (Output_section::add_relaxed_input_section): Add new
  7373. arguments LAYOUT and NAME. Set section order index.
  7374. (Output_section::convert_input_sections_in_list_to_relaxed_sections):
  7375. Copy section order index.
  7376. * output.h (Output_section::add_relaxed_input_section): Add new
  7377. arguments LAYOUT and NAME.
  7378. 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  7379. * testsuite/Makefile.am: Move gcctestdir/ld rule to
  7380. NATIVE_OR_CROSS_LINKER.
  7381. * testsuite/Makefile.in: Regenerate.
  7382. 2010-10-20 Doug Kwan <dougkwan@google.com>
  7383. * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
  7384. without SHF_LINK_ORDER flags.
  7385. * layout.cc (Layout::choose_output_section): Do not filter
  7386. SHF_LINK_ORDER flag in a relocatable link.
  7387. 2010-10-17 Cary Coutant <ccoutant@google.com>
  7388. * output.h (Output_segment::set_section_addresses): Change function
  7389. signature. Update all callers.
  7390. * output.cc (Output_segment::is_first_section_relro): Ignore TLS
  7391. sections.
  7392. (Output_segment::set_section_addresses): Align after last TLS
  7393. section. Add padding before last relro section instead of after.
  7394. 2010-10-17 Doug Kwan <dougkwan@google.com>
  7395. * arm.cc (Target_arm::got_section): Use correct order and set
  7396. GOT output section to be writable.
  7397. 2010-10-14 Cary Coutant <ccoutant@google.com>
  7398. * debug.h (DEBUG_INCREMENTAL): New flag.
  7399. (debug_string_to_enum): Add DEBUG_INCREMENTAL).
  7400. * gold.cc (queue_initial_tasks): Check parameters for incremental link
  7401. mode.
  7402. * incremental.cc (report_command_line): Ignore all forms of
  7403. --incremental.
  7404. * layout.cc (Layout::Layout): Check parameters for incremental link
  7405. mode.
  7406. * options.cc (General_options::parse_incremental): New function.
  7407. (General_options::parse_no_incremental): New function.
  7408. (General_options::parse_incremental_full): New function.
  7409. (General_options::parse_incremental_update): New function.
  7410. (General_options::incremental_mode_): New data member.
  7411. (General_options::finalize): Check incremental_mode_.
  7412. * options.h (General_options): Update help text for --incremental.
  7413. Add --no-incremental, --incremental-full, --incremental-update.
  7414. (General_options::Incremental_mode): New enum type.
  7415. (General_options::incremental_mode): New function.
  7416. (General_options::incremental_mode_): New data member.
  7417. * parameters.cc (Parameters::incremental_mode_): New data member.
  7418. (Parameters::set_options): Set incremental_mode_.
  7419. (Parameters::set_incremental_full): New function.
  7420. (Parameters::incremental): New function.
  7421. (Parameters::incremental_update): New function.
  7422. (set_parameters_incremental_full): New function.
  7423. * parameters.h (Parameters::set_incremental_full): New function.
  7424. (Parameters::incremental): New function.
  7425. (Parameters::incremental_update): New function.
  7426. (Parameters::incremental_mode_): New data member.
  7427. (set_parameters_incremental_full): New function.
  7428. * plugin.cc (Plugin_manager::add_input_file): Check parameters for
  7429. incremental link mode.
  7430. * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
  7431. (Sized_relobj::do_relocate_sections): Likewise.
  7432. * testsuite/Makefile.am (incremental_test): Use --incremental-full
  7433. option.
  7434. * testsuite/Makefile.in: Regenerate.
  7435. * testsuite/incremental_test.sh: Filter all forms of --incremental.
  7436. 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  7437. * script-sections.h (class Script_sections): Make
  7438. Sections_elements typedef public.
  7439. * script-sections.cc (class Sort_output_sections): Add elements_
  7440. field. Add constructor which sets it; change all callers.
  7441. (Sort_output_sections::is_before): New function.
  7442. (Sort_output_sections::operator()): Call is_before.
  7443. * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
  7444. conditional.
  7445. * testsuite/script_test_10.sh: New test. Test script section
  7446. order.
  7447. * testsuite/script_test_10.t: Likewise.
  7448. * testsuite/script_test_10.s: Likewise.
  7449. * testsuite/Makefile.am: Wrap the cross linker tests and the
  7450. common tests into NATIVE_OR_CROSS_LINKER.
  7451. (check_SCRIPTS): Add script_test_10.sh.
  7452. (check_DATA): Add script_test_10.stdout.
  7453. (script_test_10.o, script_test_10): New targets.
  7454. (script_test_10.stdout): New target.
  7455. * configure, testsuite/Makefile.in: Regenerate.
  7456. 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  7457. * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
  7458. error for the deprecated relocations.
  7459. (Target_arm::Scan::global): Likewise.
  7460. (Target_arm::Relocate::relocate): Likewise.
  7461. 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
  7462. * fileread.cc (Input_file::find_file): Initialize *found_name
  7463. and *namep when using the fallback search for case 4.
  7464. 2010-10-11 Cary Coutant <ccoutant@google.com>
  7465. * options.h (class General_options): Redefine -z lazy as an alias for
  7466. the negation of -z now.
  7467. 2010-10-11 Ian Lance Taylor <iant@google.com>
  7468. * resolve.cc (symbol_to_bits): Report the value of the unsupported
  7469. binding.
  7470. 2010-10-06 Nick Clifton <nickc@redhat.com>
  7471. * script-sections.cc(class Memory_region): Remove
  7472. current_lma_offset_ field. Rename current_vma_offset_ to
  7473. current_offset_. Add last_section_ field.
  7474. (Memory_region::get_current_vma_address): Rename to
  7475. get_current_address.
  7476. (Memory_region::get_current_lma_address): Delete.
  7477. (Memory_region::increment_vma_offset): Rename to
  7478. increment_offset.
  7479. (Memory_region::increment_lma_offset): Delete.
  7480. (Memory_region::attributes_compatible): New method. Returns
  7481. true if the provided section is compatible with the region.
  7482. (Memory_region::get_last_section): New method. Returns the last
  7483. section to use the region.
  7484. (Memory_region::set_last_section): New method. Stores the last
  7485. section to use the region.
  7486. (Script_sections::block_in_region): New method. Returns true if
  7487. a block of memory is contained within a region.
  7488. (Script_sections::find_memory_region): New method. Locates a
  7489. memory region to be used to set a VMA or LMA address.
  7490. (Output_section_definition::set_section_addresses): Add code to
  7491. check for addresses set by memory regions.
  7492. (Output_segment::set_section_addresses): Remove memory region
  7493. walking code.
  7494. (Script_sections::create_segment): Add a warning if a header
  7495. segment is created outside of any region.
  7496. * script-sections.h (class Script_sections): Add prototypes for
  7497. find_memory_region and block_in_region methods.
  7498. * testsuite/memory_test.s: Use .long instead of .word.
  7499. * testsuite/memory_test.t: Add some more output sections.
  7500. * testsuite/memory_test.sh: Update expected output.
  7501. 2010-10-02 Doug Kwan <dougkwan@google.com>
  7502. * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
  7503. defintion to symtab.h
  7504. * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
  7505. declaration to defintion.
  7506. 2010-10-01 Nick Clifton <nickc@redhat.com>
  7507. * expression.cc (eval): Replace dummy argument with NULL.
  7508. (eval_maybe_dot): Check for a NULL result section pointer.
  7509. (Symbol_expression::value): Likewise.
  7510. (Dot_expression::value): Likewise.
  7511. (BINARY_EXPRESSION): Likewise.
  7512. (Max_expression::value): Likewise.
  7513. (Min_expression::value): Likewise.
  7514. (Absolute_expression::value): Likewise.
  7515. (Addr_expression::value_from_output_section): Likewise.
  7516. (Loaddddr_expression::value_from_output_section): Likewise.
  7517. (Segment_start_expression::value): Likewise.
  7518. * script-sections.cc
  7519. (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
  7520. argument with NULL.
  7521. (Sections_elememt_dot_assignment::set_section_addresses):
  7522. Likewise.
  7523. (Output_data_expression::do_write_to_buffer): Likewise.
  7524. (Output_section_definition::finalize_symbols): Likewise.
  7525. (Output_section_definition::set_section_addresses): Likewise.
  7526. 2010-09-30 Doug Kwan <dougkwan@google.com>
  7527. * testsuite/arm_branch_out_of_range.sh: Fix broken tests.
  7528. 2010-09-28 Sriraman Tallam <tmsriram@google.com>
  7529. * target.h (Target::can_icf_inline_merge_sections): New virtual
  7530. function.
  7531. * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
  7532. virtual function.
  7533. * i386.cc (Target_i386::can_icf_inline_merge_sections): New
  7534. virtual function.
  7535. * icf.cc (get_section_contents): Inline merge sections only when
  7536. target allows it.
  7537. 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  7538. * configure: Regenerate.
  7539. 2010-09-17 Ian Lance Taylor <iant@google.com>
  7540. * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
  7541. * testsuite/Makefile.am (memory_test.o): New target.
  7542. (memory_test): Depend on memory_test.o, gcctestdir/ld, and
  7543. memory_test.t.
  7544. * testsuite/Makefile.in: Rebuild.
  7545. 2010-09-17 Doug Kwan <dougkwan@google.com>
  7546. * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
  7547. defintion if relocation uses GOT entries of the symbol.
  7548. * testsuite/icf_safe_test.sh: Fix test.
  7549. * testsuite/icf_safe_so_test.sh: Fix test.
  7550. 2010-09-16 Cary Coutant <ccoutant@google.com>
  7551. * script_sections.cc (class Memory_region): Remove "NULL" from
  7552. vector initializations.
  7553. 2010-09-15 Cary Coutant <ccoutant@google.com>
  7554. * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
  7555. Resolve forwarding symbols.
  7556. 2010-09-15 Doug Kwan <dougkwan@google.com>
  7557. * testsuite/script_test_3.t: Add ARM special sections.
  7558. * testsuite/script_test_4.t: Same.
  7559. * testsuite/script_test_5.t: Same.
  7560. * testsuite/script_test_6.t: Same.
  7561. * testsuite/script_test_7.t: Same.
  7562. * testsuite/script_test_7.t: Same.
  7563. * testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
  7564. 2010-09-14 Cary Coutant <ccoutant@google.com>
  7565. * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
  7566. (Target_x86_64::Relocate::relocate_tls): Replace check for
  7567. saw_tls_block_reloc_ with test for executable section.
  7568. 2010-09-12 Cary Coutant <ccoutant@google.com>
  7569. * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
  7570. position-independent executables to shared libraries need dynamic
  7571. relocations.
  7572. (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
  7573. position-independent executables.
  7574. * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
  7575. * testsuite/Makefile.in: Regenerate.
  7576. 2010-09-10 Nick Clifton <nickc@redhat.com>
  7577. PR gold/11997
  7578. * testsuite/memory_test.t: Discard any sections that are not
  7579. needed.
  7580. 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
  7581. PR gold/11996
  7582. * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
  7583. "This::" to work around a bug in gcc 4.2.
  7584. * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
  7585. 2010-09-09 Rafael Espindola <espindola@google.com>
  7586. * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
  7587. sections with different PF_X flags in the same segment.
  7588. (Layout::find_first_load_seg): Search all segments to find the first
  7589. one.
  7590. * options.h (rosegment): New.
  7591. 2010-09-08 Rafael Espindola <espindola@google.com>
  7592. * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
  7593. 2010-09-08 Doug Kwan <dougkwan@google.com>
  7594. * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
  7595. (Arm_relobj::do_relocate_sections): Add new parameter for output
  7596. file to match the parent.
  7597. (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
  7598. of local symbols instead of input values. Update code to track
  7599. changes in gold::relocate_section.
  7600. * object.cc (Sized_relobj::compute_final_local_value): New methods.
  7601. (Sized_relobj::compute_final_local_value_internal): New methods.
  7602. (Sized_relobj::do_finalize_local_symbols): Move code from loop
  7603. body into private version of Sized_relobj::compute_final_local_value.
  7604. Call the inline method.
  7605. * object.h (Symbol_value::Symbol_value): Define destructor. Free
  7606. merged symbol value if there is one.
  7607. (Symbol_value::has_output_value): New method defintiion.
  7608. (Sized_relobj::Compute_final_local_value_status): New enum type.
  7609. (Sized_relobj::compute_final_local_value): New methods.
  7610. (Sized_relobj::compute_final_local_value_internal): New methods.
  7611. * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
  7612. and arm_cortex_a8.sh.
  7613. (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
  7614. arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
  7615. New tests.
  7616. * Makefile.in: Regenerate.
  7617. * testsuite/arm_bl_out_of_range.s: Update test.
  7618. * testsuite/thumb_bl_out_of_range.s: Ditto.
  7619. * testsuite/thumb_blx_out_of_range.s: Ditto.
  7620. * testsuite/arm_branch_out_of_range.sh: New file.
  7621. * testsuite/arm_cortex_a8.sh: Ditto.
  7622. * testsuite/arm_cortex_a8_b.s: Ditto.
  7623. * testsuite/arm_cortex_a8_b_cond.s: Ditto.
  7624. * testsuite/arm_cortex_a8_b_local.s: Ditto.
  7625. * testsuite/arm_cortex_a8_bl.s: Ditto.
  7626. * testsuite/arm_cortex_a8_blx.s: Ditto.
  7627. * testsuite/arm_cortex_a8_local.s: Ditto.
  7628. * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
  7629. * testsuite/thumb_bl_out_of_range_local.s: Ditto.
  7630. 2010-09-08 Rafael Espindola <espindola@google.com>
  7631. * Makefile.am (memory_test.stdout): Run readelf with -W.
  7632. * Makefile.in: Regenerate.
  7633. * testsuite/memory_test.sh: Make the regexps accept both 32 and
  7634. 64 bit output.
  7635. 2010-09-08 Rafael Espindola <espindola@google.com>
  7636. * script-sections.cc (Script_sections::add_memory_region): Convert
  7637. field precision to int.
  7638. * script.cc (script_set_section_region, script_set_section_region):
  7639. Convert field precision to int.
  7640. 2010-09-08 Rafael Espindola <espindola@google.com>
  7641. * arm.cc (do_finalize_sections): Create the __exidx_start and
  7642. __exdix_end symbols even when the section is missing.
  7643. 2010-09-08 Nick Clifton <nickc@redhat.com>
  7644. * README: Remove claim that MEMORY is not supported.
  7645. * expression.cc (script_exp_function_origin)
  7646. (script_exp_function_length): Move from here to ...
  7647. * script.cc: ... here.
  7648. (script_set_section_region, script_add_memory)
  7649. (script_parse_memory_attr, script_include_directive): New
  7650. functions.
  7651. * script-sections.cc
  7652. (class Memory_region): New class.
  7653. (class Output_section_definition): Add set_memory_region,
  7654. set_section_vma, set_section_lma and get_section_name methods.
  7655. (class Script_Sections): Add add_memory_region,
  7656. find_memory_region, find_memory_region_origin,
  7657. find_memory_region_length and set_memory_region methods.
  7658. Have set_section_addresses method walk the list of set memory
  7659. regions.
  7660. Extend the print methos to display memory regions.
  7661. * script-sections.h: Add prototypes for new methods.
  7662. Add enum for MEMORY region attributes.
  7663. * yyscript.y: Add support for parsing MEMORY regions.
  7664. * script-c.h: Add prototypes for new functions.
  7665. * testsuite/Makefile.am: Add test of MEMORY region functionality.
  7666. * testsuite/Makefile.in: Regenerate.
  7667. * testsuite/memory_test.sh: New script.
  7668. * testsuite/memory_test.s: New assembler source file.
  7669. * testsuite/memory_test.t: New linker script.
  7670. 2010-08-27 Doug Kwan <dougkwan@google.com>
  7671. * resolve.cc (Symbol_table::should_override): Let a weak
  7672. reference override an existing dynamic weak reference.
  7673. * testsuite/Makefile.am: Add new test dyn_weak_ref.
  7674. * testsuite/Makefile.in: Regenerate.
  7675. * testsuite/dyn_weak_ref.sh: New file.
  7676. * testsuite/dyn_weak_ref_1.c: Ditto.
  7677. * testsuite/dyn_weak_ref_2.c: Ditto.
  7678. 2010-08-27 Ian Lance Taylor <iant@google.com>
  7679. * incremental.h (class Incremental_input_entry): Add virtual
  7680. destructor.
  7681. 2010-08-27 Ian Lance Taylor <iant@google.com>
  7682. * testsuite/start_lib_test_3.c: Mark t3 as used.
  7683. 2010-08-27 Nick Clifton <nickc@redhat.com>
  7684. * options.cc (version_script): Fix small typo in previous
  7685. whitespace tidyup.
  7686. 2010-08-25 Nick Clifton <nickc@redhat.com>
  7687. * archive.cc: Formatting fixes: Remove whitespace between
  7688. typename and following asterisk. Remove whitespace between
  7689. function name and opening parenthesis.
  7690. * archive.h: Likewise.
  7691. * arm.cc: Likewise.
  7692. * attributes.cc: Likewise.
  7693. * attributes.h: Likewise.
  7694. * common.cc: Likewise.
  7695. * copy-relocs.cc: Likewise.
  7696. * dirsearch.h: Likewise.
  7697. * dynobj.cc: Likewise.
  7698. * ehframe.cc: Likewise.
  7699. * ehframe.h: Likewise.
  7700. * expression.cc: Likewise.
  7701. * fileread.cc: Likewise.
  7702. * fileread.h: Likewise.
  7703. * gc.h: Likewise.
  7704. * gold-threads.cc: Likewise.
  7705. * gold.cc: Likewise.
  7706. * i386.cc: Likewise.
  7707. * icf.h: Likewise.
  7708. * incremental-dump.cc: Likewise.
  7709. * incremental.cc: Likewise.
  7710. * layout.cc: Likewise.
  7711. * layout.h: Likewise.
  7712. * main.cc: Likewise.
  7713. * merge.cc: Likewise.
  7714. * merge.h: Likewise.
  7715. * object.cc: Likewise.
  7716. * object.h: Likewise.
  7717. * options.cc: Likewise.
  7718. * options.h: Likewise.
  7719. * output.cc: Likewise.
  7720. * output.h: Likewise.
  7721. * plugin.cc: Likewise.
  7722. * plugin.h: Likewise.
  7723. * powerpc.cc: Likewise.
  7724. * reloc.cc: Likewise.
  7725. * script-c.h: Likewise.
  7726. * script-sections.cc: Likewise.
  7727. * script.cc: Likewise.
  7728. * stringpool.cc: Likewise.
  7729. * symtab.cc: Likewise.
  7730. * symtab.h: Likewise.
  7731. * target.cc: Likewise.
  7732. * timer.cc: Likewise.
  7733. * timer.h: Likewise.
  7734. * version.cc: Likewise.
  7735. * x86_64.cc: Likewise.
  7736. 2010-08-24 Nick Clifton <nickc@redhat.com>
  7737. PR 11899
  7738. * layout.cc (segment_precedes): Sort segments by their physical
  7739. addresses, if they have been set.
  7740. 2010-08-23 Cary Coutant <ccoutant@google.com>
  7741. * archive.cc (Lib_group::add_symbols): Lock object before deleting its
  7742. symbols data.
  7743. (Lib_group::include_member): Unlock object after deleting its
  7744. symbols data.
  7745. * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
  7746. the bug fixed here.
  7747. 2010-08-19 Neil Vachharajani <nvachhar@google.com>
  7748. Cary Coutant <ccoutant@google.com>
  7749. * archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
  7750. constructor, and set_blocker.
  7751. * archive.cc (Add_lib_group_symbols::is_runnable): Also check
  7752. readsyms_blocker_.
  7753. * readsyms.cc (Read_symbols::do_lib_group): Also pass
  7754. this->this_blocker_ to Add_lib_group_symbols::set_blocker.
  7755. * testsuite/Makefile.am (start_lib_test): New test case.
  7756. * testsuite/Makefile.in: Regenerate.
  7757. * testsuite/start_lib_test_main.c: New file.
  7758. * testsuite/start_lib_test_1.c: New file.
  7759. * testsuite/start_lib_test_2.c: New file.
  7760. * testsuite/start_lib_test_3.c: New file.
  7761. 2010-08-19 Ian Lance Taylor <iant@google.com>
  7762. * Makefile.in: Rebuild with automake 1.11.1.
  7763. * aclocal.m4: Likewise.
  7764. * testsuite/Makefile.in: Likewise.
  7765. 2010-08-19 Ian Lance Taylor <iant@google.com>
  7766. PR 10893
  7767. * i386.cc (class Output_data_plt_i386): Update declarations.
  7768. Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
  7769. local_ifuncs_ fields.
  7770. (Target_i386::do_plt_section_for_global): New function.
  7771. (Target_i386::do_plt_section_for_local): New function.
  7772. (Output_data_plt_i386::Output_data_plt_i386): Add symtab
  7773. parameter; change all callers. Initialize global_ifuncs_ and
  7774. local_ifuncs_. If doing a static link define __rel_iplt_start and
  7775. __rel_iplt_end.
  7776. (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
  7777. (Output_data_plt_i386::add_local_ifunc_entry): New function.
  7778. (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
  7779. symbols.
  7780. (Target_i386::make_plt_section): New function, broken out of
  7781. make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
  7782. (Target_i386::make_plt_entry): Call make_plt_section.
  7783. (Target_i386::make_local_ifunc_plt_entry): New function.
  7784. (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
  7785. (Target_i386::Scan::local): Handle IFUNC symbols. Add
  7786. R_386_IRELATIVE to switch.
  7787. (Target_i386::Scan::global): Likewise.
  7788. (Target_i386::Relocate::relocate): Likewise.
  7789. (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
  7790. switch.
  7791. * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
  7792. (Target_x86_64::do_plt_section_for_global): New function.
  7793. (Target_x86_64::do_plt_section_for_local): New function.
  7794. (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
  7795. parameter; change all callers. If doing a static link define
  7796. __rela_iplt_start and __rela_iplt_end.
  7797. (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
  7798. (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
  7799. (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
  7800. to point to .plt.
  7801. (Target_x86_64::make_local_ifunc_plt_entry): New function.
  7802. (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
  7803. switch.
  7804. (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
  7805. (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
  7806. R_X86_64_IRELATIVE to switch.
  7807. (Target_x86_64::Scan::global): Likewise.
  7808. (Target_x86_64::Relocate::relocate): Likewise.
  7809. (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
  7810. switch.
  7811. * target.h (class Target): Add plt_section_for_global and
  7812. plt_section_for_local functions. Add do_plt_section_for_global
  7813. and do_plt_section_for_local virtual functions.
  7814. * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
  7815. clarifying comments.
  7816. (Symbol::use_plt_offset): Handle IFUNC symbol.
  7817. * object.cc (Sized_relobj::Sized_relobj): Initialize
  7818. local_plt_offsets_.
  7819. (Sized_relobj::local_has_plt_offset): New function.
  7820. (Sized_relobj::local_plt_offset): New function.
  7821. (Sized_relobj::set_local_plt_offset): New function.
  7822. (Sized_relobj::do_count): Handle IFUNC symbol.
  7823. * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
  7824. a bit away from input_shndx_ field. Add set_is_func_symbol and
  7825. is_ifunc_symbol functions.
  7826. (class Sized_relobj): Update declarations. Remove Tls_got_entry
  7827. and Local_tls_got_offsets. Define Local_plt_offsets. Add
  7828. local_plt_offsets_ field.
  7829. (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
  7830. * output.h (class Output_section_data): Add non-const
  7831. output_section function.
  7832. (class Output_data_got): Update declarations.
  7833. (class Output_data_got::Got_entry): Add use_plt_offset_ field.
  7834. Add use_plt_offset parameter to global and local constructors.
  7835. Change all callers. Change local_sym_index_ field to 31 bits.
  7836. Change GSYM_CODE and CONSTANT_CODE accordingly.
  7837. * output.cc (Output_data_reloc_base::do_adjust_output_section): If
  7838. doing a static link don't set sh_link field.
  7839. (Output_data_got::Got_entry::write): Use PLT offset if
  7840. appropriate.
  7841. (Output_data_got::add_global_plt): New function.
  7842. (Output_data_got::add_local_plt): New function.
  7843. * target-reloc.h (relocate_section): Handle IFUNC symbol.
  7844. * defstd.cc (in_section): Remove entries for __rel_iplt_start,
  7845. __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
  7846. * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
  7847. * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
  7848. IFUNC conditional.
  7849. * testsuite/ifunc-sel.h: New file.
  7850. * testsuite/ifuncmain1.c: New file.
  7851. * testsuite/ifuncmain1vis.c: New file.
  7852. * testsuite/ifuncmod1.c: New file.
  7853. * testsuite/ifuncdep2.c: New file.
  7854. * testsuite/ifuncmain2.c: New file.
  7855. * testsuite/ifuncmain3.c: New file.
  7856. * testsuite/ifuncmod3.c: New file.
  7857. * testsuite/ifuncmain4.c: New file.
  7858. * testsuite/ifuncmain5.c: New file.
  7859. * testsuite/ifuncmod5.c: New file.
  7860. * testsuite/ifuncmain6pie.c: New file.
  7861. * testsuite/ifuncmod6.c: New file.
  7862. * testsuite/ifuncmain7.c: New file.
  7863. * configure, testsuite/Makefile.in: Rebuild.
  7864. 2010-08-18 Ian Lance Taylor <iant@google.com>
  7865. * incremental.cc
  7866. (Output_section_incremental_inputs::write_input_files): Add cast
  7867. to avoid signed/unsigned comparison warning.
  7868. (Output_section_incremental_inputs::write_info_blocks): Likewise.
  7869. 2010-08-12 Cary Coutant <ccoutant@google.com>
  7870. * common.cc (Sort_commons::operator()): Remove unnecessary code.
  7871. 2010-08-13 Ian Lance Taylor <iant@google.com>
  7872. * testsuite/incremental_test_1.c: Add prototype to avoid warning.
  7873. 2010-08-12 Cary Coutant <ccoutant@google.com>
  7874. Doug Kwan <dougkwan@google.com>
  7875. * resolve.cc (Symbol_table::should_override): When a weak dynamic
  7876. defintion overrides non-weak undef, remember that the original undef
  7877. is not weak.
  7878. * symtab.cc (Symbol_table::sized_write_global): For undef without
  7879. an original weak binding, set binding to global in output.
  7880. * testsuite/Makefile.am: Add new test strong_ref_weak_def.
  7881. * testsuite/Makefile.in: Regenerate.
  7882. * testsuite/strong_ref_weak_def.sh: New file.
  7883. * testsuite/strong_ref_weak_def_1.c: Ditto.
  7884. * testsuite/strong_ref_weak_def_2.c: Ditto.
  7885. 2010-08-12 Cary Coutant <ccoutant@google.com>
  7886. * testsuite/incremental_test.sh: Rewrite.
  7887. * testsuite/incremental_test_1.c: Rewrite.
  7888. * testsuite/incremental_test_2.c: Rewrite.
  7889. 2010-08-12 Cary Coutant <ccoutant@google.com>
  7890. * arm.cc (Target_arm::got_size): Add const.
  7891. (Target_arm::got_entry_count): New function.
  7892. (Target_arm::plt_entry_count): New function.
  7893. (Target_arm::first_plt_entry_offset): New function.
  7894. (Target_arm::plt_entry_size): New function.
  7895. (Output_data_plt_arm::entry_count): New function.
  7896. (Output_data_plt_arm::first_plt_entry_offset): New function.
  7897. (Output_data_plt_arm::get_plt_entry_size): New function.
  7898. * i386.cc (Target_i386::got_size): Add const.
  7899. (Target_i386::got_entry_count): New function.
  7900. (Target_i386::plt_entry_count): New function.
  7901. (Target_i386::first_plt_entry_offset): New function.
  7902. (Target_i386::plt_entry_size): New function.
  7903. (Output_data_plt_i386::entry_count): New function.
  7904. (Output_data_plt_i386::first_plt_entry_offset): New function.
  7905. (Output_data_plt_i386::get_plt_entry_size): New function.
  7906. * incremental-dump.cc (dump_incremental_inputs): Adjust call to
  7907. find_incremental_inputs_sections. Dump incremental_got_plt section.
  7908. * incremental.cc: Include target.h.
  7909. (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
  7910. parameter. Adjust all callers. Find incremental_got_plt section.
  7911. (Incremental_inputs::create_data_sections): Create incremental_got_plt
  7912. section.
  7913. (Output_section_incremental_inputs::set_final_data_size): Calculate
  7914. size of incremental_got_plt section.
  7915. (Output_section_incremental_inputs::do_write): Write the
  7916. incremental_got_plt section.
  7917. (Got_plt_view_info): New struct.
  7918. (Local_got_offset_visitor): New class.
  7919. (Global_got_offset_visitor): New class.
  7920. (Global_symbol_visitor_got_plt): New class.
  7921. (Output_section_incremental_inputs::write_got_plt): New function.
  7922. * incremental.h (Incremental_binary::find_incremental_inputs_sections):
  7923. Add parameter. Adjust all callers.
  7924. (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
  7925. (Incremental_inputs::got_plt_section): New function.
  7926. (Incremental_inputs::got_plt_section_): New data member.
  7927. (Incremental_got_plt_reader): New class.
  7928. * layout.cc (Layout::create_incremental_info_sections): Add the
  7929. incremental_got_plt section.
  7930. * object.h (Got_offset_list::get_list): New function.
  7931. (Got offset_list::for_all_got_offsets): New function.
  7932. (Sized_relobj::local_got_offset_list): New function.
  7933. * powerpc.cc (Target_powerpc::got_size): Add const.
  7934. (Target_powerpc::got_entry_count): New function.
  7935. (Target_powerpc::plt_entry_count): New function.
  7936. (Target_powerpc::first_plt_entry_offset): New function.
  7937. (Target_powerpc::plt_entry_size): New function.
  7938. (Output_data_plt_powerpc::entry_count): New function.
  7939. (Output_data_plt_powerpc::first_plt_entry_offset): New function.
  7940. (Output_data_plt_powerpc::get_plt_entry_size): New function.
  7941. * sparc.cc (Target_sparc::got_size): Add const.
  7942. (Target_sparc::got_entry_count): New function.
  7943. (Target_sparc::plt_entry_count): New function.
  7944. (Target_sparc::first_plt_entry_offset): New function.
  7945. (Target_sparc::plt_entry_size): New function.
  7946. (Output_data_plt_sparc::entry_count): New function.
  7947. (Output_data_plt_sparc::first_plt_entry_offset): New function.
  7948. (Output_data_plt_sparc::get_plt_entry_size): New function.
  7949. * symtab.h (Symbol::got_offset_list): New function.
  7950. (Symbol_table::for_all_symbols): New function.
  7951. * target.h (Sized_target::got_entry_count): New function.
  7952. (Sized_target::plt_entry_count): New function.
  7953. (Sized_target::plt_entry_size): New function.
  7954. * x86_64.cc (Target_x86_64::got_size): Add const.
  7955. (Target_x86_64::got_entry_count): New function.
  7956. (Target_x86_64::plt_entry_count): New function.
  7957. (Target_x86_64::first_plt_entry_offset): New function.
  7958. (Target_x86_64::plt_entry_size): New function.
  7959. (Output_data_plt_x86_64::entry_count): New function.
  7960. (Output_data_plt_x86_64::first_plt_entry_offset): New function.
  7961. (Output_data_plt_x86_64::get_plt_entry_size): New function.
  7962. 2010-08-12 Cary Coutant <ccoutant@google.com>
  7963. * archive.cc: Include incremental.h.
  7964. (Archive::Archive): Initialize incremental_info_.
  7965. (Archive::include_member): Record archive members in incremental info.
  7966. (Add_archive_symbols::run): Record begin and end of an archive in
  7967. incremental info.
  7968. (Lib_group::include_member): Record objects in incremental info.
  7969. * archive.h (Incremental_archive_entry): Forward declaration.
  7970. (Archive::set_incremental_info): New member function.
  7971. (Archive::incremental_info): New member function.
  7972. (Archive::Unused_symbol_iterator): New class.
  7973. (Archive::unused_symbols_begin): New member function.
  7974. (Archive::unused_symbols_end): New member function.
  7975. (Archive::incremental_info_): New data member.
  7976. * incremental-dump.cc (find_input_containing_global): New function.
  7977. (dump_incremental_inputs): Dump new incremental info sections.
  7978. * incremental.cc: Include symtab.h.
  7979. (Output_section_incremental_inputs): New class.
  7980. (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
  7981. new incremental info sections.
  7982. (Sized_incremental_binary::do_check_inputs): Likewise.
  7983. (Incremental_inputs::report_archive): Remove.
  7984. (Incremental_inputs::report_archive_begin): New function.
  7985. (Incremental_inputs::report_archive_end): New function.
  7986. (Incremental_inputs::report_object): New function.
  7987. (Incremental_inputs::finalize_inputs): Remove.
  7988. (Incremental_inputs::report_input_section): New function.
  7989. (Incremental_inputs::report_script): Rewrite.
  7990. (Incremental_inputs::finalize): Do nothing but finalize string table.
  7991. (Incremental_inputs::create_incremental_inputs_section_data): Remove.
  7992. (Incremental_inputs::sized_create_inputs_section_data): Remove.
  7993. (Incremental_inputs::create_data_sections): New function.
  7994. (Incremental_inputs::relocs_entsize): New function.
  7995. (Output_section_incremental_inputs::set_final_data_size): New function.
  7996. (Output_section_incremental_inputs::do_write): New function.
  7997. (Output_section_incremental_inputs::write_header): New function.
  7998. (Output_section_incremental_inputs::write_input_files): New function.
  7999. (Output_section_incremental_inputs::write_info_blocks): New function.
  8000. (Output_section_incremental_inputs::write_symtab): New function.
  8001. * incremental.h (Incremental_script_entry): Forward declaration.
  8002. (Incremental_object_entry): Forward declaration.
  8003. (Incremental_archive_entry): Forward declaration.
  8004. (Incremental_inputs): Forward declaration.
  8005. (Incremental_inputs_header_data): Remove.
  8006. (Incremental_inputs_header): Remove.
  8007. (Incremental_inputs_header_write): Remove.
  8008. (Incremental_inputs_entry_data): Remove.
  8009. (Incremental_inputs_entry): Remove.
  8010. (Incremental_inputs_entry_write): Remove.
  8011. (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
  8012. (Incremental_binary::find_incremental_inputs_sections): Add parameters.
  8013. (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
  8014. (Sized_ncremental_binary::do_find_incremental_inputs_sections):
  8015. Likewise.
  8016. (Incremental_input_entry): New class.
  8017. (Incremental_script_entry): New class.
  8018. (Incremental_object_entry): New class.
  8019. (Incremental_archive_entry): New class.
  8020. (Incremental_inputs::Incremental_inputs): Initialize new data members.
  8021. (Incremental_inputs::report_inputs): Remove.
  8022. (Incremental_inputs::report_archive): Remove.
  8023. (Incremental_inputs::report_archive_begin): New function.
  8024. (Incremental_inputs::report_archive_end): New function.
  8025. (Incremental_inputs::report_object): Change prototype.
  8026. (Incremental_inputs::report_input_section): New function.
  8027. (Incremental_inputs::report_script): Change prototype.
  8028. (Incremental_inputs::get_reloc_count): New function.
  8029. (Incremental_inputs::set_reloc_count): New function.
  8030. (Incremental_inputs::create_data_sections): New function.
  8031. (Incremental_inputs::create_incremental_inputs_section_data): Remove.
  8032. (Incremental_inputs::inputs_section): New function.
  8033. (Incremental_inputs::symtab_section): New function.
  8034. (Incremental_inputs::relocs_section): New function.
  8035. (Incremental_inputs::get_stringpool): Add const.
  8036. (Incremental_inputs::command_line): Add const.
  8037. (Incremental_inputs::inputs): Remove.
  8038. (Incremental_inputs::command_line_key): New function.
  8039. (Incremental_inputs::input_file_count): New function.
  8040. (Incremental_inputs::input_files): New function.
  8041. (Incremental_inputs::relocs_entsize): New function.
  8042. (Incremental_inputs::sized_create_inputs_section_data): Remove.
  8043. (Incremental_inputs::finalize_inputs): Remove.
  8044. (Incremental_inputs::Input_info): Remove.
  8045. (Incremental_inputs::lock_): Remove.
  8046. (Incremental_inputs::inputs_): Change type.
  8047. (Incremental_inputs::inputs_map_): Remove.
  8048. (Incremental_inputs::current_object_entry_): New data member.
  8049. (Incremental_inputs::inputs_section_): New data member.
  8050. (Incremental_inputs::symtab_section_): New data member.
  8051. (Incremental_inputs::relocs_section_): New data member.
  8052. (Incremental_inputs::reloc_count_): New data member.
  8053. (Incremental_inputs_reader): New class.
  8054. (Incremental_symtab_reader): New class.
  8055. (Incremental_relocs_reader): New class.
  8056. * layout.cc (Layout::finalize): Move finalization of incremental info
  8057. and creation of incremental info sections to follow finalization of
  8058. symbol table. Set offsets for postprocessing sections.
  8059. (Layout::create_incremental_info_sections): Call
  8060. Incremental_inputs::create_data_sections. Add incremental symtab
  8061. and relocs sections. Set sh_entsize and sh_link fields. Arrange for
  8062. sections to layout after input sections.
  8063. * layout.h (struct Timespec): Forward declaration.
  8064. (Layout::incremental_inputs): Add const.
  8065. (Layout::create_incremental_info_sections): Add parameter.
  8066. * main.cc (main): Remove call to Incremental_inputs::report_inputs.
  8067. * object.cc: Include incremental.h.
  8068. (Relobj::finalize_incremental_relocs): New function.
  8069. (Sized_relobj::do_layout): Record input sections in incremental info.
  8070. * object.h (Object::output_section): New function.
  8071. (Object::output_section_offset): Moved from Relobj.
  8072. (Object::get_incremental_reloc_base): New function.
  8073. (Object::get_incremental_reloc_count): New function.
  8074. (Object::do_output_section): New function.
  8075. (Object::do_output_section_offset): Moved from Relobj.
  8076. (Object::do_get_incremental_reloc_base): New function.
  8077. (Object::do_get_incremental_reloc_count): New function.
  8078. (Object::Object): Initialize new data members.
  8079. (Relobj::output_section): Renamed do_output_section and moved to
  8080. protected.
  8081. (Relobj::output_section_offset): Moved to Object.
  8082. (Relobj::do_get_incremental_reloc_base): New function.
  8083. (Relobj::do_get_incremental_reloc_count): New function.
  8084. (Relobj::allocate_incremental_reloc_counts): New function.
  8085. (Relobj::count_incremental_reloc): New function.
  8086. (Relobj::finalize_incremental_relocs): New function.
  8087. (Relobj::next_incremental_reloc_index): New function.
  8088. (Relobj::reloc_counts_): New data member.
  8089. (Relobj::reloc_bases_): New data member.
  8090. (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
  8091. (Sized_relobj::relocate_sections): Add parameter. Change all callers.
  8092. (Sized_relobj::incremental_relocs_scan): New function.
  8093. (Sized_relobj::incremental_relocs_scan_reltype): New function.
  8094. (Sized_relobj::incremental_relocs_write): New function.
  8095. (Sized_relobj::incremental_relocs_write_reltype): New function.
  8096. * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
  8097. incremental link.
  8098. * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
  8099. archives and object files elsewhere.
  8100. (Add_symbols::run): Report object files here.
  8101. (Finish_group::run): Report end of archive at end of group.
  8102. * reloc.cc: Include layout.h, incremental.h.
  8103. (Sized_relobj::do_read_relocs): Need relocations for incremental link.
  8104. (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
  8105. (Sized_relobj::incremental_relocs_scan): New function.
  8106. (Sized_relobj::incremental_relocs_scan_reltype): New function.
  8107. (Sized_relobj::do_relocate_sections): Write incremental relocations.
  8108. (Sized_relobj::incremental_relocs_write): New function.
  8109. (Sized_relobj::incremental_relocs_write_reltype): New function.
  8110. * script.cc (read_input_script): Rewrite test for incremental link.
  8111. Change call to Incremental_inputs::report_script.
  8112. * symtab.h (Symbol_table::first_global_index): New function.
  8113. (Symbol_table::output_count): New function.
  8114. 2010-08-12 Doug Kwan <dougkwan@google.com>
  8115. * arm.cc (Target_arm::merge_object_attributes): Check command line
  8116. options --no-wchar-size-warning and --no-enum-size-warning.
  8117. * options.h (General_options): Add ld-compatible options
  8118. --no-enum-size-warning and --no-wchar-size-warning.
  8119. 2010-08-04 Ian Lance Taylor <iant@google.com>
  8120. * x86_64.cc (Target_x86_64::Scan::local): Use
  8121. R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
  8122. R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
  8123. (Target_x86_64::Scan::global): Likewise.
  8124. (Target_x86_64::Relocate::relocate): Likewise.
  8125. (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
  8126. Likewise.
  8127. 2010-08-03 Cary Coutant <ccoutant@google.com>
  8128. * merge.cc (Output_merge_string::do_add_input_section): Count strings
  8129. to reserve space in merged_strings vector. Keep total input size
  8130. for stats.
  8131. (Output_merge_string::do_print_merge_stats): Print total input size.
  8132. * merge.h (Output_merge_string): Add input_size_ field.
  8133. * stringpool.cc (Stringpool_template::string_length): Move
  8134. implementations out of Stringpool_template class and place in
  8135. stringpool.h.
  8136. * stringpool.h (string_length): Move out of Stringpool_template.
  8137. 2010-08-03 Ian Lance Taylor <iant@google.com>
  8138. PR 11712
  8139. * layout.cc (relaxation_loop_body): If address of load segment is
  8140. set, adjust address to include headers if possible.
  8141. 2010-08-03 Ian Lance Taylor <iant@google.com>
  8142. * version.cc (version_string): Bump to 1.10.
  8143. 2010-08-03 Ian Lance Taylor <iant@google.com>
  8144. PR 11805
  8145. * layout.h (enum Output_section_order): Define.
  8146. (class Layout): Update declarations.
  8147. * layout.cc (Layout::get_output_section): Add order parameter.
  8148. Remove is_interp, is_dynamic_linker_section, is_last_relro, and
  8149. is_first_non_relro parameters. Change all callers.
  8150. (Layout::choose_output_section): Likewise.
  8151. (Layout::add_output_section_data): Likewise.
  8152. (Layout::make_output_section): Likewise. Set order.
  8153. (Layout::default_section_order): New function.
  8154. (Layout::layout_eh_frame): Call add_output_section_to_nonload.
  8155. * output.cc (Output_section::Output_section): Initialize order_.
  8156. Don't initialize deleted fields.
  8157. (Output_segment::Output_segment): Don't initialize deleted
  8158. fields.
  8159. (Output_segment::add_output_section_to_load): New function
  8160. replacing add_output_section. Change all callers to call this or
  8161. add_output_section_to_nonload.
  8162. (Output_segment::add_output_section_to_nonload): New function.
  8163. (Output_segment::remove_output_section): Rewrite.
  8164. (Output_segment::add_initial_output_data): Likewise.
  8165. (Output_segment::has_any_data_sections): Likewise.
  8166. (Output_segment::is_first_section_relro): Likewise.
  8167. (Output_segment::maximum_alignment): Likewise.
  8168. (Output_segment::has_dynamic_reloc): New function replacing
  8169. dynamic_reloc_count. Change all callers.
  8170. (Output_segment::has_dynamic_reloc_list): New function replacing
  8171. dynamic_reloc_count_list. Change all callers.
  8172. (Output_segment::set_section_addresses): Rewrite.
  8173. (Output_segment::set_offset): Rewrite.
  8174. (Output_segment::find_first_and_last_list): Remove.
  8175. (Output_segment::set_tls_offsets): Rewrite.
  8176. (Output_segment::first_section_load_address): Likewise.
  8177. (Output_segment::output_section_count): Likewise.
  8178. (Output_segment::section_with_lowest_load_address): Likewise.
  8179. (Output_segment::write_section_headers): Likewise.
  8180. (Output_segment::print_sections_to_map): Likewise.
  8181. * output.h (class Output_data): Remove dynamic_reloc_count_
  8182. field. Add has_dynamic_reloc_ field. Make bools into bitfields.
  8183. (Output_data::add_dynamic_reloc): Rewrite.
  8184. (Output_data::has_dynamic_reloc): New function.
  8185. (Output_data::dynamic_reloc_count): Remove.
  8186. (class Output_section): Add order_ field. Remvoe is_relro_local_,
  8187. is_last_relro_, is_first_non_relro_, is_interp_,
  8188. is_dynamic_linker_section_ fields. Add order and set_order
  8189. functions. Remove is_relro_local, set_is_relro_local,
  8190. is_last_relro, set_is_last_relro, is_first_non_relro,
  8191. set_is_first_non_relro functions, is_interp, set_is_interp,
  8192. is_dynamic_linker_section, and set_is_dynamic_linker_section
  8193. functions.
  8194. (class Output_segment): Change Output_data_list from std::list to
  8195. std:;vector. Add output_lists_ field. Remove output_data_ and
  8196. output_bss_ fields. Update declarations.
  8197. 2010-08-02 Ian Lance Taylor <iant@google.com>
  8198. * arm.cc (Target_arm::gc_process_relocs): Use typename.
  8199. * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
  8200. * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
  8201. 2010-08-02 Ian Lance Taylor <iant@google.com>
  8202. PR 11855
  8203. * script.cc (Script_options::Script_options): Initialize
  8204. symbol_definitions_ and symbol_references_.
  8205. (Script_options::add_symbol_assignment): Update
  8206. symbol_definitions_ and symbol_references_.
  8207. (Script_options::add_symbol_reference): New function.
  8208. (script_symbol): New function.
  8209. * script.h (class Script_options): Add symbol_definitions_ and
  8210. symbol_references_ fields.
  8211. (Script_options::referenced_const_iterator): New type.
  8212. (Script_options::referenced_begin): New function.
  8213. (Script_options::referenced_end): New function.
  8214. (Script_options::is_referenced): New function.
  8215. (Script_options::any_unreferenced): New function.
  8216. * script-c.h (script_symbol): Declare.
  8217. * yyscript.y (exp): Call script_symbol.
  8218. * symtab.cc: Include "script.h".
  8219. (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
  8220. Change all callers. Check symbols referenced by scripts.
  8221. (Symbol_table::add_undefined_symbols_from_command_line): Add
  8222. layout parameter. Change all callers.
  8223. (Symbol_table::do_add_undefined_symbols_from_command_line):
  8224. Likewise. Break out loop body. Check symbols referenced by
  8225. scripts.
  8226. (Symbol_table::add_undefined_symbol_from_command_line): New
  8227. function broken out of
  8228. do_add_undefined_symbols_from_command_line.
  8229. * symtab.h (class Symbol_table): Update declarations.
  8230. * archive.cc: Include "layout.h".
  8231. (Archive::should_include_member): Add layout parameter. Change
  8232. all callers. Check for symbol mentioned in expression.
  8233. * archive.h (class Archive): Update declaration.
  8234. * object.cc (Sized_relobj::do_should_include_member): Add layout
  8235. parameter.
  8236. * object.h (Object::should_include_member): Add layout parameter.
  8237. Change all callers.
  8238. (Object::do_should_include_member): Add layout parameter.
  8239. (class Sized_relobj): Update declaration.
  8240. * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
  8241. parameter.
  8242. * dynobj.h (class Sized_dynobj): Update declaration.
  8243. * plugin.cc (Sized_pluginobj::do_should_include_member): Add
  8244. layout parameter.
  8245. * plugin.h (class Sized_pluginobj): Update declaration.
  8246. 2010-08-02 Ian Lance Taylor <iant@google.com>
  8247. PR 11866
  8248. * output.cc (Output_segment::set_offset): Search for the first and
  8249. last sections rather than assuming that the list is in order.
  8250. (Output_segment::find_first_and_last_list): New function.
  8251. * output.h (class Output_segment): Update declarations.
  8252. * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
  8253. (relro_strip_test_SOURCES): New variable.
  8254. (relro_strip_test_DEPENDENCIES): New variable.
  8255. (relro_strip_test_LDFLAGS): New variable.
  8256. (relro_strip_test_LDADD): New variable.
  8257. (relro_strip_test.so): New target.
  8258. 2010-08-02 Ian Lance Taylor <iant@google.com>
  8259. * i386.cc (class Target_i386): Add got_tlsdesc_ field.
  8260. (Target_i386::Target_i386):: Initialize got_tlsdesc_.
  8261. (Target_i386::got_tlsdesc_section): New function.
  8262. (Target_i386::got_section): Create space for GOT entries for
  8263. TLSDESC relocations.
  8264. (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
  8265. R_386_TLS_GOTDESC.
  8266. (Target_i386::Scan::global): Likewise.
  8267. (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
  8268. using TLSDESC GOT.
  8269. * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
  8270. (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
  8271. (Target_x86_64::got_tlsdesc_section): New function.
  8272. (Target_x86_64::got_section): Create space for GOT entries for
  8273. TLSDESC relocations.
  8274. (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
  8275. R_386_TLS_GOTDESC.
  8276. (Target_x86_64::Scan::global): Likewise.
  8277. (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
  8278. using TLSDESC GOT.
  8279. 2010-08-02 Ian Lance Taylor <iant@google.com>
  8280. * testsuite/final_layout.sh: Use dc to convert from hex to
  8281. decimal.
  8282. 2010-07-29 Sriraman Tallam <tmsriram@google.com>
  8283. * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
  8284. paramter to the call to gold::gc_process_relocs.
  8285. * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
  8286. paramter to the call to gold::gc_process_relocs.
  8287. * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
  8288. parameter to the call to gold::gc_process_relocs.
  8289. * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
  8290. template parameter to the call to gold::gc_process_relocs.
  8291. * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
  8292. paramter to the call to gold::gc_process_relocs.
  8293. * gc.h (get_embedded_addend_size): New function.
  8294. (gc_process_relocs): Save the size of the reloc for use by ICF.
  8295. * icf.cc (get_section_contents): Get the addend from the text section
  8296. for SHT_REL relocation sections.
  8297. * icf.h (Icf::Reloc_addend_size_info): New typedef.
  8298. (Icf::Reloc_info): Add new member reloc_addend_size_info.
  8299. * int_encoding.h (read_from_pointer): New overloaded function.
  8300. * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
  8301. * testsuite/icf_sht_rel_addend_test.sh: New file.
  8302. * testsuite/icf_sht_rel_addend_test_1.cc: New file.
  8303. * testsuite/icf_sht_rel_addend_test_2.cc: New file.
  8304. 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  8305. * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
  8306. * Makefile.in: Regenerate.
  8307. * testsuite/Makefile.in: Regenerate.
  8308. 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
  8309. * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
  8310. * testsuite/debug_msg.cc: Likewise.
  8311. * testsuite/odr_violation1.cc
  8312. * testsuite/odr_violation2.cc
  8313. 2010-07-21 Cary Coutant <ccoutant@google.com>
  8314. * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
  8315. string, and length fields.
  8316. (Output_merge_string::Merged_strings_list): New type.
  8317. (Output_merge_string::Merged_strings_lists): New typedef.
  8318. (Output_merge_string): Replace merged_strings_ with
  8319. merged_strings_lists_.
  8320. * merge.cc (Output_merge_string::do_add_input_section): Allocate new
  8321. Merged_strings_list per input object and section. Don't store pointer
  8322. to the string. Don't store length with each merged string entry.
  8323. (Output_merge_string::finalize_merged_data): Loop over list of merged
  8324. strings lists. Recompute length of each merged string.
  8325. 2010-07-15 Cary Coutant <ccoutant@google.com>
  8326. * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
  8327. here.
  8328. 2010-07-14 Ian Lance Taylor <iant@google.com>
  8329. * descriptors.cc (Descriptors::open): Report correct name in error
  8330. message.
  8331. 2010-07-13 Doug Kwan <dougkwan@google.com>
  8332. * arm.cc (Arm_input_section::Arm_input_section): For a
  8333. SHT_ARM_EXIDX section, always keeps the input sections.
  8334. (Arm_input_section::set_exidx_section_link): New method.
  8335. (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
  8336. has_errors_ to false.
  8337. (Arm_exidx_input_section::has_errors,
  8338. Arm_exidx_input_section::set_has_errors): New methods.
  8339. (Arm_exidx_input_section::has_errors_): New data member.
  8340. (Arm_relobj::get_exidx_shndx_list): New method.
  8341. (Arm_output_section::append_text_sections_to_list): Do not skip
  8342. section without SHF_EXECINSTR.
  8343. (Arm_output_section::fix_exidx_coverage): Skip input sections with
  8344. errors.
  8345. (Arm_relobj::make_exidx_input_section): Add new parameter for text
  8346. section header. Make error messages more verbose. Check for
  8347. a non-executable section linked to an EXIDX section.
  8348. (Arm_relobj::do_read_symbols): Remove error checking, which has been
  8349. moved to Arm_relobj::make_exidx_input_section. Add an assertion to
  8350. check that there is no deferred EXIDX section if we exit early.
  8351. Instead of not making an EXIDX section in case of an error, make one
  8352. and set the has_errors flag of it.
  8353. (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
  8354. in a relocatable link.
  8355. (Target_arm::do_relax): Look for the EXIDX output section instead of
  8356. assuming that it is called .ARM.exidx.
  8357. (Target_arm::fix_exidx_coverage): Add a new parameter for input
  8358. section list. Do not check for SHF_EXECINSTR section flags but
  8359. skip any input section with errors.
  8360. * output.cc (Output_section::Output_section): Initialize
  8361. always_keeps_input_sections_ to false.
  8362. (Output_section::add_input_section): Check for
  8363. always_keeps_input_sections_.
  8364. * output.h (Output_section::always_keeps_input_sections,
  8365. Output_section::set_always_keeps_input_sections): New methods.
  8366. (Output_section::always_keeps_input_sections): New data member.
  8367. 2010-07-13 Rafael Espindola <espindola@google.com>
  8368. * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
  8369. * fileread.h (Input_file): Add try_extra_search_path and find_file.
  8370. 2010-07-13 Philip Herron <herron.philip@googlemail.com>
  8371. Ian Lance Taylor <iant@google.com>
  8372. * output.h (Output_section_lookup_maps::add_merge_section):
  8373. Correct check of whether value was inserted.
  8374. (Output_section_lookup_maps::add_merge_input_section): Likewise.
  8375. (Output_section_lookup_maps::add_relaxed_input_section):
  8376. Likewise.
  8377. * arm.cc (Target_arm::got_section): Remove used local os.
  8378. * i386.cc (Target_i386::got_section): Likewise.
  8379. * x86_64.cc (Target_x86_64::got_section): Likewise.
  8380. * sparc.cc (Target_sparc::got_section): Likewise.
  8381. (Target_sparc::relocate): Remove unused local have_got_offset.
  8382. * powerpc.cc (Target_powerpc::relocate): Likewise.
  8383. 2010-07-13 Ian Lance Taylor <iant@google.com>
  8384. * compressed_output.cc (zlib_decompress): Fix signature in
  8385. !HAVE_ZLIB_H case.
  8386. * archive.cc (Archive::include_member): Unlock an external member
  8387. of a thin archive. Don't bother to delete an object we know is
  8388. NULL.
  8389. 2010-07-12 Cary Coutant <ccoutant@google.com>
  8390. * compressed_output.cc (zlib_decompress): New function.
  8391. (get_uncompressed_size): New function.
  8392. (decompress_input_section): New function.
  8393. * compressed_output.h (get_uncompressed_size): New function.
  8394. (decompress_input_section): New function.
  8395. * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
  8396. Handle compressed debug sections.
  8397. * layout.cc (is_compressed_debug_section): New function.
  8398. (Layout::output_section_name): Map compressed section names to
  8399. canonical names.
  8400. * layout.h (is_compressed_debug_section): New function.
  8401. (is_debug_info_section): Recognize compressed debug sections.
  8402. * merge.cc: Include compressed_output.h.
  8403. (Output_merge_data::do_add_input_section): Handle compressed
  8404. debug sections.
  8405. (Output_merge_string::do_add_input_section): Handle compressed
  8406. debug sections.
  8407. * object.cc: Include compressed_output.h.
  8408. (Sized_relobj::Sized_relobj): Initialize new data members.
  8409. (build_compressed_section_map): New function.
  8410. (Sized_relobj::do_read_symbols): Handle compressed debug sections.
  8411. * object.h (Object::section_is_compressed): New method.
  8412. (Object::do_section_is_compressed): New method.
  8413. (Sized_relobj::Compressed_section_map): New type.
  8414. (Sized_relobj::do_section_is_compressed): New method.
  8415. (Sized_relobj::compressed_sections_): New data member.
  8416. * output.cc (Output_section::add_input_section): Handle compressed
  8417. debug sections.
  8418. * reloc.cc: Include compressed_output.h.
  8419. (Sized_relobj::write_sections): Handle compressed debug sections.
  8420. 2010-07-08 Cary Coutant <ccoutant@google.com>
  8421. * resolve.cc (Symbol_table::resolve): Remember whether undef was
  8422. weak when resolving to a dynamic def.
  8423. (Symbol_table::should_override): Add adjust_dyndef flag; set it
  8424. for weak undef/dynamic def cases. Adjust callers.
  8425. * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
  8426. undef_binding_weak_.
  8427. (Symbol_table::sized_write_globals): Adjust symbol binding.
  8428. (Symbol_table::sized_write_symbol): Add binding parameter.
  8429. * symtab.h (Symbol::set_undef_binding): New method.
  8430. (Symbol::is_undef_binding_weak): New method.
  8431. (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
  8432. (Symbol_table::should_override): Add new parameter.
  8433. (Symbol_table::sized_write_symbol): Add new parameter.
  8434. * testsuite/weak_undef_file1.cc: Add new test case.
  8435. * testsuite/weak_undef_file2.cc: Fix header comment.
  8436. * testsuite/weak_undef_test.cc: Add new test case.
  8437. 2010-06-29 Doug Kwan <dougkwan@google.com>
  8438. * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
  8439. Initialize USE_SYMBOL_.
  8440. * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
  8441. definition.
  8442. (Arm_reloc_property::uses_symbol_): New data member declaration.
  8443. * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
  8444. uses symbol value and symbol is undefined but not weakly undefined.
  8445. 2010-06-28 Rafael Espindola <espindola@google.com>
  8446. * plugin.cc (Plugin::load): Use dlerror.
  8447. 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
  8448. * symtab.cc (detect_odr_violations): When reporting an ODR
  8449. violation, report an object where the symbol is defined.
  8450. 2010-06-25 Doug Kwan <dougkwan@google.com>
  8451. * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
  8452. (Target_arm::section_may_have_icf_unsafe_pointers): New method
  8453. definition.
  8454. (Target_arm::Scan::local_reloc_may_be_function_pointer,
  8455. Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
  8456. target hook to detect function points.
  8457. (Target_arm::Scan::possible_function_pointer_reloc): New method.
  8458. * icf.h (Icf::check_section_for_function_pointers): Change type of
  8459. parameter SECTION_NAME to const reference to std::string. Use
  8460. target hook to determine if section may have unsafe pointers.
  8461. * target.h (Target::section_may_have_icf_unsafe_pointers): New
  8462. method definition.
  8463. 2010-06-21 Rafael Espindola <espindola@google.com>
  8464. * fileread.cc (Input_file::find_fie): New
  8465. (Input_file::open): Use Input_file::find_fie.
  8466. * fileread.h (Input_file::find_fie): New
  8467. * plugin.cc (set_extra_library_path): New.
  8468. (Plugin::load): Add set_extra_library_path to the transfer vector.
  8469. (Plugin_manager::set_extra_library_path): New.
  8470. (Plugin_manager::add_input_file): Use the extra search path if set.
  8471. (set_extra_library_path(): New.
  8472. * plugin.h (Plugin_manager): Add set_extra_library_path and
  8473. extra_search_path_.
  8474. 2010-06-19 Cary Coutant <ccoutant@google.com>
  8475. * layout.cc (gdb_sections): Add .debug_types.
  8476. (lines_only_debug_sections): Likewise.
  8477. 2010-06-18 Rafael Espindola <espindola@google.com>
  8478. * plugin.cc (add_input_file,add_input_library)
  8479. (Plugin_manager::add_input_file): Make filename arguments const.
  8480. * plugin.h (Plugin_manager::add_input_file): Make filename arguments
  8481. const.
  8482. 2010-06-16 Doug Kwan <dougkwan@google.com>
  8483. * arm.cc (Target_arm::do_finalize_sections): Do not emit an
  8484. .ARM.attributes section if we have not merged any input
  8485. attributes sections.
  8486. 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  8487. * arm.cc: Allow combining objects with no EABI version
  8488. information.
  8489. 2010-06-15 Rafael Espindola <espindola@google.com>
  8490. * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
  8491. 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  8492. * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
  8493. (struct iovec): Correct !HAVE_READV definition.
  8494. 2010-06-10 Cary Coutant <ccoutant@google.com>
  8495. * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
  8496. (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
  8497. reloc sections.
  8498. * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
  8499. PR 11683
  8500. * symtab.h (Symbol::is_placeholder): New member function.
  8501. * target-reloc.h (relocate_section): Check for placeholder symbols.
  8502. * testsuite/Makefile.am (plugin_test_8): New test.
  8503. (plugin_test_9): New test.
  8504. * testsuite/Makefile.in: Regenerate.
  8505. 2010-06-09 Nick Clifton <nickc@redhat.com>
  8506. * yyscript.y (input_list_element): Allow strings prefixed with
  8507. the '-' character. Treat these as libraries.
  8508. * script.cc (script_add_library): New function. Adds a library
  8509. specified by "-l<name>" found in an input script.
  8510. * script-c.h: Add prototype for script_add_library.
  8511. 2010-06-07 Doug Kwan <dougkwan@google.com>
  8512. * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
  8513. Restrict stub-group size to be within long conditional branch
  8514. range when working around cortex-A8 erratum.
  8515. 2010-06-07 Damien Diederen <dd@crosstwine.com>
  8516. * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
  8517. #ifdef typo.
  8518. 2010-06-03 Sriraman Tallam <tmsriram@google.com>
  8519. PR gold/11658
  8520. * output.cc
  8521. (Output_section::Input_section_sort_entry::compare_section_ordering):
  8522. Change to return non-zero correctly.
  8523. (Output_section::Input_section_sort_section_order_index_compare
  8524. ::operator()): Change to fix ambiguity in comparisons.
  8525. 2010-06-01 Sriraman Tallam <tmsriram@google.com>
  8526. * gold.h (is_wildcard_string): New function.
  8527. * layout.cc (Layout::layout): Pass this pointer to add_input_section.
  8528. (Layout::layout_eh_frame): Ditto.
  8529. (Layout::find_section_order_index): New method.
  8530. (Layout::read_layout_from_file): New method.
  8531. * layout.h (Layout::find_section_order_index): New method.
  8532. (Layout::read_layout_from_file): New method.
  8533. (Layout::input_section_position_): New private member.
  8534. (Layout::input_section_glob_): New private member.
  8535. * main.cc (main): Call read_layout_from_file here.
  8536. * options.h (--section-ordering-file): New option.
  8537. * output.cc (Output_section::input_section_order_specified_): New
  8538. member.
  8539. (Output_section::Output_section): Initialize new member.
  8540. (Output_section::add_input_section): Add new parameter.
  8541. Keep input sections when --section-ordering-file is used.
  8542. (Output_section::set_final_data_size): Sort input sections when
  8543. section ordering file is specified.
  8544. (Output_section::Input_section_sort_entry): Add new parameter.
  8545. Check sorting type.
  8546. (Output_section::Input_section_sort_entry::compare_section_ordering):
  8547. New method.
  8548. (Output_section::Input_section_sort_compare::operator()): Change to
  8549. consider section_order_index.
  8550. (Output_section::Input_section_sort_init_fini_compare::operator()):
  8551. Change to consider section_order_index.
  8552. (Output_section::Input_section_sort_section_order_index_compare
  8553. ::operator()): New method.
  8554. (Output_section::sort_attached_input_sections): Change to sort
  8555. according to section order when specified.
  8556. (Output_section::add_input_section<32, true>): Add new parameter.
  8557. (Output_section::add_input_section<64, true>): Add new parameter.
  8558. (Output_section::add_input_section<32, false>): Add new parameter.
  8559. (Output_section::add_input_section<64, false>): Add new parameter.
  8560. * output.h (Output_section::add_input_section): Add new parameter.
  8561. (Output_section::input_section_order_specified): New
  8562. method.
  8563. (Output_section::set_input_section_order_specified): New method.
  8564. (Input_section::Input_section): Initialize section_order_index_.
  8565. (Input_section::section_order_index): New method.
  8566. (Input_section::set_section_order_index): New method.
  8567. (Input_section::section_order_index_): New member.
  8568. (Input_section::Input_section_sort_section_order_index_compare): New
  8569. struct.
  8570. (Output_section::input_section_order_specified_): New member.
  8571. * script-sections.cc (is_wildcard_string): Delete and move modified
  8572. method to gold.h.
  8573. (Output_section_element_input::Output_section_element_input): Modify
  8574. call to is_wildcard_string.
  8575. (Output_section_element_input::Input_section_pattern
  8576. ::Input_section_pattern): Ditto.
  8577. (Output_section_element_input::Output_section_element_input): Ditto.
  8578. * testsuite/Makefile.am (final_layout): New test case.
  8579. * testsuite/Makefile.in: Regenerate.
  8580. * testsuite/final_layout.cc: New file.
  8581. * testsuite/final_layout.sh: New file.
  8582. 2010-06-01 Rafael Espindola <espindola@google.com>
  8583. * plugin.cc (Plugin::load): Pass the output name to the plugin.
  8584. 2010-06-01 Rafael Espindola <espindola@google.com>
  8585. * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
  8586. visibility of symbols.
  8587. 2010-05-27 Doug Kwan <dougkwan@google.com>
  8588. * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
  8589. from start of output section instead of address for a local symbol
  8590. in a merged or relaxed section when doing a relocatable link.
  8591. 2010-05-26 Rafael Espindola <espindola@google.com>
  8592. PR 11604
  8593. * object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
  8594. adding sections the garbage collector removed.
  8595. * testsuite/Makefile.am: Add test.
  8596. * testsuite/Makefile.in: Regenerate.
  8597. * testsuite/plugin_test_7.sh: New.
  8598. * testsuite/plugin_test_7_1.c: New.
  8599. * testsuite/plugin_test_7_2.c: New.
  8600. 2010-05-26 Rafael Espindola <espindola@google.com>
  8601. * script-sections.cc (Output_section_definition::set_section_addresses):
  8602. Check for --section-start.
  8603. 2010-05-26 Doug Kwan <dougkwan@google.com>
  8604. * arm.cc (Arm_scan_relocatable_relocs): New class.
  8605. (Target_arm::relocate_special_relocatable): New method.
  8606. (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
  8607. (Arm_relocate_functions::thumb_branch_common): Same.
  8608. (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
  8609. instead of Default_scan_relocatable_relocs.
  8610. * target-reloc.h (relocate_for_relocatable): Let target handle
  8611. relocation strategy Relocatable_relocs::RELOC_SPECIAL.
  8612. * target.h (Sized_target::relocate_special_relocatable): New method.
  8613. 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  8614. * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
  8615. 2010-05-23 Doug Kwan <dougkwan@google.com>
  8616. * arm.cc (Arm_input_section::do_output_offset): Use convert_types
  8617. instead of a cast.
  8618. (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
  8619. with a direct branch, not a conditional branch, to a stub.
  8620. * merge.cc (Output_merge_base::record_input_section): New method
  8621. defintion.
  8622. (Output_merge_data::do_add_input_section): Record input section if
  8623. keeps-input-sections flag is set.
  8624. (Output_merge_string::do_add_input_section): Ditto.
  8625. * merge.h (Output_merge_base::Output_merge_base): Initialize new data
  8626. members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
  8627. INPUT_SECTIONS_.
  8628. (Output_merge_base::keeps_input_sections,
  8629. Output_merge_base::set_keeps_input_sections,
  8630. Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
  8631. method definitions.
  8632. (Output_merge_base::Input_sections): New type declaration.
  8633. (Output_merge_base::input_sections_begin,
  8634. Output_merge_base::input_sections_end,
  8635. Output_merge_base::do_set_keeps_input_sections): New method definitions.
  8636. (Output_merge_base::bool keeps_input_sections_,
  8637. Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
  8638. Output_merge_base::input_sections_): New data members.
  8639. (Output_merge_data::do_set_keeps_input_sections): New method
  8640. defintion.
  8641. (Output_merge_string::do_set_keeps_input_sections): Ditto.
  8642. * output.cc (Output_section::Input_section::relobj): Move method
  8643. defintion from class declaration to here and handle merge sections.
  8644. (Output_section::Input_section::shndx): Ditto.
  8645. (Output_section::Output_section): Remove initializations of removed
  8646. data members and initialize new data member LOOKUP_MAPS_.
  8647. (Output_section::add_input_section): Set keeps-input-sections flag
  8648. for a newly created merge output section as appropriate. Adjust code
  8649. to use Output_section_lookup_maps class.
  8650. (Output_section::add_relaxed_input_section): Adjst code for lookup
  8651. maps code refactoring.
  8652. (Output_section::add_merge_input_section): Add a new parameter
  8653. KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
  8654. class. If adding input section to a newly created merge output
  8655. section fails, remove the new merge section.
  8656. (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
  8657. Adjust code for use of the Output_section_lookup_maps class.
  8658. (Output_section::find_merge_section): Ditto.
  8659. (Output_section::build_lookup_maps): New method defintion.
  8660. (Output_section::find_relaxed_input_section): Adjust code to use
  8661. Output_section_lookup_maps class.
  8662. (Output_section::get_input_sections): Export merge sections. Adjust
  8663. code to use Output_section_lookup_maps class.
  8664. (Output_section:::add_script_input_section): Adjust code to use
  8665. Output_section_lookup_maps class. Update lookup maps for merge
  8666. sections also.
  8667. (Output_section::discard_states): Use Output_section_lookup_maps.
  8668. (Output_section::restore_states): Same.
  8669. * output.h (Merge_section_properties): Move class defintion out of
  8670. Output_section.
  8671. (Output_section_lookup_maps): New class.
  8672. (Output_section::Input_section::is_merge_section): New method
  8673. defintion.
  8674. (Output_section::Input_section::relobj): Move defintion out of class
  8675. defintion. Declare method only.
  8676. (Output_section::Input_section::shndx): Ditto.
  8677. (Output_section::Input_section::output_merge_base): New method defintion.
  8678. (Output_section::Input_section::u2_.pomb): New union field.
  8679. (Output_section::Merge_section_by_properties_map,
  8680. Output_section::Output_section_data_by_input_section_map,
  8681. Output_section::Ouptut_relaxed_input_section_by_input_section_map):
  8682. Remove types.
  8683. (Output_section::add_merge_input_section): Add new parameter
  8684. KEEPS_INPUT_SECTIONS.
  8685. (Output_section::build_lookup_maps): New method declaration.
  8686. (Output_section::merge_section_map_,
  8687. Output_section::merge_section_by_properties_map_,
  8688. Output_section::relaxed_input_section_map_,
  8689. Output_section::is_relaxed_input_section_map_valid_): Remove data
  8690. members.
  8691. (Output_section::lookup_maps_): New data member.
  8692. 2010-05-21 Doug Kwan <dougkwan@google.com>
  8693. PR gold/11619
  8694. * arm.cc (Arm_input_section::do_output_offset): Add a cast to
  8695. avoid a compilation error.
  8696. 2010-05-19 Rafael Espindola <espindola@google.com>
  8697. * script-sections.cc (Output_section_definition::allocate_to_segment):
  8698. Update the phdrs_list even when the output section is NULL.
  8699. * testsuite/Makefile.am: Add test.
  8700. * testsuite/Makefile.in: Regenerate.
  8701. * testsuite/script_test_9.cc: New.
  8702. * testsuite/script_test_9.sh: New.
  8703. * testsuite/script_test_9.t: New.
  8704. 2010-05-19 Doug Kwan <dougkwan@google.com>
  8705. * arm.cc (Arm_input_section::original_size): New method.
  8706. (Arm_input_section::do_addralign): Add a cast.
  8707. (Arm_input_section::do_output_offset): Remove static cast.
  8708. (Arm_input_section::original_addralign,
  8709. Arm_input_section::original_size_): Change type to uint32_t.
  8710. (Arm_input_section::init): Add safe casts for section alignment
  8711. and size.
  8712. (Arm_input_section::set_final_data_size): Do not set address and
  8713. offset of stub table.
  8714. (Arm_output_section::fix_exidx_coverage): Change use of of
  8715. Output_section::Simple_input_section to that of
  8716. Output_section::Input_section.
  8717. (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
  8718. except for the first pass.
  8719. * output.cc (Output_section::get_input_sections): Change type of
  8720. input_sections to std::list<Input_section>.
  8721. (Output_section::add_script_input_section): Rename from
  8722. Output_section::add_simple_input_section. Change type of SIS
  8723. parameter from Simple_input_section to Input_section.
  8724. * output.h (Output_section::Simple_input_section): Remove class.
  8725. (Output_section::Input_section): Change class visibility to public.
  8726. (Output_section::Input_section::addralign): Use stored alignments
  8727. for special input sections if set.
  8728. (Output_section::Input_section::set_addralign): New method.
  8729. (Output_section::get_input_sections): Change parameter type from
  8730. list of Simple_input_section to list of Input_section.
  8731. (Output_section::add_script_input_section): Rename from
  8732. Output_section::add_simple_input_section. Change first parameter's
  8733. type from Simple_input_section to Input_section and remove the
  8734. second and third parameters.
  8735. * script-sections.cc (Input_section::Input_section_list): Change
  8736. type to list of Output_section::Input_section/
  8737. (Input_section_info::Input_section_info): Change parameter type of
  8738. INPUT_SECTION to Output_section::Input_section.
  8739. (Input_section_info::input_section): Change return type.
  8740. (Input_section_info::input_section_): Change type to
  8741. Output_section::Input_section.
  8742. (Output_section_element_input::set_section_addresses): Adjust code
  8743. to use Output_section::Input_section instead of
  8744. Output_section::Simple_input_section. Adjust code for renaming
  8745. of Output_section::add_simple_input_section.
  8746. (Orphan_output_section::set_section_addresses): Ditto.
  8747. 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  8748. * gold.h (Unordered_multimap, Unordered_map): Fix defines for
  8749. when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
  8750. 2010-05-18 Rafael Espindola <espindola@google.com>
  8751. * options.cc (General_options::finalize): Handle -nostdlib.
  8752. * options.h (nostdlib): New option.
  8753. * script.cc (script_add_search_dir): Handle -nostdlib.
  8754. 2010-05-12 Doug Kwan <dougkwan@google.com>
  8755. * arm.cc (Target_arm::do_finalize_sections): Create an empty
  8756. attributes section only if there no attributes section after merging.
  8757. (Target_arm::merge_object_attributes): Move value of
  8758. Tag_MPextension_use_legacy to that of Tag_MPextension_use.
  8759. Handle Tag_DIV_use and Tag_MPextension_use_legacy.
  8760. * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
  8761. (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
  8762. and arm_attr_merge_7.stdout.
  8763. (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
  8764. arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
  8765. arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
  8766. arm_attr_merge_7b.o): New rules.
  8767. (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
  8768. arm_attr_merge_7
  8769. * testsuite/Makefile.in: Regenerate.
  8770. * testsuite/arm_attr_merge.sh: New file.
  8771. * testsuite/arm_attr_merge_[67][ab].s: Same.
  8772. 2010-05-05 Nick Clifton <nickc@redhat.com>
  8773. * po/es.po: Updated Spanish translation.
  8774. 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
  8775. * Makefile.am (install-exec-local): Properly install gold as
  8776. default cross linker.
  8777. * Makefile.in: Regenerated.
  8778. 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
  8779. Nick Clifton <nickc@redhat.com>
  8780. * configure.ac (install_as_default): Define and set to false
  8781. unless --enable-gold or --enable-gold=both/gold has been
  8782. specified.
  8783. * configure: Regenerate.
  8784. * Makefile.am (install-exec-local): Install the executable as
  8785. 'ld.gold'. If install_as_default is true then also install it as
  8786. 'ld'.
  8787. * Makefile.in: Regenerated.
  8788. 2010-04-24 Ian Lance Taylor <iant@google.com>
  8789. * layout.cc (Layout::layout_reloc): In relocatable link don't
  8790. combine reloc sections for grouped sections.
  8791. 2010-04-23 Sriraman Tallam <tmsriram@google.com>
  8792. * gc.h (gc_process_relocs): Pass information on relocs pointing to
  8793. sections that are not ordinary to icf.
  8794. * icf.cc (get_section_contents): Handle relocation pointing to section
  8795. with no object or shndx information.
  8796. * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
  8797. * testsuite/Makefile.in: Regenerate.
  8798. * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
  8799. * testsuite/icf_virtual_function_folding_test.sh: Delete file.
  8800. 2010-04-22 Ian Lance Taylor <iant@google.com>
  8801. * expression.cc (Expression::Expression_eval_info): Add
  8802. result_alignment_pointer field.
  8803. (Expression::eval_with_dot): Add result_alignment_pointer
  8804. parameter. Change all callers.
  8805. (Expression::eval_maybe_dot): Likewise.
  8806. (class Binary_expression): Add alignment_pointer parameter to
  8807. left_value and right_value. Change all callers.
  8808. (BINARY_EXPRESSION): Set result alignment.
  8809. (class Trinary_expression): Add alignment_pointer parameter to
  8810. arg2_value and arg3_value. Change all callers.
  8811. (Trinary_cond::value): Set result alignment.
  8812. (Max_expression::value, Min_expression::value): Likewise.
  8813. (Align_expression::value): Likewise.
  8814. * script-sections.cc (class Sections_element): Add dot_alignment
  8815. parameter to set_section_addresses virtual function. Update
  8816. instantiations.
  8817. (class Output_section_element): Likewise.
  8818. (Script_sections::create_segments): Add dot_alignment parameter.
  8819. Change all callers.
  8820. (Script_sections::create_segments_from_phdrs_clause): Likewise.
  8821. (Script_sections::set_phdrs_clause_addresses): Likewise.
  8822. * script-sections.h: Update declarations.
  8823. * script.h: Update declarations.
  8824. * output.h (Output_segment::set_minimum_p_align): Don't decrease
  8825. min_p_align.
  8826. * testsuite/script_test_3.t: Set large alignment.
  8827. * testsuite/script_test_3.sh: Make sure that at least one LOAD
  8828. segment has expected alignment.
  8829. 2010-04-22 Nick Clifton <nickc@redhat.com>
  8830. * po/gold.pot: Updated by the Translation project.
  8831. * po/vi.po: Updated Vietnamese translation.
  8832. 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
  8833. * testsuite/Makefile.am (check_PROGRAMS): Add
  8834. icf_virtual_function_folding_test.
  8835. * testsuite/Makefile.in: Regenerated.
  8836. 2010-04-15 Andrew Haley <aph@redhat.com>
  8837. * options.h (merge_exidx_entries): New option.
  8838. * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
  8839. (class Arm_exidx_fixup::merge_exidx_entries_): New member.
  8840. (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
  8841. (Target_arm::merge_exidx_entries): New function.
  8842. (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
  8843. (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
  8844. to Arm_exidx_fixup constructor.
  8845. Add new arg, merge_exidx_entries.
  8846. (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
  8847. Arm_output_section::fix_exidx_coverage.
  8848. 2010-04-18 Sriraman Tallam <tmsriram@google.com>
  8849. * icf.cc (get_section_contents): Check for preemptible functions.
  8850. Ignore addend when appropriate.
  8851. * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
  8852. section folded.
  8853. (add_from_relobj): Check for section folded.
  8854. (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
  8855. * symtab.h (should_add_dynsym_entry): Add new parameter.
  8856. * target-reloc.h (scan_relocs): Check for section folded.
  8857. * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
  8858. Check reloc types for function pointers in shared objects.
  8859. * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
  8860. case.
  8861. (icf_preemptible_functions_test): New test case.
  8862. (icf_string_merge_test): New test case.
  8863. * testsuite.Makefile.in: Regenerate.
  8864. * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
  8865. bar_glob. Refactor code.
  8866. * testsuite/icf_preemptible_functions_test.cc: New file.
  8867. * testsuite/icf_preemptible_functions_test.sh: New file.
  8868. * testsuite/icf_string_merge_test.cc: New file.
  8869. * testsuite/icf_string_merge_test.sh: New file.
  8870. * testsuite/icf_virtual_function_folding_test.cc: New file.
  8871. * testsuite/icf_virtual_function_folding_test.sh: New file.
  8872. 2010-04-14 Doug Kwan <dougkwan@google.com>
  8873. * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
  8874. for local symbol recounting if we remove a section due to ICF.
  8875. * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
  8876. there are no regular objects in input.
  8877. 2010-04-13 Doug Kwan <dougkwan@google.com>
  8878. * arm.cc (Arm_input_section::set_final_data_size): Compute
  8879. accurate final data size instead of using current data size.
  8880. 2010-04-09 Doug Kwan <dougkwan@google.com>
  8881. * layout.cc (Layout::choose_output_section): Handle script section
  8882. types.
  8883. (Layout::make_output_section_for_script): Add section type parameter.
  8884. Handle script section types.
  8885. * layout.h (Layout::make_output_section_for_script): Add section
  8886. type parameter.
  8887. * output.cc (Output_section::Output_section): Initialize data member
  8888. is_noload_.
  8889. (Output_section::do_reset_address_and_file_offset): Do not set address
  8890. to 0 if section is a NOLOAD section.
  8891. * output.h (Output_section::is_noload): New method.
  8892. (Output_section::set_is_noload): Ditto.
  8893. (Output_section::is_noload_): New data member.
  8894. * script-c.h (Script_section_type): New enum type.
  8895. (struct Parser_output_section_header): Add new file section_type.
  8896. * script-sections.cc (Sections_element::output_section_name): Add
  8897. parameter for returning script section type.
  8898. (Output_section_definition::output_section_name): Ditto.
  8899. (Output_section_definition::section_type)P; New method.
  8900. (Output_section_definiton::script_section_type_name): Ditto.
  8901. (Output_section_definition::script_section_type_): New data member.
  8902. (Output_section_definition::Output_section_definition): Initialize
  8903. data member Output_section_definition::script_section_type_.
  8904. (Output_section_definition::create_sections): Pass script section type
  8905. to Layout::make_output_section_for_script.
  8906. (Output_section_definition::output_section_name): Return script
  8907. section type to caller.
  8908. (Output_section_definition::set_section_address): Do not advance
  8909. dot value and load address if section type is NOLOAD. Set address
  8910. of NOLOAD sections regardless of section flags.
  8911. (Output_section_definition::print): Print section type if it is
  8912. not SCRIPT_SECTION_TYPE_NONE.
  8913. (Output_section_definition::section_type): New method.
  8914. (Output_section_definition::script_section_type_name): Ditto.
  8915. (Script_sections::output_section_name): Add new parameter
  8916. PSECTION_TYPE for returning script section type. Pass it to
  8917. section elements. Handle discard sections.
  8918. (Sort_output_sections::operator()): Handle NOLOAD sections.
  8919. * script-sections.h (Script_sections::Section_type): New enum type.
  8920. (Script_sections::output_section_name): Add a new parameter for
  8921. returning script section type.
  8922. * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
  8923. INFO and NOLOAD.
  8924. * yyscript.y (union): Add new field SECTION_TYPE.
  8925. (COPY, DSECT, INFO, NOLOAD): New tokens.
  8926. (opt_address_and_section_type): Change type to output_section_header.
  8927. (section_type): New non-terminal
  8928. (section_header): Handle section type.
  8929. (opt_address_and_section_type): Return section type value.
  8930. 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
  8931. * testsuite/plugin_common_test_1.c (foo): Add prototype.
  8932. * testsuite/plugin_common_test_2.c (foo): Likewise.
  8933. 2010-04-08 Doug Kwan <dougkwan@google.com>
  8934. * merge.cc (Output_merge_data::set_final_data_size): Handle empty
  8935. Output_merge_data.
  8936. * output.cc (Output_section::add_merge_input_section): Simplify
  8937. code and return status of Output_merge_base::add_input_section.
  8938. Update merge section map only if Output_merge_base::add_input_section
  8939. returns true.
  8940. 2010-04-07 Doug Kwan <dougkwan@google.com>
  8941. * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
  8942. if section is marked as containing instructions but has no mapping
  8943. symbols.
  8944. (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
  8945. correct section index.
  8946. (Arm_relobj::find_linked_text_section): Ditto.
  8947. 2010-04-07 Cary Coutant <ccoutant@google.com>
  8948. * archive.cc (include_member): Destroy Read_symbols_data object before
  8949. releasing file.
  8950. * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
  8951. * object.h (Read_symbols_data::Read_symbols_data) New constructor.
  8952. (Read_symbols_data::~Read_symbols_data) New destructor.
  8953. (Section_relocs::Section_relocs) New constructor.
  8954. (Section_relocs::~Section_relocs) New destructor.
  8955. (Read_relocs_data::Read_relocs_data) New constructor.
  8956. (Read_relocs_data::~Read_relocs_data) New destructor.
  8957. * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
  8958. pointers to NULL after deleting.
  8959. 2010-04-07 Doug Kwan <dougkwan@google.com>
  8960. * arm.cc: Replace "endianity" with "endianness" in comments.
  8961. (Arm_exidx_cantunwind): Ditto.
  8962. (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
  8963. (Arm_relobj::merge_flags_and_attributes): New method.
  8964. (Arm_relobj::merge_flags_and_attributes_): New data member.
  8965. (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
  8966. (Arm_relobj::scan_sections_for_stubs): Ditto.
  8967. (Arm_relobj::do_read_symbols): Check to see if we really want to
  8968. merge processor-specific flags and attributes. Exit early if
  8969. an object is empty except for section names and the undefined symbol.
  8970. (Target_arm::do_finalize_sections): Move check for ELF format to
  8971. Arm_relobj::do_read_symbols. Merge processor specific flags and
  8972. attributes from a regular object only when we have determined that
  8973. it is aapropriate. Do not create an .ARM.attributes section in
  8974. output if there is no regular input object.
  8975. (Target_arm::merge_processor_specific_flags): Check
  8976. --warn-mismatch before printing any error.
  8977. (Target_arm::merge_object_attributes): Ditto.
  8978. * gold.cc (queue_middle_tasks): Handle the case in which there is
  8979. no regular object in input.
  8980. * options.cc (General_options::parse_EB): New method.
  8981. (General_options::parse_EL): Same.
  8982. (General_options::General_options): Initialize endianness_.
  8983. * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
  8984. New options.
  8985. (General_options::Endianness): New enum.
  8986. (General_options::endianness): New method.
  8987. (General_options::endianness_): New data member.
  8988. * parameters.cc (Parameters::set_options): Check target endianness.
  8989. (Parameters::set_target_once): Ditto.
  8990. (Parameters::check_target_endianness): New method.
  8991. (parameters_force_valid_target): If either -EL or -EB is specified,
  8992. use it to define endianness of default target.
  8993. * parameters.h (Parameters::check_target_endianness): New method
  8994. declaration.
  8995. * target.h (class Target): Change "endianity" to "endianness"
  8996. in comments.
  8997. 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  8998. * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
  8999. * configure: Regenerate.
  9000. * Makefile.in: Regenerate.
  9001. * testsuite/Makefile.in: Regenerate.
  9002. 2010-04-06 Cary Coutant <ccoutant@google.com>
  9003. gcc PR lto/42757
  9004. * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
  9005. prevailing definitions of common symbols.
  9006. * testsuite/plugin_test_6.sh: New test case.
  9007. * testsuite/plugin_common_test_1.c: New test case.
  9008. * testsuite/plugin_common_test_2.c: New test case.
  9009. * testsuite/Makefile.am (plugin_test_6): New test case.
  9010. * testsuite/Makefile.in: Regenerate.
  9011. 2010-04-06 Nick Clifton <nickc@redhat.com>
  9012. * po/vi.po: New Vietnamese translation.
  9013. 2010-03-30 Doug Kwan <dougkwan@google.com>
  9014. * arm.cc (Target_arm::using_thumb_only): Handle v6-M
  9015. 2010-03-25 Doug Kwan <dougkwan@google.com>
  9016. * arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
  9017. to avoid a conversion warning on a 32-bit host.
  9018. 2010-03-24 Ian Lance Taylor <iant@google.com>
  9019. * testsuite/script_test_3.t: Add a TLS segment.
  9020. * testsuite/Makefile.am (check_PROGRAMS): Add
  9021. tls_phdrs_script_test.
  9022. (tls_phdrs_script_test_SOURCES): Define.
  9023. (tls_phdrs_script_test_DEPENDENCIES): Define.
  9024. (tls_phdrs_script_test_LDFLAGS): Define.
  9025. (tls_phdrs_script_test_LDADD): Define.
  9026. * testsuite/Makefile.in: Rebuild.
  9027. 2010-03-23 Cary Coutant <ccoutant@google.com>
  9028. * fileread.cc (find_or_make_view): Fix comment.
  9029. 2010-03-23 Ian Lance Taylor <iant@google.com>
  9030. * script-sections.cc (class Orphan_section_placement): Define
  9031. PLACE_TLS and PLACE_TLS_BSS.
  9032. (Orphan_section_placement::Orphan_section_placement): Initialize
  9033. new places.
  9034. (Orphan_section_placement::find_place): Handle SHF_TLS sections.
  9035. * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
  9036. (tls_script_test_SOURCES): Define.
  9037. (tls_script_test_DEPENDENCIES): Define.
  9038. (tls_script_test_LDFLAGS): Define.
  9039. (tls_script_test_LDADD): Define.
  9040. * testsuite/Makefile.in: Rebuild.
  9041. 2010-03-22 Doug Kwan <dougkwan@google.com>
  9042. * arm.cc (Arm_relocate_functions::abs8,
  9043. Arm_relocate_functions::abs16): Use correct check for overflow
  9044. specified in the ARM ELF specs.
  9045. (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
  9046. target of a BLX instruction specially.
  9047. (Reloc_stub::stub_type_for_reloc): Ditto.
  9048. (Relocate::relocate): Use symbolic names instead of numeric relocation
  9049. codes to report error.
  9050. (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
  9051. workaround.
  9052. * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
  9053. thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
  9054. thumb2_blx_out_of_range.stdout
  9055. (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
  9056. thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
  9057. (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
  9058. thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
  9059. thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
  9060. thumb2_blx_in_range, thumb2_blx_in_range.o,
  9061. thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
  9062. thumb2_blx_out_of_range.o): New rules.
  9063. (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
  9064. thumb2_blx_in_range and thumb2_blx_out_of_range.
  9065. * testsuite/Makefile.in: Regenerate.
  9066. * arm_branch_in_range.sh: Add tests for THUMB BLX.
  9067. * testsuite/thumb_blx_in_range.s: New file.
  9068. * testsuite/thumb_blx_out_of_range.s: New file.
  9069. 2010-03-22 Rafael Espindola <espindola@google.com>
  9070. * archive.cc (Should_include): Move to archive.h.
  9071. (should_include_member): Make it a member of Archive.
  9072. (Lib_group): New.
  9073. (Add_lib_group_symbols): New.
  9074. * archive.h: Include options.h.
  9075. (Archive_member): Moved from Archive.
  9076. (Should_include): Moved from archive.cc.
  9077. (Lib_group): New.
  9078. (Add_lib_group_symbols): New.
  9079. * dynobj.cc (do_should_include_member): New.
  9080. * dynobj.h (do_should_include_member): New.
  9081. * gold.cc (queue_initial_tasks): Update call to queue.
  9082. * main.cc (main): Print lib group stats.
  9083. * object.cc (do_should_include_member): New.
  9084. * object.h: Include archive.h.
  9085. (Object::should_include_member): New.
  9086. (Object::do_should_include_member): New.
  9087. (Sized_relobj::do_should_include_member): New.
  9088. * options.cc (General_options::parse_start_lib): New.
  9089. (General_options::parse_end_lib): New.
  9090. (Input_arguments::add_file): Handle lib groups.
  9091. (Input_arguments::start_group): Check we are not in a lib.
  9092. (Input_arguments::start_lib): New.
  9093. (Input_arguments::end_lib): New.
  9094. * options.h (General_options): Add start_lib and end_lib.
  9095. (Input_argument::lib_): New.
  9096. (Input_argument::lib): New.
  9097. (Input_argument::is_lib): New.
  9098. (Input_file_lib): New.
  9099. (Input_arguments::in_lib_): New.
  9100. (Input_arguments::in_lib): New.
  9101. (Input_arguments::start_lib): New.
  9102. (Input_arguments::end_lib_): New.
  9103. * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
  9104. in unused members as preempted.
  9105. (Sized_pluginobj::do_should_include_member): New.
  9106. * plugin.h (Sized_pluginobj::do_should_include_member): New.
  9107. * readsyms.cc (Read_symbols::locks): If we are just reading a member,
  9108. return the blocker.
  9109. (Read_symbols::do_whole_lib_group): New.
  9110. (Read_symbols::do_lib_group): New.
  9111. (Read_symbols::do_read_symbols): Handle lib groups.
  9112. (Read_symbols::get_name): Handle lib groups.
  9113. * readsyms.h (Read_symbols): Add an archive member pointer.
  9114. (Read_symbols::do_whole_lib_group): New.
  9115. (Read_symbols::do_lib_group): New.
  9116. (Read_symbols::member_): New.
  9117. * script.cc (read_input_script): Update call to queue_soon.
  9118. 2010-03-19 Doug Kwan <dougkwan@google.com>
  9119. * arm.cc (Stub_table::Stub_table): Initialize new data members
  9120. Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
  9121. (Stub_table::add_reloc_stub): Assign stub offset and update
  9122. Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
  9123. (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
  9124. New data members.
  9125. (Stub_table::update_data_size_and_addralign): Use
  9126. Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
  9127. instead of going over all reloc stubs.
  9128. (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
  9129. * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
  9130. Stringpool_template::offset_ to size of Stringpool_char.
  9131. (Stringpool_template::new_key_offset): Remove code to initialize
  9132. Stringpool_template::offset_.
  9133. * stringpool.h (Stringpool_template::set_no_zero_null): Set
  9134. Stringpool_template::offset_ to zero.
  9135. 2010-03-15 Doug Kwan <dougkwan@google.com>
  9136. * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
  9137. offset_.
  9138. (Stringpool_template::new_key_offset): New method.
  9139. (Stringpool_template::add_string): Assign offsets when adding new
  9140. strings.
  9141. (Stringpool_template::set_string_offsets): Do not set string offsets
  9142. when not optimizing.
  9143. * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
  9144. member size_.
  9145. (Chunked_vector::clear): Clear size_.
  9146. (Chunked_vector::reserve): Call reserve method of all Element_vectors.
  9147. (Chunked_vector::size): Return size_.
  9148. (Chunked_vector::push_back): Use size_ to find insert position.
  9149. (Chunked_vector::size_): New data member.
  9150. (Stringpool_template::set_no_zero_null): Assert string set is empty.
  9151. (Stringpool_template::new_key_offset): New method declaration.
  9152. (Stringpool_template::offset_): New data member.
  9153. 2010-03-15 Rafael Espindola <espindola@google.com>
  9154. * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
  9155. Add_symbols' constructor.
  9156. * readsyms.h (Add_symbols): Remove the input_group member.
  9157. 2010-03-10 Ian Lance Taylor <iant@google.com>
  9158. * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
  9159. target to ask whether a reference to a symbol requires a stack
  9160. split.
  9161. * target.h (Target::is_call_to_non_split): New function.
  9162. (Target::do_is_call_to_non_split): Declare virtual function.
  9163. * target.cc: Include "symtab.h".
  9164. (Target::do_is_call_to_non_split): New function.
  9165. * i386.cc (Target_i386::do_is_call_to_non_split): New function.
  9166. 2010-03-10 Cary Coutant <ccoutant@google.com>
  9167. * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
  9168. (File_read::open[1]): Remove initial mapping of whole_file_view_.
  9169. (File_read::open[2]): Add whole_file_view_ to list of views.
  9170. (File_read::make_view): Remove test of whole_file_view_.
  9171. (File_read::find_or_make_view): Create whole_file_view_ if
  9172. necessary.
  9173. (File_read::clear_views): Replace bool parameter with enum;
  9174. adjust all callers. Don't delete views with permanent data;
  9175. do delete cached views and views from archives if
  9176. --no-keep-files-mapped is set. Set whole_file_view_ to NULL
  9177. if clearing the corresponding view.
  9178. * fileread.h (File_read::Clear_views_mode): New enum.
  9179. (File_read::View::is_permanent_view): New method.
  9180. (File_read::clear_views): Replace bool parameter
  9181. with enum; adjust all callers.
  9182. * options.h (General_options): Change keep_files_mapped option;
  9183. add map_whole_files.
  9184. * readsyms.cc (Add_symbols::run): Delete sd_ object before
  9185. releasing the file.
  9186. * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
  9187. the file.
  9188. 2010-03-10 David S. Miller <davem@davemloft.net>
  9189. * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
  9190. 2010-03-09 Sriraman Tallam <tmsriram@google.com>
  9191. * icf.cc (get_section_contents): Add '@' marker after processing the
  9192. merge reloc.
  9193. 2010-03-08 Doug Kwan <dougkwan@google.com>
  9194. * arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
  9195. due to a conversion warning.
  9196. (Arm_relobj::update_output_local_symbol_count): Check for local
  9197. symbol with unset output index.
  9198. 2010-03-05 Ian Lance Taylor <iant@google.com>
  9199. * options.h (class General_options): Add --spare-dynamic-tags.
  9200. * output.cc (Output_data_dynamic::set_final_data_size): Implement
  9201. --spare-dynamic-tags.
  9202. 2010-03-05 Ian Lance Taylor <iant@google.com>
  9203. * incremental.cc: Include "libiberty.h".
  9204. 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
  9205. * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
  9206. function, is_info_ member.
  9207. * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
  9208. (Versions::Versions): Update caller.
  9209. (Versions::define_base_version): Likewise.
  9210. (Versions::add_def): Likewise.
  9211. 2010-03-03 Sriraman Tallam <tmsriram@google.com>
  9212. * i386.cc (Target_i386::can_check_for_function_pointers): New function.
  9213. (Scan::possible_function_pointer_reloc): New function.
  9214. (Scan::local_reloc_may_be_function_pointer): Change to call
  9215. possible_function_pointer_reloc.
  9216. (Scan::global_reloc_may_be_function_pointer): Ditto.
  9217. * icf.h (Icf::check_section_for_function_pointers): Change to reject
  9218. relocations in ".data.rel.ro._ZTV" section.
  9219. * testsuite/icf_safe_so_test.sh: Change to pass i386.
  9220. * testsuite/icf_safe_so_test.cc: Ditto.
  9221. * testsuite/icf_safe_test.cc: Ditto.
  9222. * testsuite/icf_safe_test.sh: Ditto.
  9223. 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9224. Ian Lance Taylor <iant@google.com>
  9225. * target-reloc.h (relocate_section): Check the symbol table index
  9226. for -1U before setting the local symbol index.
  9227. (scan_relocatable_relocs): If copying the relocation, record that
  9228. the local symbol is required.
  9229. * object.h (Symbol_value::is_output_symtab_index_set): New
  9230. function.
  9231. (Symbol_value::may_be_discarded_from_output_symtab): New
  9232. function.
  9233. (Symbol_value::has_output_symtab_entry): New function.
  9234. (Symbol_value::needs_output_symtab_entry): Remove.
  9235. (Symbol_value::output_symtab_index): Make sure the symbol index is
  9236. set.
  9237. (Symbol_value::set_output_symtab_index): Make sure the symbol
  9238. index is not set. Make sure the new index is valid.
  9239. (Symbol_value::set_must_have_output_symtab_entry): New function.
  9240. (Symbol_value::has_output_dynsym_entry): New function.
  9241. (Symbol_value::set_output_dynsym_index): Make sure the new index
  9242. is valid.
  9243. (Sized_relobj::set_must_have_output_symtab_entry): New function.
  9244. * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
  9245. local symbol if permitted.
  9246. (Sized_relobj::do_finalize_local_symbols): Call
  9247. is_output_symtab_index_set rather than needs_output_symtab_entry.
  9248. (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
  9249. rather than needs_output_symtab_entry. Call
  9250. has_output_dynsym_entry rather than needs_output_dynsym_entry.
  9251. * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
  9252. is_output_symtab_index_set rather than needs_output_symtab_entry.
  9253. * testsuite/discard_locals_relocatable_test.c: New file.
  9254. * testsuite/discard_locals_test.sh: Test -r.
  9255. * testsuite/Makefile.am (check_DATA): Add
  9256. discard_locals_relocatable_test1.syms,
  9257. discard_local_relocatable_test2.syms.
  9258. (MOSTLYCLEANFILES): Likewise. Also add
  9259. discard_locals_relocatable_test1.lout and
  9260. discard_locals_relocatable_test2.out.
  9261. (discard_locals_relocatable_test1.syms): New target.
  9262. (discard_locals_relocatable_test.o): New target.
  9263. (discard_locals_relocatable_test1.out): New target.
  9264. (discard_locals_relocatable_test2.syms): New target.
  9265. (discard_locals_relocatable_test2.out): New target.
  9266. (various): Add missing ../ld-new dependencies.
  9267. * testsuite/Makefile.in: Rebuild.
  9268. 2010-03-03 Nick Clifton <nickc@redhat.com>
  9269. * po/fi.po: New Finnish translation.
  9270. 2010-03-01 Doug Kwan <dougkwan@google.com>
  9271. * layout.cc (Layout::Layout): Force section types of .init_array*,
  9272. .preinit_array* and .fini_array* sections.
  9273. * output.cc (Output_section::Input_section_sort_entry::has_priority):
  9274. Fix check of return value of std::string::find.().
  9275. (Output_section::Input_section_sort_compare::operator()): Remove
  9276. comment about .init_array.
  9277. (Output_section::Input_section_sort_init_fini_compare::operator()):
  9278. New method.
  9279. (Output_section::sort_attached_input_sections): Handle .init_array
  9280. and .fini_array specially.
  9281. * output.h (Output_section::Inut_section_sort_compare): Update
  9282. comment.
  9283. (Output_section::Input_section_sort_init_fini_compare): New struct.
  9284. 2010-02-26 Doug Kwan <dougkwan@google.com>
  9285. * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
  9286. R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
  9287. * testsuite/debug_msg.sh: Avoid matching source line number for
  9288. use of global variable undef_int.
  9289. 2010-02-26 Doug Kwan <dougkwan@google.com>
  9290. * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
  9291. R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
  9292. (Target_arm::scan_reloc_section_for_stubs): Instead of calling
  9293. scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
  9294. * options.cc (General_options::General_options): Initialize member
  9295. fix_v4bx_.
  9296. * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
  9297. (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
  9298. and rm_no_fix_v4bx.stdout
  9299. (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
  9300. arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
  9301. arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
  9302. (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
  9303. and arm_no_fix_v4bx.
  9304. * Makefile.in: Regenerate.
  9305. * testsuite/arm_fix_v4bx.s: New file.
  9306. * testsuite/arm_fix_v4bx.sh: Ditto.
  9307. 2010-02-24 Doug Kwan <dougkwan@google.com>
  9308. * arm.cc (Target_arm::got_section): Make the .got section the first
  9309. non RELRO section in the data segment.
  9310. * testsuite/script_test_5.sh: Fix match patterns to avoid matching
  9311. suffixes of section names.
  9312. 2010-02-24 Doug Kwan <dougkwan@google.com>
  9313. * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
  9314. flags and attributes merging if an input file is a binary file.
  9315. * fileread.cc (Input_file::open): Record format of original file.
  9316. * fileread.h (Input_file::Format): New enum type.
  9317. (Input_file::Input_file): Initialize data member format_.
  9318. (Input_file::format): New method definition.
  9319. (Input_file::format_):: New data member.
  9320. 2010-02-24 Doug Kwan <dougkwan@google.com>
  9321. * arm.cc (Arm_output_data_got): New class.
  9322. (ARM_TCB_SIZE): New constant
  9323. (Target_arm): Use Arm_output_data_got instead of Output_data_got.
  9324. (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
  9325. If user uses a script with a SECTIONS clause, issue only a warning
  9326. for a misplaced EXIDX input section. Otherwise, issue an error.
  9327. (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
  9328. garbage collection.
  9329. (Target_arm::got_mode_index_entry): Handle static linking.
  9330. (Target_arm::Scan::local): Ditto.
  9331. (Target_arm::Scan::global): Ditto.
  9332. (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
  9333. all incorrectly implemented relocations.
  9334. (Target_arm::fix_exidx_coverage): Pass layout to
  9335. Arm_output_section::fix_exidx_coverage.
  9336. * layout.cc (Layout::section_name_mapping): Remove trailing dots
  9337. from ".ARM.exidx." and ".ARM.extab.".
  9338. 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9339. * arm.cc (Target_arm::do_finalize_sections): Create attribute
  9340. section if it does not already exist.
  9341. * attributes.cc (Attributes_section_data::Attributes_section_data):
  9342. Don't crash if size is zero.
  9343. 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9344. Ian Lance Taylor <iant@google.com>
  9345. * gold.cc (queue_middle_tasks): If no input files were opened,
  9346. exit.
  9347. * workqueue.h (Task_function::Task_function): Assert that there is
  9348. a blocker.
  9349. 2010-02-22 Doug Kwan <dougkwan@google.com>
  9350. * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
  9351. * icf.cc (get_section_contents): Cast snprintf arguments to long long
  9352. types to avoid warnings due to different uint64_t implementations
  9353. on different hosts.
  9354. 2010-02-21 Doug Kwan <dougkwan@google.com>
  9355. * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
  9356. handling of the maximum backward branch offset.
  9357. (Arm_relocate_functions::thumb_branch_common): Ditto.
  9358. * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
  9359. (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
  9360. thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
  9361. thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
  9362. (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
  9363. arm_bl_out_of_range.stdout, arm_bl_out_of_range,
  9364. arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
  9365. thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
  9366. thumb_bl_out_of_range thumb_bl_out_of_range.o,
  9367. thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
  9368. thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
  9369. thumb2_bl_out_of_range.o): New rules.
  9370. (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
  9371. thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
  9372. thumb2_bl_out_of_range
  9373. * testsuite/Makefile.in: Regenerate.
  9374. * testsuite/arm_bl_in_range.s: New file.
  9375. * testsuite/arm_bl_out_of_range.s: Ditto.
  9376. * testsuite/arm_branch_in_range.sh: Ditto.
  9377. * testsuite/arm_branch_range.t: Ditto.
  9378. * testsuite/thumb2_branch_range.t: Ditto.
  9379. * testsuite/thumb_bl_in_range.s: Ditto.
  9380. * testsuite/thumb_bl_out_of_range.s: Ditto.
  9381. * testsuite/thumb_branch_range.t: Ditto.
  9382. 2010-02-20 Sriraman Tallam <tmsriram@google.com>
  9383. * gc.h (gc_process_relocs): Change vectors to point to the new list.
  9384. Add reloc offset information.
  9385. * icf.cc (get_section_contents): Change iterators to point to the new
  9386. vectors. Add reloc offset information to the contents.
  9387. * icf.h (Icf::Sections_reachable_info): New typedef.
  9388. (Icf::Sections_reachable_list): New typedef.
  9389. (Icf::Offset_info): New typedef.
  9390. (Icf::Reloc_info): New struct typedef.
  9391. (Icf::Reloc_info_list): New typedef.
  9392. (Icf::symbol_reloc_list): Delete method.
  9393. (Icf::addend_reloc_list): Delete method.
  9394. (Icf::section_reloc_list): Delete method.
  9395. (Icf::reloc_info_list): New method.
  9396. (Icf::reloc_info_list_): New member.
  9397. 2010-02-19 Doug Kwan <dougkwan@google.com>
  9398. * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
  9399. R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
  9400. * arm.cc (Arm_relocation_functions): New forward declaration.
  9401. (Target_arm::Target_arm): Initialize new data members
  9402. got_mod_index_offset_ and tls_base_symbol_defined_.
  9403. (Target_arm::Relocate::relocate_tls): New method.
  9404. (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
  9405. Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
  9406. New methods.
  9407. (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
  9408. GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
  9409. (Target_arm::got_mod_index_offset_,
  9410. Target_arm::tls_base_symbol_defined_): New data members.
  9411. (Target_arm::Scan::local, Target::Scan::global,
  9412. Target_arm::Relocate::relocate): Handle 32-bit initial TLS
  9413. relocations.
  9414. 2010-02-18 Doug Kwan <dougkwan@google.com>
  9415. * arm.cc (Arm_relobj::find_linked_text_section): New method.
  9416. (Arm_relobj::make_exidx_input_section): Pass section index of linked
  9417. text section as a parameter becuase some broken tools may not set
  9418. the link in section header.
  9419. (Target_arm::has_got_section): New method.
  9420. (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
  9421. without any mapping symbol as data only. Remove warning.
  9422. (Arm_relobj::do_read_synbols): If an EXIDX input section has no
  9423. link in its section header, try to discover the link by inspecting the
  9424. REL31 relocation at the beginning of the section.
  9425. (Target_arm::Scan::check_non_pic): Report name of offending relocation
  9426. in error message.
  9427. (Target_arm::Scan::global): Treat any reference to the symbol
  9428. _GLOBAL_OFFSET_TABLE_ as a GOT access.
  9429. 2010-02-12 Sriraman Tallam <tmsriram@google.com>
  9430. * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
  9431. (Scan::global_reloc_may_be_function_pointer): New function.
  9432. * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
  9433. (Scan::global_reloc_may_be_function_pointer): New function.
  9434. * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
  9435. (Scan::global_reloc_may_be_function_pointer): New function.
  9436. * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
  9437. (Scan::global_reloc_may_be_function_pointer): New function.
  9438. * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
  9439. (Scan::global_reloc_may_be_function_pointer): New function.
  9440. (Scan::possible_function_pointer_reloc): New function.
  9441. (Target_x86_64::can_check_for_function_pointers): New function.
  9442. * gc.h (gc_process_relocs): Scan relocation types to determine if
  9443. function pointers were taken for targets that support it.
  9444. * icf.cc (Icf::find_identical_sections): Include functions for
  9445. folding in safe ICF whose pointer is not taken.
  9446. * icf.h (Secn_fptr_taken_set): New typedef.
  9447. (fptr_section_id_): New member.
  9448. (section_has_function_pointers): New function.
  9449. (set_section_has_function_pointers): New function.
  9450. (check_section_for_function_pointers): New function.
  9451. * options.h: Fix comment for safe ICF option.
  9452. * target.h (can_check_for_function_pointers): New function.
  9453. * testsuite/Makefile.am: Add icf_safe_so_test test case.
  9454. Modify icf_safe_test for X86-64.
  9455. * testsuite/Makefile.in: Regenerate.
  9456. * testsuite/icf_safe_so_test.cc: New file.
  9457. * testsuite/icf_safe_so_test.sh: New file.
  9458. * testsuite/icf_safe_test.cc (kept_func_3): New function.
  9459. (main): Change to take pointer to function kept_func_3.
  9460. * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
  9461. folding is done correctly for X86-64.
  9462. 2010-02-12 David S. Miller <davem@davemloft.net>
  9463. * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
  9464. is_symbolless parameter.
  9465. (Output_reloc<SHT_REL>::is_symbolless): New.
  9466. (Output_reloc<SHT_REL>::is_symbolless_): New.
  9467. (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
  9468. (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
  9469. (Output_reloc<SHT_RELA>::is_symbolless): New.
  9470. (Output_data_reloc::add_global): Handle is_symbolless.
  9471. (Output_data_reloc::add_global_relative): Likewise.
  9472. (Output_data_reloc::add_local): Likewise.
  9473. (Output_data_reloc::add_local_relative): Likewise.
  9474. (Output_data_reloc::add_symbolless_global_addend): New.
  9475. (Output_data_reloc::add_symbolless_local_addend): New.
  9476. * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
  9477. is_symbolless.
  9478. (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
  9479. instead of ->is_relative_
  9480. (Output_reloc::write): Likewise.
  9481. (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
  9482. (Output_reloc::write_rel): Simplify.
  9483. * sparc.cc (Target_sparc::Scan::local): Use
  9484. ->add_symbolless_local_addend as needed.
  9485. (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
  9486. needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
  9487. based upon relocation offset.
  9488. 2010-02-11 Doug Kwan <dougkwan@google.com>
  9489. * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
  9490. (Target_arm::Scan::global): Ditto. Also remove a comment before the
  9491. beginning of function.
  9492. (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
  9493. and MOVT_ABS relocations. Those are non issued in scanning. Fix
  9494. parameter is_32bit in calls to should_apply_static_reloc.
  9495. * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
  9496. (check_DATA): Add arm_abs_global.stdout.
  9497. (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
  9498. arm_abs_global.stdout): New rules.
  9499. (MOSTLLYCLEANFILES): Add arm_abs_global
  9500. * Makefile.in: Regenerate.
  9501. * testsuite/arm_abs_global.s: New file.
  9502. * testsuite/arm_abs_global.sh: Ditto.
  9503. * testsuite/arm_abs_lib.s: Ditto.
  9504. 2010-02-11 Ian Lance Taylor <iant@google.com>
  9505. * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
  9506. Read_relocs task.
  9507. (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
  9508. Allocate_commons_task first.
  9509. * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
  9510. task, rather than symtab_lock_.
  9511. (Gc_process_relocs::~Gc_process_relocs): New function.
  9512. (Gc_process_relocs::is_runnable): Check this_blocker_.
  9513. (Gc_process_relocs::locks): Use next_blocker_ rather than
  9514. blocker_.
  9515. (Scan_relocs::~Scan_relocs): New function.
  9516. (Scan_relocs::is_runnable): Check this_blocker_ rather than
  9517. symtab_lock_.
  9518. (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
  9519. next_blocker_.
  9520. * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
  9521. fields. Add this_blocker_ and next_blocker_ fields. Adjust
  9522. constructor accordingly.
  9523. (class Gc_process_relocs): Likewise.
  9524. (class Scan_relocs): Likewise.
  9525. * common.h (class Allocate_commons_task): Remove symtab_lock_
  9526. field, and corresponding constructor parameter.
  9527. * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
  9528. symtab_lock_.
  9529. (Allocate_commons_task::locks): Likewise.
  9530. 2010-02-11 Ian Lance Taylor <iant@google.com>
  9531. * gold-threads.h (class Once): Define.
  9532. (class Initialize_lock): Rewrite as child of Once.
  9533. * gold-threads.cc (class Once_initialize): Define.
  9534. (once_pointer_control): New static variable.
  9535. (once_pointer, once_arg): New static variables.
  9536. (c_run_once): New static function.
  9537. (Once::Once, Once::run_once, Once::internal_run): New functions.
  9538. (class Initialize_lock_once): Remove.
  9539. (initialize_lock_control): Remove.
  9540. (initialize_lock_pointer): Remove.
  9541. (initialize_lock_once): Remove.
  9542. (Initialize_lock::Initialize_lock): Move to gold-threads.h.
  9543. (Initialize_lock::initialize): Rewrite.
  9544. (Initialize_lock::do_run_once): New function.
  9545. * archive.cc (Archive::interpret_header): Only clear name if it is
  9546. not already empty.
  9547. * fileread.cc: Include "gold-threads.h"
  9548. (file_counts_lock): New static variable.
  9549. (file_counts_initialize_lock): Likewise.
  9550. (File_read::release): Only increment counts when using --stats.
  9551. Use a lock around the increment.
  9552. * parameters.cc (class Set_parameters_target_once): Define.
  9553. (set_parameters_target_once): New static variable.
  9554. (Parameters::Parameters): Move here from parameters.h.
  9555. (Parameters::set_target): Rewrite.
  9556. (Parameters::set_target_once): New function.
  9557. (Parameters::clear_target): Move here and rewrite.
  9558. * parameters.h (class Parameters): Update declarations. Add
  9559. set_parameters_target_once_ field.
  9560. (Parameters::Parameters): Move to parameters.cc.
  9561. (Parameters::clear_target): Likewise.
  9562. * readsyms.cc (Read_symbols::do_group): Create a Start_group
  9563. task.
  9564. (Start_group::~Start_group): New function.
  9565. (Start_group::is_runnable): New function.
  9566. (Start_group::locks, Start_group::run): New functions.
  9567. (Finish_group::run): Change saw_undefined to size_t.
  9568. * readsyms.h (class Start_group): Define.
  9569. (class Finish_group): Change saw_undefined_ field to size_t.
  9570. (Finish_group::Finish_group): Remove saw_undefined and
  9571. this_blocker parameters. Change all callers.
  9572. (Finish_group::set_saw_undefined): New function.
  9573. (Finish_group::set_blocker): New function.
  9574. * symtab.h (class Symbol_table): Change saw_undefined to return
  9575. size_t. Change saw_undefined_ field to size_t.
  9576. * target-select.cc (Set_target_once::do_run_once): New function.
  9577. (Target_selector::Target_selector): Initialize set_target_once_
  9578. field. Don't initialize lock_ and initialize_lock_ fields.
  9579. (Target_selector::instantiate_target): Rewrite.
  9580. (Target_selector::set_target): New function.
  9581. * target-select.h (class Set_target_once): Define.
  9582. (class Target_selector): Update declarations. Make
  9583. Set_target_once a friend. Remove lock_ and initialize_lock_
  9584. fields. Add set_target_once_ field.
  9585. 2010-02-10 Ian Lance Taylor <iant@google.com>
  9586. * dirsearch.cc (Dirsearch::initialize): Add all blockers before
  9587. queueing any tasks.
  9588. * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
  9589. (queue_middle_tasks): Add all blockers before queueing any tasks.
  9590. (queue_final_tasks): Likewise.
  9591. * token.h (Task_token::add_blockers): New function.
  9592. * object.h (Input_objects::number_of_relobjs): New function.
  9593. 2010-02-10 Ian Lance Taylor <iant@google.com>
  9594. * i386.cc (Relocate::relocate_tls): A local symbol is final if not
  9595. shared, not if not position independent.
  9596. * x86_64.cc (Relocate::relocate_tls): Likewise.
  9597. * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
  9598. (tls_pie_pic_test): New target.
  9599. * testsuite/Makefile.in: Rebuild.
  9600. * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
  9601. (tls_test_main_pie.o, tls_test_pie.o): New targets.
  9602. (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
  9603. * testsuite/Makefile.in: Rebuild.
  9604. 2010-02-09 David S. Miller <davem@davemloft.net>
  9605. * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
  9606. R_SPARC_RELATIVE using ->add_local_relative().
  9607. (Target_sparc::Scan::global): Likewise for ->add_global_relative().
  9608. * output.h (Output_data_dynamic::add_section_size): New method
  9609. that takes two Output_data objects.
  9610. (Output_data_dynamic::Dynamic_entry): Create storage for secondary
  9611. entry param. Handle it in initializers.
  9612. * output.cc (Output_data_dynamic::Dynamic_entry::write): For
  9613. DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
  9614. * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
  9615. arg.
  9616. * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
  9617. and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
  9618. * arm.cc (Target_arm::do_finalize_sections): Update to pass false
  9619. for dynrel_includes_plt.
  9620. * i386.cc (Target_i386::do_finalize_sections): Likewise.
  9621. * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
  9622. * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
  9623. before .rela.plt
  9624. (Target_sparc::do_finalize_sections): Update to pass true for
  9625. dynrel_includes_plt.
  9626. * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
  9627. output before .rela.plt
  9628. (Target_powerpc::do_finalize_sections): Update to pass true for
  9629. dynrel_includes_plt when 32-bit.
  9630. 2010-02-08 Doug Kwan <dougkwan@google.com>
  9631. * arm.cc (Arm_relobj::simple_input_section_output_address): New
  9632. method.
  9633. (Arm_relobj::section_needs_cortex_a8_stub_scanning,
  9634. Arm_relobj::scan_section_for_cortex_a8_stubs,
  9635. Arm_relobj::do_relocation_section): Instead of calling
  9636. Output_section::output_address, use faster
  9637. Arm_relobj::simple_input_section_output_address.
  9638. 2010-02-08 David S. Miller <davem@davemloft.net>
  9639. * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
  9640. unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
  9641. relocation helper function.
  9642. * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
  9643. just like R_SPARC_GOT{10,13,22}.
  9644. (Target_sparc::Scan::local): Likewise.
  9645. (Target_sparc::Relocate:relocate): Likewise.
  9646. 2010-02-06 Ian Lance Taylor <iant@google.com>
  9647. * configure.ac: Rewrite targetobjs duplicate removal code to use
  9648. only shell constructs.
  9649. * configure: Rebuild.
  9650. 2010-02-05 Doug Kwan <dougkwan@google.com>
  9651. PR 11247
  9652. * arm.cc (Arm_relobj::section_is_scannable): New method.
  9653. (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
  9654. (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
  9655. 2010-02-04 Doug Kwan <dougkwan@google.com>
  9656. PR 11247
  9657. * arm-reloc-property.cc (cstdio): Include.
  9658. * configure.ac (targetobjs): Remove duplicates.
  9659. * configure: Regenerate.
  9660. * resolve.cc (Symbol_table::resolve): Explicit instantiate both
  9661. big and little endian version for a given address size.
  9662. 2010-02-03 Doug Kwan <dougkwan@google.com>
  9663. * arm-reloc-property.cc
  9664. (Arm_reloc_property_table::reloc_name_in_error_message): New method
  9665. definition.
  9666. * arm-reloc-property.h
  9667. (Arm_reloc_property_table::get_implemented_static_reloc_property):
  9668. New method definition.
  9669. (Arm_reloc_property_table::reloc_name_in_error_message): New method
  9670. declaration.
  9671. * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
  9672. overflow to N.
  9673. (GOT_PREL): Change implemented to Y.
  9674. * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
  9675. (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
  9676. (Arm_relocate_functions::movw_abs_nc): Remove method.
  9677. (Arm_relocate_functions::movt_abs): Ditto.
  9678. (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
  9679. (Arm_relocate_functions::thm_movt_abs): Ditto.
  9680. (Arm_relocate_functions::movw_rel_nc): Ditto.
  9681. (Arm_relocate_functions::movw_rel): Ditto.
  9682. (Arm_relocate_functions::movt_rel): Ditto.
  9683. (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
  9684. (Arm_relocate_functions:thm_movw_rel): Ditto.
  9685. (Arm_relocate_functions:thm_movt_rel): Ditto.
  9686. (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
  9687. (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
  9688. New method definitions.
  9689. (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
  9690. (Arm_relocation_functions::arm_grp_ldr): Ditto.
  9691. (Arm_relocation_functions::arm_grp_ldrs): Ditto.
  9692. (Arm_relocation_functions::arm_grp_ldc): Ditto.
  9693. (Target_arm::Relocate::relocate): Check for non-static or
  9694. unimplemented relocation code and exit early. Change calls to
  9695. Target_arm::reloc_uses_thumb_bit and
  9696. Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
  9697. instead. Refactor code to handle similar relocations to increase
  9698. code sharing. Remove check for unsupported relocation code in switch
  9699. statement.
  9700. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
  9701. relocation property table to find out size. Change error message to
  9702. print out the name of a relocation code instead of the numeric value.
  9703. (Target_arm::scan_reloc_for_stub): Use relocation property table
  9704. instead of calling Target_arm::reloc_uses_thumb_bit().
  9705. 2010-02-02 Doug Kwan <dougkwan@google.com>
  9706. * arm.cc (Target_arm::relocate_section): Do view adjustment for all
  9707. types of relaxed input section.
  9708. 2010-02-02 Doug Kwan <dougkwan@google.com>
  9709. * Makefile.am (HFILES): Add arm-reloc-property.h.
  9710. (DEFFILES): New.
  9711. (TARGETSOURCES): Add arm-reloc-property.cc
  9712. (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
  9713. (libgold_a_SOURCES): $(DEFFILES)
  9714. * Makefile.in: Regenerate.
  9715. * arm-reloc-property.cc: New file.
  9716. * arm-reloc-property.h: New file.
  9717. * arm-reloc.def: New file.
  9718. * arm.cc: Update comments.
  9719. (arm-reloc-property.h): New included header.
  9720. (arm_reloc_property_table): New global variable.
  9721. (Target_arm::do_select_as_default_target): New method definition.
  9722. * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
  9723. arm-reloc-property to targ_extra_obj.
  9724. * parameters.cc (set_parameters_target): Call
  9725. Target::select_as_default_target().
  9726. * target.h (Target::select_as_default_target): New method definition.
  9727. (Target::do_select_as_default_target): Same.
  9728. 2010-02-01 Doug Kwan <dougkwan@google.com>
  9729. * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
  9730. first_output_text_section_.
  9731. (Arm_exidx_fixup::first_output_text_section): New method definition.
  9732. (Arm_exidx_fixup::first_output_text_section_): New data member.
  9733. (Arm_exidx_fixup::process_exidx_section): Record the first text
  9734. output section seen.
  9735. (Arm_output_section::fix_exidx_coverage): Set correct linked section
  9736. and entsize in output section header.
  9737. 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9738. * arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
  9739. R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
  9740. (Arm_relocate_functions::thm_alu11): New Method.
  9741. (Arm_relocate_functions::thm_pc8): New Method.
  9742. (Arm_relocate_functions::thm_pc12): New Method.
  9743. (Target_arm::Scan::local): Handle the relocations.
  9744. (Target_arm::Scan::global): Likewise.
  9745. (Target_arm::Relocate::relocate): Likewise.
  9746. (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
  9747. 2010-01-29 Doug Kwan <dougkwan@google.com>
  9748. * arm.cc (Target_arm::Scan::global): General PLTs for the same set
  9749. of relocation types as ld.
  9750. 2010-01-29 Doug Kwan <dougkwan@google.com>
  9751. * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
  9752. to public.
  9753. (Arm_relocate_functions::thumb_branch_common): Ditto.
  9754. (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
  9755. Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
  9756. Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
  9757. Arm_relocate_functions::jump24): Remove.
  9758. (Target_arm::Relocate::relocate): Adjust code to call
  9759. Arm_relocation_functions::arm_branch_common and
  9760. Arm_relocation_functions::thumb_branch_common instead of their removed
  9761. wrappers. Merge switch-cases together to reduce source code size.
  9762. 2010-01-29 Doug Kwan <dougkwan@google.com>
  9763. * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
  9764. output_local_symbol_count_needs_update_.
  9765. (Arm_relobj::output_local_symbol_count_needs_update,
  9766. Arm_relobj::set_output_local_symbol_count_needs_update,
  9767. Arm_relobj::update_output_local_symbol_count): New methods.
  9768. (Arm_relobj::output_local_symbol_count_needs_update_): New data
  9769. member.
  9770. (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
  9771. of pointed function as in a R_ARM_PREL31 relocation.
  9772. (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
  9773. for output local symbol count updating.
  9774. (Target_arm::do_relax): Update output local symbol counts in objects
  9775. if necessary.
  9776. * object.h (Sized_relobj::set_output_local_symbol_count): New method.
  9777. 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9778. * arm.cc: Added support for the ARM relocations:
  9779. R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
  9780. R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
  9781. (Arm_relocate_functions::movw_rel_nc): Renamed (was
  9782. movw_prel_nc).
  9783. (Arm_relocate_functions::movw_rel): New method.
  9784. (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
  9785. (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
  9786. thm_movw_prel_nc).
  9787. (Arm_relocate_functions::thm_movw_rel): New method.
  9788. (Arm_relocate_functions::thm_movt_rel): Renamed (was
  9789. thm_movt_prel).
  9790. (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
  9791. relocations.
  9792. (Target_arm::Scan::global): Likewise.
  9793. (Target_arm::Relocate::relocate): Likewise.
  9794. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
  9795. Likewise.
  9796. 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9797. * arm.cc: Added support for ARM group relocations.
  9798. (Target_arm::reloc_needs_sym_origin): New method.
  9799. (Arm_relocate_functions::calc_grp_kn): New method.
  9800. (Arm_relocate_functions::calc_grp_residual): New method.
  9801. (Arm_relocate_functions::calc_grp_gn): New method.
  9802. (Arm_relocate_functions::arm_grp_alu): New Method.
  9803. (Arm_relocate_functions::arm_grp_ldr): New Method.
  9804. (Arm_relocate_functions::arm_grp_ldrs): New Method.
  9805. (Arm_relocate_functions::arm_grp_ldc): New Method.
  9806. (Target_arm::Scan::local): Handle the ARM group relocations.
  9807. (Target_arm::Scan::global): Likewise.
  9808. (Target_arm::Relocate::relocate): Likewise.
  9809. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
  9810. Likewise.
  9811. 2010-01-26 Doug Kwan <dougkwan@google.com>
  9812. * arm.cc (set): Include.
  9813. (class Arm_exidx_fixup): Change type of last_input_section_ to const
  9814. pointer type.
  9815. (Arm_output_section::Text_section_list): New type.
  9816. (Arm_output_section::append_text_sections_to_list): New method.
  9817. (Arm_output_section::fix_exidx_coverage): Ditto.
  9818. (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
  9819. (Arm_relobj::convert_input_section_to_relaxed_section): Use
  9820. Relobj::set_section_offset() instead of
  9821. Sized_relobj::invalidate_section_offset().
  9822. (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
  9823. parameter for section headers. Ignore relocation sections for
  9824. unallocated sections and EXIDX sections.
  9825. (Target_arm::fix_exidx_coverage): New method.
  9826. (Target_arm::output_section_address_less_than): New type.
  9827. (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
  9828. linked text section instead of the EXIDX section.
  9829. (Arm_output_section::create_stub_group): Add an assertion to check
  9830. that this is not an EXIDX output section.
  9831. (Arm_output_section::append_text_sections_to_list): New method.
  9832. (Arm_output_section::fix_exidx_coverage): Ditto.
  9833. (Arm_relobj::scan_sections_for_stubs): Adjust call to
  9834. Arm_relobj::section_needs_reloc_stub_scanning.
  9835. (Target_arm::do_relax): Fix EXIDX output section coverage in the
  9836. first pass.
  9837. (Target_arm::fix_exidx_coverage): New method.
  9838. * object.h (Relobj::set_output_section): New method.
  9839. (Sized_relobj::invalidate_section_offset): Remove method.
  9840. (Sized_relobj::do_invalidate_section_offset): Remove method.
  9841. (Sized_relobj::do_set_section_offset): Handle offset value -1.
  9842. 2010-01-25 Doug Kwan <dougkwan@google.com>
  9843. * arm.cc (Arm_exidx_merged_section::do_output_offset):
  9844. Fix warning due to signed and unsigned comparison on a 32-bit host.
  9845. 2010-01-22 Doug Kwan <dougkwan@google.com>
  9846. * arm.cc (Target_arm::do_relax): Record an output section for section
  9847. offset adjustment it contains any stub table that has changed.
  9848. * layout.cc (Layout::clean_up_after_relaxation): Adjust section
  9849. offsets in an output section if necessary.
  9850. * output.cc (Output_section::Output_section): Initialize
  9851. section_offsets_need_adjustments_.
  9852. (Output_section::add_input_section_for_script): Renamed to
  9853. Output_section::add_simple_input_section.
  9854. (Output_section::save_states): Add a comment.
  9855. (Output_section::discard_states): New method defintion.
  9856. (Output_section::adjust_section_offsets): Same.
  9857. * output.h (Output_section::add_input_section_for_script): Renamed to
  9858. Output_section::add_simple_input_section.
  9859. (Output_section::discard_states): New method declaration.
  9860. (Output_section::adjust_section_offsets): Same.
  9861. (Output_section::section_offsets_need_adjustment,
  9862. Output_section::set_section_offsets_need_adjustment): New method
  9863. definitions.
  9864. (Output_section::section_offsets_need_adjustment_): New data member.
  9865. * script-sections.cc
  9866. (Output_section_element_input::set_section_address): Adjust code for
  9867. renaming of Output_section::add_input_section_for_script.
  9868. (Orphan_output_section::set_section_address): Same.
  9869. 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9870. * arm.cc (Target_arm): Updated fix_v4bx method and usage of
  9871. Fix_v4bx enum values .
  9872. * options.h (General_options): New option definitions.
  9873. (General_options::fix_v4bx): New method.
  9874. (General_options::Fix_v4bx): New enum.
  9875. * options.cc (General_options::parse_fix_v4bx): New method.
  9876. (General_options::parse_fix_v4bx_interworking): New method.
  9877. 2010-01-22 Doug Kwan <dougkwan@google.com>
  9878. * arm.cc (Arm_exidx_fixup): New class.
  9879. 2010-01-21 Doug Kwan <dougkwan@google.com>
  9880. * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
  9881. classes.
  9882. (Arm_exidx_section_offset_map): New type.
  9883. 2010-01-21 Doug Kwan <dougkwan@google.com>
  9884. * arm.cc (Arm_exidx_input_section): New class.
  9885. (Arm_relobj::exidx_input_section_by_link,
  9886. Arm_relobj::exidx_input_section_by_shndx,
  9887. Arm_relobj::make_exidx_input_section): New methods.
  9888. (read_arm_attributes_section): Remove.
  9889. (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
  9890. information about them.
  9891. (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
  9892. to here.
  9893. 2010-01-20 Doug Kwan <dougkwan@google.com>
  9894. * arm.cc (Target_arm::Arm_input_section_map): Change key type from
  9895. Input_section_specifier to Section_id.
  9896. (Target_arm::new_arm_input_section: Adjust code for change of key
  9897. type.
  9898. (Target_arm::find_arm_input_section): Ditto.
  9899. * gc.h (object.h): Include for Section_id nand Section_id_hash.
  9900. (Section_id): Remove.
  9901. (Garbage_collection::Section_id_hash): Remove.
  9902. * icf.h (object.h): Include for Section_id nand Section_id_hash.
  9903. (Section_id): Remove.
  9904. (Icf::Section_id_hash): Remove.
  9905. * object.h (Section_id, Const_section_id, Section_id_hash,
  9906. Const_section_id_hash): New type definitions.
  9907. * output.cc (Output_section::add_relaxed_input_section): Change to
  9908. use Const_section_id instead of Input_section_specifier as key type.
  9909. (Output_section::add_merge_input_section): Ditto.
  9910. (Output_section::build_relaxation_map): Change to use Section_id
  9911. instead of Input_section_specifier as key type.
  9912. (Output_section::convert_input_sections_in_list_to_relaxed_sections):
  9913. Ditto.
  9914. (Output_section::convert_input_sections_to_relaxed_sections): Change
  9915. to use Const_section_id instead of Input_section_specifier as key type.
  9916. (Output_section::find_merge_section): Ditto.
  9917. (Output_section::find_relaxed_input_section): Ditto.
  9918. * output.h (Input_section_specifier): Remove class.
  9919. (Output_section::Output_section_data_by_input_section_map): Change
  9920. key type to Const_section_id.
  9921. (Output_section::Output_relaxed_input_section_by_input_section_map):
  9922. Ditto.
  9923. (Output_section::Relaxation_map): Change key type to Section_id.
  9924. 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9925. * arm.cc: Added support for R_ARM_V4BX relocation
  9926. (class Arm_v4bx_stub): New class.
  9927. (DEF_STUBS): Updated definition to support v4_veneer_bx.
  9928. (Stub_factory::make_arm_v4bx_stub): New method.
  9929. (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
  9930. (Stub_table::empty): Handle v4bx stubs.
  9931. (Stub_table::add_arm_v4bx_stub): New method.
  9932. (Stub_table::find_arm_v4bx_stub): New method.
  9933. (Arm_relocate_functions::v4bx): New method.
  9934. (Target_arm::fix_v4bx): New method.
  9935. (Target_arm::Target_arm): Handle R_ARM_V4BX.
  9936. (Stub_table::relocate_stubs): Likewise.
  9937. (Stub_table::do_write): Likewise.
  9938. (Stub_table::update_data_size_and_addralign): Likewise.
  9939. (Stub_table::finalize_stubs): Likewise.
  9940. (Target_arm::Scan::local): Likewise.
  9941. (Target_arm::Scan::global): Likewise.
  9942. (Target_arm::do_finalize_sections): Likewise.
  9943. (Target_arm::Relocate::relocate): Likewise.
  9944. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
  9945. Likewise.
  9946. (Target_arm::scan_reloc_for_stub): Likewise.
  9947. (Target_arm::scan_reloc_section_for_stubs): Likewise.
  9948. 2010-01-19 Ian Lance Taylor <iant@google.com>
  9949. * output.cc (Output_section_headers::do_sized_write): Write large
  9950. segment count to sh_info field.
  9951. (Output_file_header::do_sized_write): For large segment count,
  9952. write PN_XNUM to e_phnum field.
  9953. 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9954. * arm.cc (Arm_relocate_functions::thm_jump6): New function.
  9955. (Arm_relocate_functions::thm_jump8): New function.
  9956. (Arm_relocate_functions::thm_jump11): New function.
  9957. (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
  9958. R_ARM_THM_JUMP11.
  9959. (Target_arm::Scan::global): Likewise.
  9960. (Target_arm::Relocate::relocate): Likewise.
  9961. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
  9962. Likewise.
  9963. 2010-01-14 Doug Kwan <dougkwan@google.com>
  9964. * arm.cc (map, utility): Include headers.
  9965. (Target_arm::apply_cortex_a8_workaround): New method.
  9966. (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
  9967. (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
  9968. (Target_arm::Scan::global): R_ARM_THM_JUMP19.
  9969. (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
  9970. the --[no-]fix-cortex-a8 command line options.
  9971. (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
  9972. (Target_arm::relocate_stub): Use addend in instruction template.
  9973. * options.h (DEFINE_bool): Set the user-set flag.
  9974. (General_options): Add --[no-]-fix-cortex options.
  9975. * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
  9976. : Update fast look-up map after conversion.
  9977. 2010-01-14 Sriraman Tallam <tmsriram@google.com>
  9978. * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
  9979. in the first pass of do_layout.
  9980. 2010-01-13 Doug Kwan <dougkwan@google.com>
  9981. * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
  9982. Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
  9983. apparent compiler problem of not folding static constant integral
  9984. data members of elfcpp::Elf_sizes<32>.
  9985. 2010-01-13 Doug Kwan <dougkwan@google.com>
  9986. * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
  9987. Arm_relobj::section_needs_cortex_a8_stub_scanning,
  9988. Arm_relobj::scan_section_for_cortex_a8_erratum,
  9989. Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
  9990. (Arm_relobj::scan_sections_for_stubs): Move code deciding what
  9991. sections to scan for relocation stubs into a new method
  9992. Arm_relobj::section_needs_reloc_stub_scanning. Handle both
  9993. relocation and Cortex-A8 stub scanning.
  9994. (Target_arm::do_relax): Force stubs to be after stubbed sections
  9995. if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
  9996. the beginning of a new relaxation pass. Update a comment.
  9997. (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
  9998. 2010-01-12 Ian Lance Taylor <iant@google.com>
  9999. * target-reloc.h (visibility_error): New inline function.
  10000. (relocate_section): Call visibility_error.
  10001. * testsuite/Makefile.am (check_DATA): Add protected_3.err.
  10002. (MOSTLYCLEANFILES): Likewise.
  10003. (protected_4_pic.o, protected_3.err): New targets.
  10004. * testsuite/protected_4.cc: New file.
  10005. 2010-01-12 Doug Kwan <dougkwan@google.com>
  10006. * arm.cc (Cortex_a8_reloc): New class.
  10007. (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
  10008. and cortex_a8_relocs_info_.
  10009. (Target_arm::fix_cortex_a8): New method definition.
  10010. (Target_arm::Cortex_a8_relocs_info): New type.
  10011. (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
  10012. New data member declarations.
  10013. (Target_arm::scan_reloc_for_stub): Record information about
  10014. relocations for THUMB branches that might be exempted from the
  10015. Cortex-A8 workaround.
  10016. (Target_arm::do_relax): Clear all Cortex-A8 relocation information
  10017. at the beginning of a relaxation pass.
  10018. 2010-01-12 Doug Kwan <dougkwan@google.com>
  10019. * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
  10020. (Arm_relobj::Mapping_symbol_position,
  10021. Arm_reloj::Mapping_symbol_position_less,
  10022. Arm_relobj::Mapping_symbols_info): New types.
  10023. (Target_arm::is_mapping_symbol_name): New method definition.
  10024. (Arm_relobj::do_count_local_symbols): Save information about mapping
  10025. symbols.
  10026. 2010-01-11 Doug Kwan <dougkwan@google.com>
  10027. * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
  10028. Arm_relocate_functions::thumb32_branch_upper,
  10029. Arm_relocate_functions::thumb32_branch_lower,
  10030. Arm_relocate_functions::thumb32_cond_branch_offset,
  10031. Arm_relocate_functions::thumb32_cond_branch_upper,
  10032. Arm_relocate_functions::thumb32_cond_branch_lower,
  10033. Arm_relocate_functions::thm_jump19): New methods to handle THUMB
  10034. branch offset encoding.
  10035. (Arm_relocate_functions::thumb_branch_common): Use new branch
  10036. offset encoding methods to avoid code duplication.
  10037. (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
  10038. (Stub_addend_reader::operator()): Use new branch encoding method
  10039. to avoid code duplication.
  10040. 2010-01-11 Doug Kwan <dougkwan@google.com>
  10041. * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
  10042. (Target_arm::do_finalize_sections): Define special EXIDX section
  10043. symbols only if referenced.
  10044. * gc.h (Garbage_collection::add_reference): New method.
  10045. (gc_process_relocs): Use Garbage_collection::add_reference to avoid
  10046. code duplication.
  10047. 2010-01-11 Ian Lance Taylor <iant@google.com>
  10048. * script.cc (Version_script_info::build_expression_list_lookup):
  10049. Change complaing about duplicate wildcard match from error to
  10050. warning.
  10051. * script.cc (class Lazy_demangler): Recreate--revert part of patch
  10052. of 2009-12-30.
  10053. (Version_script_info::Version_script_info): Initialize globs_,
  10054. default_version_, default_is_global_, and exact_. Don't
  10055. initialize globals_ or locals_.
  10056. (Version_script_info::build_lookup_tables): Build local symbols
  10057. first.
  10058. (Version_script_info::unquote): New function.
  10059. (Version_script_info::add_exact_match): New function.
  10060. (Version_script_info::build_expression_list_lookup): Remove lookup
  10061. parameter. Add is_global parameter. Change all callers. Handle
  10062. wildcard pattern specially. Unquote pattern. Call
  10063. add_exact_match.
  10064. (Version_script_info::get_name_to_match): New function.
  10065. (Version_script_info::get_symbol_version): New function.
  10066. (Version_script_info::get_symbol_version_helper): Remove.
  10067. (Version_script_info::check_unmatched_names): Call unquote.
  10068. * script.h (class Version_script_info): Change get_symbol_version
  10069. to be non-inline and add is_global parameter; change all callers.
  10070. Rewrite symbol_is_local. Update declarations. Define struct
  10071. Version_tree_match, Exact, Globs. Don't define struct Lookup.
  10072. Remove globals_ and locals_ members. Add exact_, globs_,
  10073. default_version_, is_global_.
  10074. (Version_script_info::Glob): Remove pattern, add expression and
  10075. is_global. Update constructor. Change all callers.
  10076. * dynobj.cc (Versions::finalize): Mark the version symbol as the
  10077. default version.
  10078. (Versions::symbol_section_contents): If a symbol is undefined, or
  10079. defined in a dynamic object, set the version index to
  10080. VER_NDX_LOCAL.
  10081. * symtab.cc (Symbol_table::add_from_relobj): Don't call
  10082. symbol_is_local.
  10083. (Symbol_table::add_from_pluginobj): Likewise.
  10084. * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
  10085. 2010-01-11 Doug Kwan <dougkwan@google.com>
  10086. * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
  10087. (incremental_dump_LDADD): Add linking option for libintl.
  10088. * Makefile.in: Regenerate.
  10089. 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
  10090. PR gold/11144
  10091. * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
  10092. instead of -Ds.
  10093. * testsuite/Makefile.in: Regenerated.
  10094. 2010-01-10 Doug Kwan <dougkwan@google.com>
  10095. * options.h (DEFINE_var): Use parentheses around argument varname__
  10096. in macro body to avoid any unintended subsequent substitutions.
  10097. 2010-01-10 Ian Lance Taylor <iant@google.com>
  10098. * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
  10099. candidates before doing symbol resolution.
  10100. * resolve.cc (Symbol_table::resolve): Add symbols to the list of
  10101. ODR candidates if only one is weak.
  10102. 2010-01-08 Ian Lance Taylor <iant@google.com>
  10103. * script.cc (Version_script_info::build_expression_list_lookup):
  10104. Don't warn about ambiguous version, just record the ambiguity.
  10105. (Version_script_info::get_symbol_version_helper): Give error if
  10106. version is ambiguous.
  10107. 2010-01-08 Doug Kwan <dougkwan@google.com>
  10108. * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
  10109. prev_data_size_ and prev_addralign_. Remove initializer for
  10110. deleted data member has_been_changed_.
  10111. (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
  10112. to determine if the table is empty.
  10113. (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
  10114. Remove.
  10115. (Stub_table::add_reloc_stub): Define method in class definition
  10116. instead of just declaring it there.
  10117. (Stub_table::add_cortex_a8_stub): New method definition.
  10118. (Stub_table::update_data_size_and_addralign): Ditto.
  10119. (Stub_table::finalize_stubs): Ditto.
  10120. (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
  10121. (Stub_table::do_addralign_): Return address alignment in the
  10122. (Stub_table::do_reset_address_and_file_offset): Define method in
  10123. class definition instead of declaring it there. Set current data
  10124. size to be the data size of the previous pass.
  10125. (Stub_table::set_final_data_size): Use current data size as the
  10126. final data size.
  10127. (Stub_table::relocate_stub): Change parameter type of stub from
  10128. Reloc_stub pointer to Stub pointer.
  10129. (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
  10130. (Stub_table::Cortex_a8_stub_list): New typedef.
  10131. (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
  10132. Stub_table::prev_addralign_): New data member.
  10133. (Arm_relobj::Arm_relobj): Initialize data member
  10134. section_has_cortex_a8_workaround_.
  10135. (Arm_relobj::section_has_cortex_a8_workaround,
  10136. Arm_relobj::mark_section_for_cortex_a8_workaround): New method
  10137. definitions.
  10138. (Arm_relobj::section_has_cortex_a8_workaround_): New data member
  10139. declarations.
  10140. (Target_arm::relocate_stub): Change parameter type of stub from
  10141. Reloc_stub pointer to Stub pointer.
  10142. (Insn_template::size, Insn_template::alignment): Handle
  10143. THUMB16_SPECIAL_TYPE.
  10144. (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
  10145. Stub_table::update_data_size_and_addralign,
  10146. Stub_table::apply_cortex_a8_workaround_to_address_range): New method
  10147. definitions.
  10148. (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
  10149. (Stub_table::do_write): Ditto.
  10150. (Target_arm::do_relax): Adjust code for changes in Stub_table.
  10151. 2010-01-08 Ian Lance Taylor <iant@google.com>
  10152. PR 11108
  10153. * symtab.h (class Symbol): Remove fields is_target_special_ and
  10154. has_plt_offset_. Add field is_defined_in_discarded_section_.
  10155. (Symbol::is_defined_in_discarded_section): New function.
  10156. (Symbol::set_is_defined_in_discarded_section): New function.
  10157. (Symbol::has_plt_offset): Rewrite.
  10158. (Symbol::set_plt_offset): Verify that new offset is not -1U.
  10159. * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
  10160. Don't initialize is_target_special_ or has_plt_offset_.
  10161. Initialize is_defined_in_discarded_section_.
  10162. (Symbol_table::add_from_relobj): If appropriate, set
  10163. is_defined_in_discarded_section.
  10164. * resolve.cc (Symbol::override_base_with_special): Don't test
  10165. is_target_special_. Change has_plt_offset_ to has_plt_offset().
  10166. * target-reloc.h (relocate_section): Do special handling for
  10167. symbols defined in discarded sections for global symbols as well
  10168. as local symbols.
  10169. 2010-01-08 Ian Lance Taylor <iant@google.com>
  10170. * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
  10171. the SHT_SYMTAB case.
  10172. 2010-01-08 Ian Lance Taylor <iant@google.com>
  10173. * object.cc (Sized_relobj::do_layout): Don't get confused if
  10174. layout_eh_frame returns NULL.
  10175. 2010-01-08 Ian Lance Taylor <iant@google.com>
  10176. PR 11084
  10177. * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
  10178. dynamic symbol table, use the normal symbol table.
  10179. (Sized_dynobj::do_read_symbols): Remove assertion about type of
  10180. symbol table.
  10181. 2010-01-08 Ian Lance Taylor <iant@google.com>
  10182. PR 11072
  10183. * layout.cc (Layout::include_section): Remove .gnu_debuglink
  10184. sections.
  10185. 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
  10186. * version.cc (print_version): Change to "Copyright 2010".
  10187. 2010-01-08 Ian Lance Taylor <iant@google.com>
  10188. PR 10287
  10189. PR 11063
  10190. * i386.cc (class Target_i386): Change return type of plt_section
  10191. to be non-const.
  10192. (class Output_data_plt_i386): Add tls_desc_rel_ field.
  10193. (Output_data_plt_i386::Output_data_plt_i386): Initialize
  10194. tls_desc_rel_ field.
  10195. (Output_data_plt_i386::rel_tls_desc): New function.
  10196. (Target_i386::rel_tls_desc_section): New function.
  10197. (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
  10198. (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
  10199. R_386_TLS_DESC reloc in rel_tls_desc_section.
  10200. * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
  10201. Define struct Tlsdesc_info.
  10202. (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
  10203. (Target_x86_64::do_reloc_symbol_index): New function.
  10204. (Target_x86_64::add_tlsdesc_info): New function.
  10205. (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
  10206. (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
  10207. tlsdesc_rel_ field.
  10208. (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
  10209. all callers.
  10210. (Output_data_plt_x86_64::rela_tlsdesc): New function.
  10211. (Target_x86_64::rela_tlsdesc_section): New function.
  10212. (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
  10213. handling.
  10214. (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
  10215. (Target_x86_64::do_reloc_addend): New function.
  10216. R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
  10217. * output.h (class Output_reloc) [SHT_REL]: Add new constructor
  10218. declarations. Define TARGET_CODE. Add arg field to u1_ union.
  10219. (Output_reloc::type): New function.
  10220. (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
  10221. (Output_reloc::is_target_specific): New function.
  10222. (Output_reloc::target_arg): New function.
  10223. (class Output_reloc) [SHT_RELA]: Add four new constructors for
  10224. absolute relocs and target specific relocs.
  10225. (class Output_data_reloc) [SHT_REL]: Add add_absolute and
  10226. add_target_specific.
  10227. (class Output_data_reloc) [SHT_RELA]: Likewise.
  10228. * output.cc (Output_reloc::Output_reloc): Add four new versions
  10229. for absolute relocs and target specific relocs.
  10230. (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
  10231. (Output_reloc::get_symbol_index): Likewise.
  10232. (Output_reloc::local_section_offset): Check that local_sym_index_
  10233. is not TARGET_CODE or 0.
  10234. (Output_reloc::symbol_value): Likewise.
  10235. (Output_reloc::write) [SHT_RELA]: Call target for target specific
  10236. reloc.
  10237. * target.h (class Target): Add reloc_symbol_index and reloc_addend
  10238. functions. Add do_reloc_symbol_index and do_reloc_addend virtual
  10239. functions.
  10240. * layout.cc (add_target_dynamic_tags): Use output section for
  10241. DT_PLTRELSZ and DT_JMPREL.
  10242. 2010-01-07 Ian Lance Taylor <iant@google.com>
  10243. PR 11061
  10244. * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
  10245. function.
  10246. (class Output_data_reloc_generic): Define.
  10247. (class Output_data_reloc_base): Change base class to
  10248. Output_data_reloc_generic. Change add() method to call
  10249. bump_relative_reloc_count for a relative reloc. Remove
  10250. sort_relocs_ field.
  10251. * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
  10252. to sort_relocs().
  10253. * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
  10254. Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
  10255. appropriate.
  10256. * layout.h (class Layout): Update declaration.
  10257. 2010-01-07 Ian Lance Taylor <iant@google.com>
  10258. * output.h (class Output_data): Add const version of
  10259. output_section and do_output_section.
  10260. (class Output_section_data): Add const version of
  10261. do_output_section.
  10262. (class Output_section): Likewise.
  10263. * layout.cc (Layout::add_target_dynamic_tags): New function.
  10264. * layout.h (class Layout): Update declarations.
  10265. * arm.cc (Target_arm::do_finalize_sections): Use
  10266. add_target_dynamic_tags.
  10267. * i386.cc (Target_i386::do_finalize_sections): Likewise.
  10268. * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
  10269. * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
  10270. * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
  10271. 2010-01-07 Ian Lance Taylor <iant@google.com>
  10272. PR 11042
  10273. * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
  10274. object as needed.
  10275. 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
  10276. Ian Lance Taylor <iant@google.com>
  10277. PR 11019
  10278. * object.cc: Instantiate Xindex::initialize_symtab_xindex and
  10279. Xindex::read_symtab_xindex.
  10280. 2010-01-07 Doug Kwan <dougkwan@google.com>
  10281. * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
  10282. (Insn_template::thumb16_bcond_insn): New method declaration.
  10283. (Insn_template): Fix spelling.
  10284. (Stub::thumb16_special): New method declaration.
  10285. (Stub::do_write): Define virtual method which was previously pure
  10286. virtual.
  10287. (Stub::do_thumb16_special): New method declaration.
  10288. (Stub::do_fixed_endian_write): New template member.
  10289. (Reloc_stub::do_write): Remove.
  10290. (Reloc_stub::do_fixed_endian_write): Remove.
  10291. (Cortex_a8_stub): New class definition.
  10292. (Stub_factory::make_cortex_a8_stub): New method definition.
  10293. (Stub_factory::Stub_factory): Add missing static storage class
  10294. qualifier for elf32_arm_stub_a8_veneer_blx.
  10295. 2010-01-07 Ian Lance Taylor <iant@google.com>
  10296. PR 10980
  10297. * options.h (class General_options): Add --warn-unresolved-symbols
  10298. and --error-unresolved-symbols.
  10299. * errors.cc (Errors::undefined_symbol): Implement
  10300. --warn-unresolved-symbols.
  10301. * options.h (class General_options): Add -z text and -z textoff.
  10302. * layout.cc (Layout::finish_dynamic_section): Implement -z text.
  10303. 2010-01-06 Sriraman Tallam <tmsriram@google.com>
  10304. * gc.h (Garbage_collection::Cident_section_map): New typedef.
  10305. (Garbage_collection::cident_sections): New function.
  10306. (Garbage_collection::add_cident_section): New function.
  10307. (Garbage_collection::cident_sections_): New member.
  10308. (gc_process_relocs): Add references to sections whose names are C
  10309. identifiers.
  10310. * gold.h (cident_section_start_prefix): New constant.
  10311. (cident_section_stop_prefix): New constant.
  10312. (is_cident): New function.
  10313. * layout.cc (Layout::define_section_symbols): Replace string constants
  10314. with the newly defined constants.
  10315. * object.cc (Sized_relobj::do_layout): Track sections whose names are
  10316. C identifiers.
  10317. * testsuite/Makefile.am: Add gc_orphan_section_test.
  10318. * testsuite/Makefile.in: Regenerate.
  10319. * testsuite/gc_orphan_section_test.cc: New file.
  10320. * testsuite/gc_orphan_section_test.sh: New file.
  10321. 2010-01-06 Ian Lance Taylor <iant@google.com>
  10322. PR 10980
  10323. * options.h (class General_options): Add --warn-shared-textrel.
  10324. * layout.cc (Layout::finish_dynamic_section): Implement
  10325. --warn-shared-textrel.
  10326. PR 10980
  10327. * options.h (class General_options): Add --warn-multiple-gp.
  10328. 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  10329. * Makefile.am (incremental_dump_DEPENDENCIES): Remove
  10330. $(THREADSLIB) and $(LIBDL).
  10331. * Makefile.in: Rebuild.
  10332. 2010-01-06 Ian Lance Taylor <iant@google.com>
  10333. PR 10980
  10334. * options.cc (General_options::parse_section_start): New function.
  10335. (General_options::section_start): New function.
  10336. (General_options::General_options): Initialize all members.
  10337. * options.h: Include <map>
  10338. (class General_options): Add --section-start. Add section_starts_
  10339. member.
  10340. * layout.cc (Layout::attach_allocated_section_to_segment): If
  10341. --section-start was used, set the address of the segment. Remove
  10342. local sort_sections.
  10343. (Layout::relaxation_loop_body): If the address of the load segment
  10344. has been set by --section-start, don't use it.
  10345. * output.h (Output_segment::update_flags_for_output_section): New
  10346. function.
  10347. * output.cc (Output_segment::add_output_section): Call
  10348. update_flags_for_output_section.
  10349. 2010-01-05 Ian Lance Taylor <iant@google.com>
  10350. PR 10980
  10351. * options.h (class General_options): Add --undefined-version.
  10352. * script.cc (struct Version_expression): Add was_matched_by_symbol
  10353. field.
  10354. (Version_script_info::matched_symbol): New function.
  10355. (Version_script_info::get_symbol_version_helper): Call
  10356. matched_symbol.
  10357. (Version_script_info::check_unmatched_names): New function.
  10358. * script.h (class Version_script_info): Update declarations.
  10359. * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
  10360. * options.h (class General_options): Use DEFINE_bool_alias for
  10361. allow_multiple_definition.
  10362. * resolve.cc (Symbol_table::should_override): Don't test
  10363. allow_multiple_definition.
  10364. PR 10980
  10365. * options.h (class General_options): Add --cref.
  10366. * main.cc (main): Print cref table if --cref. Don't close mapfile
  10367. until after printing cref table.
  10368. * cref.cc: Include "symtab.h".
  10369. (class Cref_inputs): Define Cref_table_compare and Cref_table.
  10370. (Cref_table_compare::operator()): New function.
  10371. (Cref_inputs::gather_cref): New function.
  10372. (filecol): New static const.
  10373. (Cref_inputs::print_cref): New function.
  10374. (Cref::print_cref): New function.
  10375. * cref.h: Include <cstdio>.
  10376. (class Cref): Update declarations.
  10377. * mapfile.h (Mapfile::file): New function.
  10378. * object.h (class Object): Define Symbols. Declare virtual
  10379. do_get_global_symbols.
  10380. (Object::get_global_symbols): New function.
  10381. * object.cc (Input_objects::add_object): Pass object to cref_ if
  10382. --cref.
  10383. (Input_objects::archive_start): Likewise.
  10384. (Input_objects::archive_stop): Likewise.
  10385. (Input_objects::print_cref): New function.
  10386. * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
  10387. * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
  10388. --cref.
  10389. * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
  10390. function.
  10391. * plugin.h (class Sized_pluginobj): Update declarations.
  10392. 2010-01-05 Ian Lance Taylor <iant@google.com>
  10393. * symtab.cc (Symbol_table::add_from_object): Rename def parameter
  10394. to is_default_version. Rename insdef to insdefault.
  10395. (Symbol_table::add_from_relobj): Rename def to is_default_version
  10396. and local to is_forced_local.
  10397. (Symbol_table::add_from_pluginobj): Likewise.
  10398. (Symbol_table::add_from_dynobj): Likewise.
  10399. (Symbol_table::define_special_symbol): Rename insdef to
  10400. insdefault.
  10401. 2010-01-04 Ian Lance Taylor <iant@google.com>
  10402. PR 10980
  10403. * options.h (class General_options): Add
  10404. --allow-multiple-definition and -z muldefs.
  10405. * resolve.cc (Symbol_table::should_override): Don't warn about a
  10406. multiple symbol definition if --allow-multiple-definition or -z
  10407. muldefs.
  10408. PR 10980
  10409. * options.h (class General_options): Add --add-needed and
  10410. --copy-dt-needed-entries. Tweak --as-needed help entry.
  10411. * object.cc (Input_objects::check_dynamic_dependencies): Give an
  10412. error if --copy-dt-needed-entries aka --add-needed is used and
  10413. would cause a change in behaviour.
  10414. PR 10980
  10415. * options.h (class General_options): Add -G as a short version of
  10416. --shared. Add no-op options -assert, -g, and -i.
  10417. 2010-01-04 Sriraman Tallam <tmsriram@google.com>
  10418. * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
  10419. check for .text or .gnu.linkonce.t sections.
  10420. * icf.cc (Icf::find_identical_sections): Ditto.
  10421. Change the detection for mangled function name within the section
  10422. name.
  10423. * icf.h (is_section_foldable_candidate): New function.
  10424. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10425. PR 10980
  10426. * options.h (class General_options): Permit two dashes with
  10427. --retain-symbols-file.
  10428. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10429. PR 10979
  10430. * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
  10431. don't put the file header and segment headers in the text
  10432. segment.
  10433. PR 10979
  10434. * common.cc (Sort_commons::operator()): Stabilize sort when both
  10435. entries are NULL.
  10436. (Symbol_table::do_allocate_commons_list): When allocating common
  10437. symbols, skip a symbol which is no longer common.
  10438. * symtab.h (Symbol::is_common): Test whether the symbol comes from
  10439. an object before checking its type.
  10440. * testsuite/common_test_2.c: New file.
  10441. * testsuite/common_test_3.c: New file.
  10442. * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
  10443. (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
  10444. (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
  10445. (common_test_2_pic.o, common_test_2.so): New targets.
  10446. (common_test_3_pic.o, common_test_3.so): New targets.
  10447. * testsuite/Makefile.in: Rebuild.
  10448. PR 10979
  10449. * script.cc (read_input_script): If we see a new SECTIONS clause,
  10450. and we have added an input section, give an error.
  10451. * layout.h (class Layout): Add have_added_input_section function.
  10452. Add have_added_input_section_ field.
  10453. * layout.cc (Layout::Layout): Initialize
  10454. have_added_input_section_.
  10455. (Layout::layout): Set have_added_input_section_.
  10456. (Layout::layout_eh_frame): Likewise.
  10457. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10458. PR 10931
  10459. * options.h (class General_options): Add --sort-common option.
  10460. * symtab.h (class Symbol_table): Define Sort_commons_order enum.
  10461. * common.cc (Sort_common): Add sort_order parameter to
  10462. constructor. Add sort_order_ field.
  10463. (Sort_commons::operator): Check sort_order_.
  10464. (Symbol_table::allocate_commons): Determine the sort order.
  10465. (Symbol_table::do_allocate_commons): Add sort_order parameter.
  10466. Change all callers.
  10467. (Symbol_table::do_allocate_commons_list): Likewise.
  10468. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10469. PR 10916
  10470. * symtab.cc (Symbol_table::add_from_relobj): When not exporting
  10471. symbols from this object, don't change the visibility of an
  10472. undefined symbol.
  10473. * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
  10474. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10475. PR 10861
  10476. * script.h (class Version_script_info): Define Language enum.
  10477. Update declarations. Define Glob, Exact, and Lookup types. Add
  10478. new fields globals_, locals_, and is_finalized_.
  10479. * script.cc: Various formatting fixes.
  10480. (class Parser_closure): Change language_stack_ from a vector of
  10481. std::string to one of Version_script_info::Language. Adjust all
  10482. uses accordingly.
  10483. (class Lazy_demangler): Remove.
  10484. (struct Version_expression): Change language from std::string to
  10485. Version_script_info::Language.
  10486. (Version_script_info::Version_script_info): New function.
  10487. (Version_script_info::~Version_script_info): Don't call clear.
  10488. (Version_script_info::finalize): New function.
  10489. (Version_script_info::build_lookup_tables): New function.
  10490. (Version_script_info::build_expression_list_lookup): New
  10491. function.
  10492. (Version_script_info::get_symbol_version_helper): Rewrite to use
  10493. lookup tables.
  10494. (Version_script_info::print_expression_list): Adjust to use
  10495. Version_script_info::Language.
  10496. (script_push_lex_into_version_mode): Check that the version script
  10497. has not been finalized.
  10498. (version_script_push_lang): Change language string to
  10499. Version_script_info::Language.
  10500. * options.cc (Command_line::version_script): New function.
  10501. * options.h (class General_options): Add finalize_dynamic_list
  10502. function. Change version_script from declaration to definition.
  10503. * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
  10504. * testsuite/version_script.map: Remove duplicate def of foo.
  10505. * testsuite/Makefile.am (ver_matching_def.so): Depend upon
  10506. version_script.map.
  10507. * testsuite/Makefile.in: Rebuild.
  10508. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10509. PR 10843
  10510. * target-reloc.h (relocate_for_relocatable): When copying a reloc,
  10511. if the input symbol index is 0, make the output symbol index 0.
  10512. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10513. PR 10670
  10514. * options.h (class General_options): Add -x/--discard-all.
  10515. * object.cc (Sized_relobj::do_count_local_symbols): Handle
  10516. --discard-all. If the local symbol needs a dynamic entry, check
  10517. that before handling --discard-locals.
  10518. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10519. PR 10450
  10520. * output.cc (Output_segment::Output_segment): If PT_TLS, set the
  10521. flags to PF_R.
  10522. (Output_segment::add_output_section): Don't change the flags if
  10523. the type is PT_TLS.
  10524. PR 10450
  10525. * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
  10526. GNU hash table if they need a dynamic value. Otherwise, don't add
  10527. them if they are defined in a dynamic object or are forced local.
  10528. 2009-12-29 Ian Lance Taylor <iant@google.com>
  10529. PR 10450
  10530. * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
  10531. .gnu.hash table for a 32-bit target.
  10532. PR 10450
  10533. * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
  10534. regular and a dynamic object only needs a dynamic symbol table
  10535. entry if it is externally visible.
  10536. PR 10450
  10537. * i386.cc (class Target_i386): Initialize global_offset_table_ in
  10538. constructor. Add global_offset_table_ field.
  10539. (Target_i386::got_section): Set global_offset_table_.
  10540. (Target_i386::do_finalize_sections): Set global_offset_table_
  10541. size.
  10542. * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
  10543. in constructor. Add global_offset_table_ field.
  10544. (Target_x86_64::got_section): Set global_offset_table_.
  10545. (Target_x86_64::do_finalize_sections): Set global_offset_table_
  10546. size.
  10547. * layout.cc (Layout::Layout): Initialize increase_relro_.
  10548. (Layout::get_output_section): Add is_relro, is_last_relro, and
  10549. is_first_non_relro parameters. Change all callers.
  10550. (Layout::choose_output_section): Likewise.
  10551. (Layout::add_output_section_data): Likewise.
  10552. (Layout::make_output_section): Likewise.
  10553. (Layout::set_segment_offsets): Clear increase_relro when using a
  10554. linker script.
  10555. * layout.h (class Layout): Add increase_relro method. Add
  10556. increase_relro_ field. Update declarations.
  10557. * output.cc (Output_section::Output_section): Initialize
  10558. is_last_relro_ and is_first_non_relro_.
  10559. (Output_segment::add_output_section): Group relro sections is
  10560. do_sort is true. Handle is_last_relro and is_first_non_relro.
  10561. (Output_segment::maximum_alignment): Remove relro handling.
  10562. (Output_segment::set_section_addresses): Add increase_relro
  10563. parameter. Change all callers. Add initial alignment to align
  10564. relro sections on separate page. Remove old relro handling.
  10565. (Output_segment::set_section_list_addresses): Remove in_relro
  10566. parameter. Change all callers.
  10567. (Output_segment::set_offset): Add increase parameter. Change all
  10568. callers. Remove old relro handling.
  10569. * output.h (class Output_section): Add new methods: is_last_relro,
  10570. set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
  10571. Add is_last_relro_ and is_first_non_relro_ fields.
  10572. * i386.cc (Target_i386::got_section): Don't call set_is_relro.
  10573. Create separate .got.plt section. Call increase_relro.
  10574. * x86_64.cc (Target_x86_64::got_section): Likewise.
  10575. * testsuite/relro_script_test.t: Add .got.plt.
  10576. PR 10450
  10577. * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
  10578. (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
  10579. (Layout::finalize): Call set_dynamic_symbol_size.
  10580. (Layout::set_dynamic_symbol_size): New function.
  10581. * layout.h (class Layout): Add dynamic_symbol_ field. Declare
  10582. set_dynamic_symbol_size.
  10583. PR 10450
  10584. * output.h (class Output_section): Add is_entsize_zero_ field.
  10585. * output.cc (Output_section::Output_section): Initialize
  10586. is_entsize_zero_.
  10587. (Output_section::set_entsize): If two different entsizes are
  10588. requested, force it to zero.
  10589. (Output_section::add_input_section): Set flags for .debug_str
  10590. before updating section flags. Set entsize.
  10591. (Output_section::update_flags_for_input_section): Set SHF_MERGE
  10592. and SHF_STRING if all input sections have those flags.
  10593. 2009-12-29 Rafael Espindola <espindola@google.com>
  10594. * main.cc (main): Fix the sys time reporting.
  10595. * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
  10596. reporting.
  10597. 2009-12-29 Sriraman Tallam <tmsriram@google.com>
  10598. * options.cc (General_options::parse_version): Allow -v to exit
  10599. without an error if there is nothing to link.
  10600. 2009-12-29 Ian Lance Taylor <iant@google.com>
  10601. * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
  10602. using a version of gcc before 4.1.
  10603. * configure: Rebuild.
  10604. 2009-12-28 Chris Demetriou <cgd@google.com>
  10605. * attributes.cc (Output_attributes_section_data::do_write): Use
  10606. std::vector::front rather than std::vector::data.
  10607. 2009-12-28 Ian Lance Taylor <iant@google.com>
  10608. * symtab.h (class Symbol_table): Add enum Defined.
  10609. * resolve.cc (Symbol_table::should_override): Add defined
  10610. parameter. Change all callers. Test whether object is NULL
  10611. before calling a method on it.
  10612. (Symbol_table::report_resolve_problem): Add defined parameter.
  10613. Change all callers.
  10614. (Symbol_table::should_override_with_special): Likewise.
  10615. * symtab.cc (Symbol_table::define_in_output_data): Add defined
  10616. parameter. Change all callers.
  10617. (Symbol_table::do_define_in_output_data): Likewise.
  10618. (Symbol_table::define_in_output_segment): Likewise.
  10619. (Symbol_table::do_define_in_output_segment): Likewise.
  10620. (Symbol_table::define_as_constant): Likewise.
  10621. (Symbol_table::do_define_as_constant): Likewise.
  10622. * script.h (class Symbol_assignment): Add is_defsym parameter to
  10623. constructor; change all callers.
  10624. * script.cc (Script_options::add_symbol_assignment): Add is_defsym
  10625. parameter. Change all callers. Add is_defsym_ field.
  10626. (class Parser_closure): Add parsing_defsym parameter to
  10627. constructor; change all callers. Add parsing_defsym accessor
  10628. function. Add parsing_defsym_ field.
  10629. 2009-12-28 Ian Lance Taylor <iant@google.com>
  10630. * gold.cc (queue_middle_tasks): Fix formatting.
  10631. * object.cc (Relobj::is_section_name_included): Likewise.
  10632. 2009-12-23 Ian Lance Taylor <iant@google.com>
  10633. * i386.cc (Target_i386::do_calls_non_split): Recognize
  10634. -fsplit-stack prologue for a function with a static chain.
  10635. * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
  10636. -fsplit-stack prologue when using %r11.
  10637. 2009-12-21 Sriraman Tallam <tmsriram@google.com>
  10638. * options.cc (General_options::parse_version): Make -v continue and do
  10639. the link like GNU ld does.
  10640. 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
  10641. * Makefile.am (CCFILES): Add timer.cc.
  10642. (HFILES): Add timer.h.
  10643. * configure.ac: Check for sysconf and times.
  10644. * main.cc: include timer.h.
  10645. (main): Use Timer instead of get_run_time.
  10646. * timer.cc: New.
  10647. * timer.h: New.
  10648. * workqueue.cc: include timer.h.
  10649. (Workqueue::find_and_run_task):
  10650. Report user, sys and wall time.
  10651. * Makefile.in: Regenerate.
  10652. * config.in: Regenerate.
  10653. * configure: Regenerate.
  10654. 2009-12-16 Doug Kwan <dougkwan@google.com>
  10655. * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
  10656. sections.
  10657. * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
  10658. relaxed input sections.
  10659. * output.cc (Output_section::find_relaxed_input_section): Change
  10660. return type to Output_relaxed_input_section pointer. Adjust code
  10661. for new type of relaxed_input_section_map_.
  10662. * output.h (Output_section::find_relaxed_input_section): Change
  10663. return type to Output_relaxed_input_section pointer.
  10664. (Output_section::Output_relaxed_input_section_by_input_section_map):
  10665. New type.
  10666. (Output_section::relaxed_input_section_map_): Change type to
  10667. Output_section::Output_relaxed_input_section_by_input_section_map.
  10668. * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
  10669. input section.
  10670. 2009-12-15 Ian Lance Taylor <iant@google.com>
  10671. * layout.cc (Layout::create_shstrtab): Only write out after input
  10672. sections if we are compressing debug sections.
  10673. 2009-12-15 Ian Lance Taylor <iant@google.com>
  10674. * archive.cc (Archive::add_symbols): Only look up a symbol without
  10675. a version if there is, in fact, a version.
  10676. 2009-12-14 Ian Lance Taylor <iant@google.com>
  10677. Revert -Wshadow changes, all changes from:
  10678. 2009-12-11 Doug Kwan <dougkwan@google.com>
  10679. 2009-12-11 Nick Clifton <nickc@redhat.com>
  10680. * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
  10681. 2009-12-11 Doug Kwan <dougkwan@google.com>
  10682. * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
  10683. due to -Wshadow.
  10684. * attributes.cc (Object_attribute::size): Ditto.
  10685. (Attributes_section_data::size): Ditto.
  10686. (Attributes_section_data::Attributes_section_data): Ditto.
  10687. (Output_attributes_section_data::do_write): Ditto.
  10688. * attributes.h (Object_attribute::set_type): Ditto.
  10689. * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
  10690. 2009-12-11 Nick Clifton <nickc@redhat.com>
  10691. * archive.cc: Fix shadowed variable warnings.
  10692. * arm.cc: Likewise.
  10693. * compressed_output.cc: Likewise.
  10694. * compressed_output.h: Likewise.
  10695. * configure: Likewise.
  10696. * dwarf_reader.cc: Likewise.
  10697. * dynobj.cc: Likewise.
  10698. * dynobj.h: Likewise.
  10699. * ehframe.cc: Likewise.
  10700. * ehframe.h: Likewise.
  10701. * errors.cc: Likewise.
  10702. * expression.cc: Likewise.
  10703. * fileread.cc: Likewise.
  10704. * fileread.h: Likewise.
  10705. * freebsd.h: Likewise.
  10706. * i386.cc: Likewise.
  10707. * icf.cc: Likewise.
  10708. * incremental.h: Likewise.
  10709. * layout.cc: Likewise.
  10710. * layout.h: Likewise.
  10711. * mapfile.cc: Likewise.
  10712. * merge.cc: Likewise.
  10713. * merge.h: Likewise.
  10714. * object.cc: Likewise.
  10715. * object.h: Likewise.
  10716. * options.h: Likewise.
  10717. * output.cc: Likewise.
  10718. * output.h: Likewise.
  10719. * parameters.cc: Likewise.
  10720. * plugin.cc: Likewise.
  10721. * powerpc.cc: Likewise.
  10722. * reduced_debug_output.cc: Likewise.
  10723. * reduced_debug_output.h: Likewise.
  10724. * reloc.cc: Likewise.
  10725. * reloc.h: Likewise.
  10726. * resolve.cc: Likewise.
  10727. * script-sections.cc: Likewise.
  10728. * script.cc: Likewise.
  10729. * script.h: Likewise.
  10730. * sparc.cc: Likewise.
  10731. * symtab.cc: Likewise.
  10732. * symtab.h: Likewise.
  10733. * target-select.cc: Likewise.
  10734. * target-select.h: Likewise.
  10735. * token.h: Likewise.
  10736. * workqueue.cc: Likewise.
  10737. * workqueue.h: Likewise.
  10738. * x86_64.cc: Likewise.
  10739. 2009-12-10 Doug Kwan <dougkwan@google.com>
  10740. * arm.cc (attributes.h): New include.
  10741. (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
  10742. (Arm_relobj::~Arm_relobj): Delete object pointed by
  10743. attributes_section_data_.
  10744. (Arm_relobj::attributes_section_data): New method definition.
  10745. (Arm_relobj::attributes_section_data_): New data member declaration.
  10746. (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
  10747. (Arm_dynobj::~Arm_dynobj): Delete object pointed by
  10748. attributes_section_data_.
  10749. (Arm_dynobj::attributes_section_data): New method definition.
  10750. (Arm_dynobj::attributes_section_data_): New data member declaration.
  10751. (Target_arm::Target_arm): Initialize attributes_section_data_. Change
  10752. initialization value of may_use_blx_ to false.
  10753. (Target_arm::using_thumb2, Target_arm::using_thumb_only,
  10754. Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
  10755. object attributes to compute results instead of hard-coding.
  10756. (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
  10757. Target_arm::get_secondary_compatible_arch,
  10758. Target_arm::set_secondary_compatible_arch
  10759. Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
  10760. Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
  10761. New method declarations.
  10762. (Target_arm::get_aeabi_object_attribute): New method definition.
  10763. (Target_arm::attributes_section_data_): New data member declaration.
  10764. (read_arm_attributes_section): New template definition.
  10765. (Arm_relobj::do_read_symbols): Read attributes section if it exists.
  10766. (Arm_dynobj::do_read_symbols): Ditto.
  10767. (Target_arm::do_finalize_sections): Merge attributes sections from
  10768. input. Check for BLX use after attributes section merging.
  10769. Fix __exidx_start and __exidx_end visibility. Create an
  10770. .ARM.attributes section if necessary.
  10771. (Target_arm::get_secondary_compatible_arch,
  10772. Target_arm::set_secondary_compatible_arch,
  10773. Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
  10774. Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
  10775. Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
  10776. New method definitions.
  10777. 2009-12-09 Ian Lance Taylor <iant@google.com>
  10778. * plugin.cc (Plugin::load): Don't cast from void* to a function
  10779. pointer.
  10780. 2009-12-09 Ian Lance Taylor <iant@google.com>
  10781. * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
  10782. information fields.
  10783. 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
  10784. * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
  10785. Replace two_file_shared_1.so with two_file_shared_2.so.
  10786. * testsuite/Makefile.in: Regenerated.
  10787. 2009-12-08 Doug Kwan <dougkwan@google.com>
  10788. * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
  10789. (HFILES): Add attributes.h and int_encoding.h.
  10790. * Makefile.in: Regenerate.
  10791. * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
  10792. function definitions to int_encoding.cc
  10793. * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
  10794. prototypes to int_encoding.h
  10795. * reduced_debug_output.cc (int_encoding.h): New include.
  10796. (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
  10797. function definitions to int_encoding.cc
  10798. (insert_into_vector, read_from_pointer): Move template definitions to
  10799. int_encoding.h
  10800. * attributes.cc: New file.
  10801. * attributes.h: New file.
  10802. * int_encoding.cc: New file.
  10803. * int_encoding.h: New file.
  10804. 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
  10805. PR gold/11055
  10806. * incremental-dump.cc (dump_incremental_inputs): New.
  10807. (main): Use dump_incremental_inputs.
  10808. 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
  10809. PR gold/10893
  10810. * i386.cc (Target_i386::Scan::globa): Use is_func instead of
  10811. checking elfcpp::STT_FUNC.
  10812. (Target_i386::Relocate::relocate): Likewise.
  10813. * x86_64.cc (Target_x86_64::Scan::global): Likewise.
  10814. * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
  10815. symbols from shared libraries into normal FUNC symbols.
  10816. * symtab.h (Symbol): Add is_func and use it.
  10817. 2009-12-05 Doug Kwan <dougkwan@google.com>
  10818. * arm.cc (Target_arm::arm_info): Initialize new fields
  10819. attributes_section and attributes_vendor.
  10820. * i386.cc (Target_i386::i386_info): Same.
  10821. * object.cc (Sized_relobj::do_layout): Skip attribute section.
  10822. * powerpc.cc (Target_powerpc::powerpc_info): Initialize new
  10823. fields attributes_section and attributes_vendor.
  10824. * sparc.cc (Target_sparc::sparc_info): Same.
  10825. * target.h (Target::attributes_section, Target::attributes_vendor,
  10826. Target::is_attributes_section, Target::attribute_arg_type,
  10827. Target::attributes_order): New method definitions.
  10828. (Target::Target_info::attributes_section,
  10829. Target::Target_info::attributes_vendor): New fields.
  10830. (Target::do_attribute_arg_type, Target::do_attributes_order): New
  10831. virtual method definitions.
  10832. * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
  10833. attributes_section and attributes_vendor.
  10834. * testsuite/testfile.cc (Target_test::test_target_info): Same.
  10835. 2009-12-05 Doug Kwan <dougkwan@google.com>
  10836. * arm.cc: Update comments about interworking and stub generation.
  10837. (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
  10838. considered as non-PIC.
  10839. (Arm_relocate_functions::base_abs): Fix formatting.
  10840. (Arm_relocate_functions::got_prel): Fix comment. Change interface
  10841. of function to use GOT entry address instead of offset.
  10842. (Target_arm::Scan::global): Issue an error if a symbol would need a
  10843. PLT does not get one because it is untyped. Remove code to create
  10844. dynamic symbols for relative branches.
  10845. (Target_arm::Relocate::relocate: Use 0 instead of false since function
  10846. takes unsigned integer instead of boolean.
  10847. 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
  10848. * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
  10849. (two_file_test_LDADD): Likewise.
  10850. (common_test_1_LDADD): Likewise.
  10851. (exception_test_LDADD) Likewise.
  10852. (weak_test_LDADD): Likewise.
  10853. (many_sections_test_LDADD): Likewise.
  10854. (initpri1_LDADD): Likewise.
  10855. (script_test_1_LDADD): Likewise.
  10856. (script_test_2_LDADD): Likewise.
  10857. (justsyms_LDADD): Likewise.
  10858. (binary_test_LDADD): Likewise.
  10859. (large_LDADD): Likewise.
  10860. * testsuite/Makefile.in: Regenerated.
  10861. 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
  10862. * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
  10863. (Symbol_table::override_with_special): Likewise.
  10864. (Symbol_table::add_from_object): Likewise.
  10865. 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
  10866. * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
  10867. Don't set the data_offset twice.
  10868. 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
  10869. * testsuite/Makefile.in: Regenerate.
  10870. 2009-12-03 Doug Kwan <dougkwan@google.com>
  10871. * arm.cc: Remove comment about missing .ARM.exidx section symbols.
  10872. (Target_arm::do_finalize_sections): Add parameter for symbol table
  10873. pointer. Add __exidx_start and __exidx_end symbols as appropriate.
  10874. * i386.cc (Target_i386::do_finalize_sections): Add an additional
  10875. parameter for symbol table pointer.
  10876. * layout.cc (Layout::finalize): Call Target::finalize_sections with
  10877. an additional parameter for a pointer to symbol table.
  10878. * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
  10879. parameter for a symbol table pointer.
  10880. * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
  10881. * target.h (Target::finalize_sections, Target::do_finalize_sections):
  10882. Ditto.
  10883. * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
  10884. parameter for a symbol table pointer.
  10885. 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
  10886. * incremental.cc (Incremental_inputs_header)
  10887. (Incremental_inputs_header_write, Incremental_inputs_entry)
  10888. (Incremental_inputs_entry_write): Move ...
  10889. * incremental.h (Incremental_inputs_header)
  10890. (Incremental_inputs_header_write, Incremental_inputs_entry)
  10891. (Incremental_inputs_entry_write): here.
  10892. 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
  10893. * incremental.cc (make_sized_incremental_binary): Set the target.
  10894. Error if it is incompatible.
  10895. * output.h (Output_file): Add filename method.
  10896. 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
  10897. * incremental.cc (Incremental_inputs_entry): Remove unused argument
  10898. from the get_* methods.
  10899. 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
  10900. * incremental-dump.cc (main): Check that the offeset of a script is 0.
  10901. * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
  10902. Write 0 for the data_offset of scripts.
  10903. 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
  10904. * testsuite/Makefile.am: Add the incremental_test.sh test.
  10905. * testsuite/incremental_test.sh: New.
  10906. * testsuite/incremental_test_1.c: New.
  10907. * testsuite/incremental_test_2.c: New.
  10908. 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
  10909. * incremental-dump.cc (main): Fix typos.
  10910. 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
  10911. PR gold/11025
  10912. * incremental-dump.cc (main): Use llu to print 64 bit values.
  10913. 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
  10914. H.J. Lu <hongjiu.lu@intel.com>
  10915. * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
  10916. $(LIBDL).
  10917. (incremental_dump_LDADD): Likewise.
  10918. * Makefile.in: Regenerated.
  10919. 2009-11-25 Doug Kwan <dougkwan@google.com>
  10920. Revert:
  10921. 2009-11-25 Doug Kwan <dougkwan@google.com>
  10922. * arm.cc (Target_arm::Target_arm): Move method definition
  10923. outside of class definition. Add code to handle
  10924. --target1-rel, --target1-abs and --target2= options.
  10925. (Target_arm::get_reloc_reloc_type): Change method to be
  10926. non-static and const.
  10927. (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
  10928. New data member declaration.
  10929. (Target_arm::Scan::local, Target_arm::Scan::global,
  10930. Target_arm::Relocate::relocate,
  10931. Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
  10932. Adjust call to Target_arm::get_real_reloc_type.
  10933. (Target_arm::get_real_reloc_type): Use command line options
  10934. to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
  10935. * options.h (--target1-rel, --target1-abs, --target2): New
  10936. ARM-only options.
  10937. 2009-11-25 Doug Kwan <dougkwan@google.com>
  10938. * arm.cc (Target_arm::Target_arm): Move method definition outside of
  10939. class definition. Add code to handle --target1-rel, --target1-abs
  10940. and --target2= options.
  10941. (Target_arm::get_reloc_reloc_type): Change method to be non-static
  10942. and const.
  10943. (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
  10944. member declaration.
  10945. (Target_arm::Scan::local, Target_arm::Scan::global,
  10946. Target_arm::Relocate::relocate,
  10947. Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
  10948. call to Target_arm::get_real_reloc_type.
  10949. (Target_arm::get_real_reloc_type): Use command line options to
  10950. determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
  10951. * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
  10952. options.
  10953. 2009-11-25 Doug Kwan <dougkwan@google.com>
  10954. * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
  10955. (Arm_relocate_functions::thumb_branch_common): New metod declaration.
  10956. (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
  10957. formatting.
  10958. (Arm_relocate_functions::thm_call): Replace body with a call to
  10959. Arm_relocate_functions::thumb_branch_common.
  10960. (Arm_relocate_functions::thm_jump24,
  10961. Arm_relocate_functions::thm_xpc22): New method definitions.
  10962. (Arm_relocate_functions::thumb_branch_common): New method definition.
  10963. (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
  10964. operator.
  10965. (Target_arm::Relocate::relocate): Adjust call to thm_call.
  10966. Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
  10967. 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
  10968. * Makefile.am: Build incremental-dump
  10969. * Makefile.in: Regenerate.
  10970. * incremental-dump.cc: New.
  10971. * incremental.cc (Incremental_inputs_header_data,
  10972. Incremental_inputs_entry_data): Move to incremental.h
  10973. * incremental.h: (Incremental_inputs_header_data,
  10974. Incremental_inputs_entry_data): Move from incremental.cc
  10975. 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
  10976. * incremental.cc (Incremental_inputs_header,
  10977. Incremental_inputs_header_write, Incremental_inputs_entry,
  10978. Incremental_inputs_entry_write): Add a typedef with the data type.
  10979. 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
  10980. * incremental.cc (Incremental_inputs_header,
  10981. Incremental_inputs_header_write, Incremental_inputs_entry,
  10982. Incremental_inputs_entry_write): Update comment about which
  10983. type has the filed descriptions.
  10984. 2009-11-15 Doug Kwan <dougkwan@google.com>
  10985. * arm.cc (Target_arm::may_use_arm_nop): New method definition.
  10986. (Arm_relocate_functions::arm_branch_common): Change method defintion
  10987. in class definition to a method declaration and update list of formal
  10988. parameters.
  10989. (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
  10990. Arm_relocation_functions::jump24): Adjust call to
  10991. Arm_relocate_functions::arm_branch_common. Update list of formal
  10992. parameters.
  10993. (Arm_relocate_functions::xpc25): New method definition.
  10994. (Arm_relocate_functions::arm_branch_common): Move method defintion
  10995. out from class definition. Use stubs for mode-switching and extending
  10996. branch ranges.
  10997. (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
  10998. specially. Change code to enable use of stubs in ARM branches.
  10999. 2009-11-10 Doug Kwan <dougkwan@google.com>
  11000. * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
  11001. in method declaration.
  11002. (Target_arm::relocate_stub): New method declaration.
  11003. (Target_arm::default_target): Change to return a pointer instead of
  11004. a const reference.
  11005. (Reloc_stub::stub_type_for_reloc): Adjust for the change in
  11006. Target_arm::default_target.
  11007. (Arm_Relobj::do_relocate_sections): Remove options paramater in
  11008. method definition.
  11009. (Target_arm::relocate_section): Adjust view.
  11010. (Target_arm::relocate_stub): New method definition.
  11011. 2009-11-10 Doug Kwan <dougkwan@google.com>
  11012. * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
  11013. a format warning.
  11014. * incremental.cc (open_incremental_binary): Initialized local
  11015. variables to avoid warnings.
  11016. * object.cc (make_elf_object): Ditto.
  11017. * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
  11018. a format warning.
  11019. 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
  11020. PR gold/10930
  11021. * testsuite/plugin_test.c: Include "config.h".
  11022. 2009-11-09 Doug Kwan <dougkwan@google.com>
  11023. * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
  11024. (arm_symbol_value): Remove.
  11025. (Arm_relocate_functions::arm_branch_common,
  11026. Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
  11027. Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
  11028. Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
  11029. Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
  11030. Arm_relocate_functions::call, Arm_relocate_functions::jump24,
  11031. Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
  11032. Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
  11033. Arm_relocate_functions::thm_mobw_abs_nc,
  11034. Arm_relocate_functions::thm_mov_abs,
  11035. Arm_relocate_functions::movw_prel_nc,
  11036. Arm_relocate_functions::thm_movt_abs,
  11037. Arm_relocate_functions::movt_prel,
  11038. Arm_relocate_functions::thm_movw_prel_nc,
  11039. Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
  11040. (Target_arm::Relocate::relocate): Only decompose address into two
  11041. parts if relocation type uses the thumb-bit and pass the actual
  11042. bit instead of a flag indicating that the thumb-bit is used. Adjust
  11043. calls to methods in Arm_relocate_functions for this change.
  11044. 2009-11-08 Ian Lance Taylor <iant@google.com>
  11045. PR 10925
  11046. * reloc.cc: Instantiate
  11047. Sized_relobj::initialize_input_to_output_maps and
  11048. Sized_relobj:free_input_to_output_maps.
  11049. 2009-11-06 Ian Lance Taylor <iant@google.com>
  11050. PR 10876
  11051. * defstd.cc (in_segment): Set only_if_ref true for "end".
  11052. 2009-11-06 Doug Kwan <dougkwan@google.com>
  11053. * arm.cc (class Reloc_stub): Correct a comment.
  11054. (Target_arm::Target_arm): Initialize arm_input_section_map_.
  11055. (Target_arm::scan_section_for_stubs): New method declaration.
  11056. (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
  11057. Change methods from private to protected.
  11058. (Target_arm::do_may_relax): New method definition.
  11059. (Target_arm::do_relax, Target_arm::group_sections,
  11060. Target_arm::scan_reloc_for_stub,
  11061. Target_arm::scan_reloc_section_for_stubs): New method declarations.
  11062. (Target_arm::arm_input_section_map_): New data member declaration.
  11063. (Target_arm::scan_reloc_for_stub,
  11064. Target_arm::scan_reloc_section_for_stubs,
  11065. Target_arm::scan_section_for_stubs, Target_arm::group_sections,
  11066. Target_arm::do_relax): New method definitions.
  11067. 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
  11068. * configure.ac: Check for (struct stat)::st_mtim
  11069. * fileread.cc (File_read::get_mtime): Use st_mtim if available.
  11070. * config.in: Regenerate.
  11071. * configure: Regenerate.
  11072. 2009-11-05 Ian Lance Taylor <iant@google.com>
  11073. PR 10910
  11074. * output.cc (Output_segment::add_output_section): Add missing
  11075. return statement.
  11076. 2009-11-04 Ian Lance Taylor <iant@google.com>
  11077. PR 10880
  11078. * object.h (class Object): Add is_needed and set_is_needed
  11079. methods. Add is_needed_ field. Make bool fields into bitfields.
  11080. * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
  11081. defined in a dynamic object and referenced by a regular object,
  11082. set is_needed for the dynamic object.
  11083. * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
  11084. if the file is marked with as_needed and it is not needed.
  11085. 2009-11-04 Ian Lance Taylor <iant@google.com>
  11086. PR 10887
  11087. * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
  11088. tags if data is discarded by linker script.
  11089. * i386.cc (Target_i386::do_finalize_sections): Likewise.
  11090. * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
  11091. * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
  11092. * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
  11093. 2009-11-04 Ian Lance Taylor <iant@google.com>
  11094. * layout.cc (Layout::get_output_section): Add is_interp and
  11095. is_dynamic_linker_section parameters. Change all callers.
  11096. (Layout::choose_output_section): Likewise.
  11097. (Layout::make_output_section): Likewise.
  11098. (Layout::add_output_section_data): Add is_dynamic_linker_section
  11099. parameter. Change all callers.
  11100. * layout.h (class Layout): Update declarations.
  11101. * output.h (class Output_section): Add is_interp, set_is_interp,
  11102. is_dynamic_linker_section, set_is_dynamic_linker_section methods.
  11103. Add is_interp_, is_dynamic_linker_section_ fields. Change
  11104. generate_code_fills_at_write_ to a bitfield.
  11105. * output.cc (Output_section::Output_sections): Initialize new
  11106. fields.
  11107. (Output_segment::add_output_section): Add do_sort parameter.
  11108. Change all callers.
  11109. 2009-11-03 Ian Lance Taylor <iant@google.com>
  11110. PR 10860
  11111. * options.h (class General_options): Add --warn-common.
  11112. * resolve.cc (Symbol_table::resolve): Handle --warn-common when
  11113. merging two common symbols.
  11114. (Symbol_table::should_override): Handle --warn-common when merging
  11115. a common symbol with a defined symbol. Use report_resolve_problem
  11116. for multiple definitions.
  11117. (Symbol_table::report_resolve_problem): New function.
  11118. * symtab.h (class Symbol_table): Declare report_resolve_problem.
  11119. 2009-11-03 Doug Kwan <dougkwan@google.com>
  11120. * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
  11121. stub_factory_.
  11122. (Target_arm::stub_factory): New method definition.
  11123. (Target_arm::new_arm_input_section,
  11124. Target_arm::find_arm_input_section, Target_arm::new_stub_table,
  11125. Target_arm::reloc_uses_thumb_bit): New method declarations.
  11126. (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
  11127. New type definitions.
  11128. (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
  11129. member declarations.
  11130. (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
  11131. Target_arm::find_arm_input_section, Target_arm::new_stub_table):
  11132. New method definitions.
  11133. 2009-11-03 Ian Lance Taylor <iant@google.com>
  11134. * options.h (class General_options): Add --warn_constructors.
  11135. 2009-11-03 Ian Lance Taylor <iant@google.com>
  11136. PR 10893
  11137. * defstd.cc (in_section): Add entries for __rel_iplt_start,
  11138. __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
  11139. 2009-11-03 Ian Lance Taylor <iant@google.com>
  11140. PR 10895
  11141. * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
  11142. --msgid-bugs-address.
  11143. (install-pdf): New target.
  11144. (install-data_yes): Look up one directory to find mkinstalldirs.
  11145. 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
  11146. * po/Make-in (.po.gmo): Don't generate .gmo files in source
  11147. tree.
  11148. 2009-10-30 Doug Kwan <dougkwan@google.com>
  11149. * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
  11150. 2009-10-30 Doug Kwan <dougkwan@google.com>
  11151. * arm.cc (Stub_addend_reader): New struct template definition
  11152. and partial specializations.
  11153. (Stub_addend_reader::operator()): New method definition for a
  11154. partially specialized template.
  11155. 2009-10-30 Doug Kwan <dougkwan@google.com>
  11156. * arm.cc (Arm_relobj::processor_specific_flags): New method
  11157. definition.
  11158. (Arm_relobj::do_read_symbols): New method declaration.
  11159. (Arm_relobj::processor_specific_flags_): New data member declaration.
  11160. (Arm_dynobj): New class definition.
  11161. (Target_arm::do_finalize_sections): Add input_objects parameter.
  11162. (Target_arm::do_adjust_elf_header): New method declaration.
  11163. (Target_arm::are_eabi_versions_compatible,
  11164. (Target_arm::merge_processor_specific_flags): New method declaration.
  11165. (Target_arm::do_make_elf_object): New overloaded method definitions
  11166. and declaration.
  11167. (Arm_relobj::do_read_symbols): New method definition.
  11168. (Arm_dynobj::do_read_symbols): Ditto.
  11169. (Target_arm::do_finalize_sections): Add input_objects parameters.
  11170. Merge processor-specific flags from all input objects.
  11171. (Target_arm::are_eabi_versions_compatible,
  11172. Target_arm::merge_processor_specific_flags,
  11173. Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
  11174. New method definitions.
  11175. * i386.cc (Target_i386::do_finalize_sections): Add unnamed
  11176. Input_objects pointer type parameter.
  11177. * layout.cc (Layout::finalize): Pass input objects to target's.
  11178. finalize_sections function.
  11179. * output.cc (Output_file_header::do_sized_write): Set ELF file
  11180. header's processor-specific flags.
  11181. * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
  11182. Input_objects pointer type parameter.
  11183. * sparc.cc (Target_sparc::do_finalize_sections): Same.
  11184. * target.h (Input_objects): New forward class declaration.
  11185. (Target::processor_specific_flags,
  11186. Target::are_processor_specific_flags_sect): New method definitions.
  11187. (Target::finalize_sections): Add input_objects parameter.
  11188. (Target::Target): Initialize processor_specific_flags_ and
  11189. are_processor_specific_flags_set_.
  11190. (Target::do_finalize_sections): Add unnamed Input_objects pointer type
  11191. parameter.
  11192. (Target::set_processor_specific_flags): New method definition.
  11193. (Target::processor_specific_flags_,
  11194. Target::are_processor_specific_flags_set_): New data member
  11195. declarations.
  11196. * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
  11197. Input_objects pointer type parameter.
  11198. 2009-10-30 Doug Kwan <dougkwan@google.com>
  11199. * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
  11200. 2009-10-28 Ian Lance Taylor <iant@google.com>
  11201. * object.h (class Relobj): Drop options parameter from
  11202. gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
  11203. do_scan_relocs, do_relocate. Change all callers.
  11204. (class Sized_relobj): Drop options parameters from
  11205. do_gc_process_relocs, do_scan_relocs, do_relocate,
  11206. do_relocate_sections, relocate_sections, emit_relocs_scan,
  11207. emit_relocs_scan_reltype. Change all callers.
  11208. (struct Relocate_info): Remove options field and all references to
  11209. it.
  11210. * reloc.h (class Read_relocs): Remove options constructor
  11211. parameter and options_ field. Change all callers.
  11212. (class Gc_process_relocs, class Scan_relocs): Likewise.
  11213. (class Relocate_task): Likewise.
  11214. * target-reloc.h (scan_relocs): Remove options parameter. Change
  11215. all callers.
  11216. (scan_relocatable_relocs): Likewise.
  11217. * target.h (class Sized_target): Remove options parameter from
  11218. gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
  11219. all callers.
  11220. * gc.h (gc_process_relocs): Remove options parameter. Change all
  11221. callers.
  11222. * arm.cc: Update functions to remove options parameters.
  11223. * i386.cc: Likewise.
  11224. * powerpc.cc: Likewise.
  11225. * sparc.cc: Likewise.
  11226. * x86_64.cc: Likewise.
  11227. * testsuite/testfile.cc: Likewise.
  11228. 2009-10-28 Doug Kwan <dougkwan@google.com>
  11229. * arm.cc (Arm_relobj): New class definition.
  11230. (Arm_relobj::scan_sections_for_stubs,
  11231. Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
  11232. New method definitions.
  11233. 2009-10-28 Cary Coutant <ccoutant@google.com>
  11234. * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
  11235. (Plugin::cleanup_done_): New member.
  11236. (Plugin_manager::Plugin_manager): Remove cleanup_done_.
  11237. (Plugin_manager::cleanup_done_): Remove.
  11238. (Plugin_manager::add_input_file): Edit error message.
  11239. * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
  11240. (Plugin_manager::cleanup): Remove use of cleanup_done_.
  11241. 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
  11242. * fileread.cc: (File_read::View::~View): Use the new
  11243. data_ownership_ filed.
  11244. (File_read::~File_read): Dispose the new whole_file_view_.
  11245. (File_read::open): Mmap the whole file if needed.
  11246. (File_read::open): Use whole_file_view_ instead of contents_.
  11247. (File_read::find_view): Use whole_file_view_ if applicable.
  11248. (File_read::do_read): Use whole_file_view_ instead of contents_.
  11249. (File_read::make_view): Use whole_file_view_ instead of contents_,
  11250. update File_read::View::View call.
  11251. (File_read::find_or_make_view): Update File_read::View::View
  11252. call.
  11253. * fileread.h: (File_read::File_read): Initialize whole_file_view_,
  11254. remove contents_
  11255. (File_read::View::Data_ownership): New enum.
  11256. (File_read::View::View): Replace bool mapped_ with Data_ownership
  11257. argument.
  11258. (File_read::View::mapped_): Remove (replaced by data_ownership_).
  11259. (File_read::View::data_ownership_): New field.
  11260. (File_read::contents_): Remove (replaced by whole_file_view_).
  11261. (File_read::whole_file_view_): New field.
  11262. * options.h (class General_options): Add --keep-files-mapped.
  11263. 2009-10-27 Cary Coutant <ccoutant@google.com>
  11264. * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
  11265. * testsuite/Makefile.am (plugin_test_5): New test case.
  11266. * testsuite/Makefile.in: Regenerate.
  11267. 2009-10-25 Doug Kwan <dougkwan@google.com>
  11268. * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
  11269. from private to protected to allow access by child class.
  11270. (Sized_relobj::do_relocate_sections): New method declaration.
  11271. (Sized_relobj::relocate_sections): Virtualize.
  11272. * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
  11273. Sized_relobj::relocate_sections. Instantiate template explicitly
  11274. for different target sizes and endianity.
  11275. 2009-10-24 Doug Kwan <dougkwan@google.com>
  11276. * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
  11277. (Arm_input_section::as_arm_input_section): New method.
  11278. (Arm_output_section): New class definition.
  11279. (Arm_output_section::create_stub_group,
  11280. Arm_output_section::group_sections): New method definitions.
  11281. 2009-10-22 Doug Kwan <dougkwan@google.com>
  11282. * arm.cc (Arm_input_section): New class definition.
  11283. (Arm_input_section::init, Arm_input_section:do_write,
  11284. Arm_input_section::set_final_data_size,
  11285. Arm_input_section::do_reset_address_and_file_offset): New method
  11286. definitions.
  11287. 2009-10-21 Doug Kwan <dougkwan@google.com>
  11288. * arm.cc (Stub_table, Arm_input_section): New forward class
  11289. declarations.
  11290. (Stub_table): New class defintion.
  11291. (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
  11292. Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
  11293. New method definition.
  11294. 2009-10-21 Doug Kwan <dougkwan@google.com>
  11295. * arm.cc: Update copyright comments.
  11296. (Target_arm): New forward class template declaration.
  11297. (Arm_address): New type.
  11298. (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
  11299. THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
  11300. THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
  11301. constants.
  11302. (Insn_template): Same.
  11303. (DEF_STUBS): New macro.
  11304. (Stub_type): New enum type.
  11305. (Stub_template): New class definition.
  11306. (Stub): Same.
  11307. (Reloc_stub): Same.
  11308. (Stub_factory): Same.
  11309. (Target_arm::Target_arm): Initialize may_use_blx_ and
  11310. should_force_pic_veneer_.
  11311. (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
  11312. Target_arm::should_force_pic_veneer,
  11313. Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
  11314. Target_arm::using_thumb_only, Target_arm:;default_target): New
  11315. method defintions.
  11316. (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
  11317. New data member declarations.
  11318. (Insn_template::size, Insn_template::alignment): New method defintions.
  11319. (Stub_template::Stub_template): New method definition.
  11320. (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
  11321. Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
  11322. (Stub_factory::Stub_factory): New method definition.
  11323. * gold.h (string_hash): New template.
  11324. * output.h (Input_section_specifier::hash_value): Use
  11325. gold::string_hash.
  11326. (Input_section_specifier::string_hash): Remove.
  11327. * stringpool.cc (Stringpool_template::string_hash): Use
  11328. gold::string_hash.
  11329. 2009-10-20 Doug Kwan <dougkwan@google.com>
  11330. * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
  11331. symbols of relaxed input sections.
  11332. * output.h (Output_section::find_relaxed_input_section): Make
  11333. method public.
  11334. 2009-10-16 Doug Kwan <dougkwan@google.com>
  11335. * dynobj.cc (Versions::Versions): Initialize version_script_.
  11336. Only insert base version symbol definition for a shared object
  11337. if version script defines any version versions.
  11338. (Versions::define_base_version): New method definition.
  11339. (Versions::add_def): Check that base version is not needed.
  11340. (Versions::add_need): Define base version lazily.
  11341. * dynobj.h (Versions::define_base_version): New method declaration.
  11342. (Versions::needs_base_version_): New data member declaration.
  11343. * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
  11344. (check_DATA): Add no_version_test.stdout.
  11345. (libno_version_test.so, no_version_test.o no_version_test.stdout):
  11346. New make rules.
  11347. * testsuite/Makefile.in: Regenerate.
  11348. * testsuite/no_version_test.c: New file.
  11349. * testsuite/no_version_test.sh: Ditto.
  11350. 2009-10-16 Doug Kwan <dougkwan@google.com>
  11351. * expression.cc (class Segment_start_expression): New class definition.
  11352. (Segment_start_expression::value): New method definition.
  11353. (script_exp_function_segment_start): Return a new
  11354. Segment_start_expression.
  11355. * script-c.h (script_saw_segment_start_expression): New function
  11356. prototype.
  11357. * script-sections.cc (Script_sections::Script_sections): Initialize
  11358. SAW_SEGMENT_START_EXPRESSION_ to false.
  11359. (Script_sections::set_section_addresses): Use -Ttext, -Tdata
  11360. and -Tbbs options to specify section addresses if given in
  11361. command line and no SEGMENT_START expression is seen in a script.
  11362. * script-sections.h (Script_sections::saw_segment_start_expression,
  11363. Script_sections::set_saw_segment_start_expression): New method
  11364. definition.
  11365. (Script_sections::saw_segment_start_expression_): New data member
  11366. declaration.
  11367. * script.cc (script_saw_segment_start_expression): New function.
  11368. * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
  11369. * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
  11370. script_test_7.sh and script_test_8.sh.
  11371. (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
  11372. script_test_8.stdout.
  11373. (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
  11374. (script_test_6, script_test_6.stdout, script_test_7,
  11375. script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
  11376. * Makefile.in: Regenerate.
  11377. * testsuite/script_test_6.sh: New file.
  11378. * testsuite/script_test_6.t: Same.
  11379. * testsuite/script_test_7.sh: Same.
  11380. * testsuite/script_test_7.t: Same.
  11381. * testsuite/script_test_8.sh: Same.
  11382. 2009-10-16 Doug Kwan <dougkwan@google.com>
  11383. * output.cc (Output_segment::set_section_list_address): Cast
  11384. expressions to unsigned long long type to avoid format warnings.
  11385. 2009-10-15 Ian Lance Taylor <iant@google.com>
  11386. * script.cc (Script_options::add_symbol_assignment): Always add a
  11387. dot assignment to script_sections_.
  11388. * script-sections.cc (Script_sections::add_dot_assignment):
  11389. Initialize if necessary.
  11390. * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
  11391. program headers with no load segment if there is a linker script.
  11392. * layout.cc (Layout::set_segment_offsets): Align the file offset
  11393. to the segment aligment for -N or -n with no load segment.
  11394. * output.cc (Output_segment::add_output_section): Don't crash if
  11395. the first section is a TLS section.
  11396. (Output_segment::set_section_list_addresses): Print an error
  11397. message if the address moves backward in a linker script.
  11398. * script-sections.cc
  11399. (Output_section_element_input::set_section_addresses): Don't
  11400. increase *dot_value for a SHF_TLS/SHT_NOBITS section.
  11401. (Orphan_output_section::set_section_addresses): Likewise.
  11402. 2009-10-15 Doug Kwan <dougkwan@google.com>
  11403. * layout.cc (Layout::finish_dynamic_section): Generate tags
  11404. DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
  11405. DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
  11406. used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
  11407. 2009-10-14 Ian Lance Taylor <iant@google.com>
  11408. * object.h (class Relocate_info): Add reloc_shdr and data_shdr
  11409. fields.
  11410. * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
  11411. data_shdr fields of relinfo.
  11412. * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
  11413. (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
  11414. R_386_TLS_LDO_32, adjust based on section flags.
  11415. (Target_i386::Relocate::fix_up_ldo): Remove.
  11416. 2009-10-13 Ian Lance Taylor <iant@google.com>
  11417. Add support for -pie.
  11418. * options.h (class General_options): Add -pie and
  11419. --pic-executable.
  11420. (General_options::output_is_position_independent): Test -pie.
  11421. (General_options::output_is_executable): Return true if not shared
  11422. and not relocatable.
  11423. (General_options::output_is_pie): Remove.
  11424. * options.cc (General_options::finalize): Reject incompatible uses
  11425. of -pie.
  11426. * gold.cc (queue_middle_tasks): A -pie link is not static.
  11427. * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
  11428. * symtab.cc (Symbol::final_value_is_known): Return false if
  11429. output_is_position_independent.
  11430. * layout.cc (Layout::set_segment_offsets): Start at address 0 if
  11431. output_is_position_independent.
  11432. * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
  11433. output_is_position_independent.
  11434. * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
  11435. output_is_position_independent.
  11436. * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
  11437. two_file_pie_test.
  11438. (basic_pie_test.o, basic_pie_test): New targets.
  11439. (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
  11440. (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
  11441. (two_file_pie_test): New target.
  11442. * testsuite/Makefile.in: Rebuild.
  11443. * README: Remove note saying that -pie is not supported.
  11444. 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
  11445. * options.h (class General_options): Add -init and -fini.
  11446. * layout.cc (Layout::finish_dynamic_section): Emit
  11447. given init and fini functions.
  11448. 2009-10-13 Sriraman Tallam <tmsriram@google.com>
  11449. * gc.h (gc_process_relocs): Check if icf is enabled using new
  11450. function.
  11451. * gold.cc (queue_initial_tasks): Likewise.
  11452. (queue_middle_tasks): Likewise.
  11453. * object.cc (do_layout): Likewise.
  11454. * symtab.cc (is_section_folded): Likewise.
  11455. * main.cc (main): Likewise.
  11456. * reloc.cc (Read_relocs::run): Likewise.
  11457. (Sized_relobj::do_scan_relocs): Likewise.
  11458. * icf.cc (is_function_ctor_or_dtor): New function.
  11459. (Icf::find_identical_sections): Check if function is ctor or dtor when
  11460. safe icf is chosen.
  11461. * options.h (General_options::icf): Change option to be an enum.
  11462. (Icf_status): New enum.
  11463. (icf_enabled): New method.
  11464. (icf_safe_folding): New method.
  11465. (set_icf_status): New method.
  11466. (icf_status_): New variable.
  11467. * (options.cc) (General_options::finalize): Set icf_status_.
  11468. * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
  11469. icf_test and icf_keep_unique_test to use the --icf enum flag.
  11470. * testsuite/icf_safe_test.sh: New file.
  11471. * testsuite/icf_safe_test.cc: New file.
  11472. 2009-10-12 Sriraman Tallam <tmsriram@google.com>
  11473. * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
  11474. includes to gc.h and icf.h.
  11475. * arm.cc: Include gc.h.
  11476. * gold.cc: Likewise.
  11477. * i386.cc: Likewise.
  11478. * powerpc.cc: Likewise.
  11479. * sparc.cc: Likewise.
  11480. * x86_64.cc: Likewise.
  11481. * gc.h: Include icf.h.
  11482. 2009-10-11 Ian Lance Taylor <iant@google.com>
  11483. * plugin.cc: Include "gold.h" before other header files.
  11484. 2009-10-10 Chris Demetriou <cgd@google.com>
  11485. * options.h (Input_file_argument::Input_file_type): New enum.
  11486. (Input_file_argument::is_lib_): Replace with...
  11487. (Input_file_argument::type_): New member.
  11488. (Input_file_argument::Input_file_argument): Take Input_file_type
  11489. 'type' rather than boolean 'is_lib' as second argument.
  11490. (Input_file_argument::is_lib): Use type_.
  11491. (Input_file_argument::is_searched_file): New function.
  11492. (Input_file_argument::may_need_search): Handle is_searched_file.
  11493. * options.cc (General_options::parse_library): Support -l:filename.
  11494. (General_options::parse_just_symbols): Update for Input_file_argument
  11495. changes.
  11496. (Command_line::process): Likewise.
  11497. * archive.cc (Archive::get_file_and_offset): Likewise.
  11498. * plugin.cc (Plugin_manager::release_input_file): Likewise.
  11499. * script.cc (read_script_file, script_add_file): Likewise.
  11500. * fileread.cc (Input_file::Input_file): Likewise.
  11501. (Input_file::will_search_for): Handle is_searched_file.
  11502. (Input_file::open): Likewise.
  11503. * readsyms.cc (Read_symbols::get_name): Likewise.
  11504. * testsuite/Makefile.am (searched_file_test): New test.
  11505. * testsuite/Makefile.in: Regenerate.
  11506. * testsuite/searched_file_test.cc: New file.
  11507. * testsuite/searched_file_test_lib.cc: New file.
  11508. 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
  11509. Ian Lance Taylor <iant@google.com>
  11510. * descriptor.cc: Include <cstdio> and "binary-io.h".
  11511. (Descriptors::open): Open the files in binary mode always.
  11512. * script.cc (Lex::get_token): Treat \r as whitespace.
  11513. 2009-10-09 Ian Lance Taylor <iant@google.com>
  11514. * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
  11515. 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
  11516. Ian Lance Taylor <iant@google.com>
  11517. * configure.ac: Check for readv function also.
  11518. * fileread.cc (readv): Define if not HAVE_READV.
  11519. * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
  11520. does not exist.
  11521. * config.in: Regenerate.
  11522. * configure: Regenerate.
  11523. 2009-10-09 Doug Kwan <dougkwan@google.com>
  11524. * layout.cc (Layout::make_output_section): Call target hook to make
  11525. ordinary output section.
  11526. (Layout::finalize): Adjust parameter list of call the
  11527. Target::may_relax().
  11528. * layout.h (class Layout::section_list): New method.
  11529. * merge.h (Output_merge_base::entsize): Change visibility to public.
  11530. (Output_merge_base::is_string, Output_merge_base::do_is_string):
  11531. New methods.
  11532. (Output_merge_string::do_is_string): New method.
  11533. * object.cc (Sized_relobj::do_setup): renamed from
  11534. Sized_relobj::set_up.
  11535. * object.h (Sized_relobj::adjust_shndx,
  11536. Sized_relobj::initializ_input_to_output_maps,
  11537. Sized_relobj::free_input_to_output_maps): Change visibilities to
  11538. protected.
  11539. (Sized_relobj::setup): Virtualize.
  11540. (Sized_relobj::do_setup): New method declaration.
  11541. (Sized_relobj::invalidate_section_offset,
  11542. Sized_relobj::do_invalidate_section_offset): New method decfinitions.
  11543. (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
  11544. * options.cc (parse_int): New function.
  11545. * options.h (parse_int): New declaration.
  11546. (DEFINE_int): New macro.
  11547. (stub_group_size): New option.
  11548. * output.cc (Output_section::Output_section): Initialize memebers
  11549. merge_section_map_, merge_section_by_properties_map_,
  11550. relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
  11551. (Output_section::add_input_section): Handled deferred code-fill
  11552. generation and remove an old comment.
  11553. (Output_section::add_relaxed_input_section): New method definition.
  11554. (Output_section::add_merge_input_section): Use merge section by
  11555. properties map to speed to search. Update merge section maps
  11556. as appropriate.
  11557. (Output_section::build_relaxation_map): New method definition.
  11558. (Output_section::convert_input_sections_in_list_to_relaxed_sections):
  11559. Same.
  11560. (Output_section::relax_input_section): Renamed to
  11561. Output_section::convert_input_sections_to_relaxed_sections and change
  11562. interface to take a vector of pointers to relaxed sections.
  11563. (Output_section::find_merge_section,
  11564. Output_section::find_relaxed_input_section): New method definitions.
  11565. (Output_section::is_input_address_mapped,
  11566. Output_section::output_offset, Output_section::output_address):
  11567. Use output section data maps to speed up searching.
  11568. (Output_section::find_starting_output_address): Add comments.
  11569. (Output_section::do_write,
  11570. Output_section::write_to_postprocessing_buffer): Do code-fill
  11571. generation as appropriate.
  11572. (Output_section::get_input_sections): Invalidate relaxed input section
  11573. map.
  11574. (Output_section::restore_states): Adjust type of checkpoint .
  11575. Invalidate relaxed input section map.
  11576. * output.h (Output_merge_base): New class declaration.
  11577. (Input_section_specifier): New class defintion.
  11578. (class Output_relaxed_input_section) Change base class to
  11579. Output_section_data_build.
  11580. (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
  11581. base class initializer.
  11582. (Output_section::add_relaxed_input_section): New method declaration.
  11583. (Output_section::Input_section): Change visibility to protected.
  11584. (Output_section::Input_section::relobj,
  11585. Output_section::Input_section::shndx): Handle relaxed input sections.
  11586. Output_section::input_sections) Change visibility to protected. Also
  11587. define overload to return a non-const pointer.
  11588. (Output_section::Merge_section_properties): New class defintion.
  11589. (Output_section::Merge_section_by_properties_map,
  11590. Output_section::Output_section_data_by_input_section_map,
  11591. Output_section::Relaxation_map): New types.
  11592. (Output_section::relax_input_section): Rename method to
  11593. Output_section::convert_input_sections_to_relaxed_sections and change
  11594. interface to take a vector of relaxed section pointers.
  11595. (Output_section::find_merge_section,
  11596. Output_section::find_relaxed_input_section,
  11597. Output_section::build_relaxation_map,
  11598. Output_section::convert_input_sections_in_list_to_relaxed_sections):
  11599. New method declarations.
  11600. (Output_section::merge_section_map_
  11601. Output_section::merge_section_by_properties_map_,
  11602. Output_section::relaxed_input_section_map_,
  11603. Output_section::is_relaxed_input_section_map_valid_,
  11604. Output_section::generate_code_fills_at_write_): New data members.
  11605. * script-sections.cc
  11606. (Output_section_element_input::set_section_addresses): Call
  11607. current_data_size and addralign methods of relaxed input sections.
  11608. (Orphan_output_section::set_section_addresses): Call current_data_size
  11609. and addralign methods of relaxed input sections.
  11610. * symtab.cc (Symbol_table::compute_final_value): Extract template
  11611. from the body of Symbol_table::sized_finalize_symbol.
  11612. (Symbol_table::sized_finalized_symbol): Call
  11613. Symbol_table::compute_final_value.
  11614. * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
  11615. (Symbol_table::compute_final_value): New templated method declaration.
  11616. * target.cc (Target::do_make_output_section): New method defintion.
  11617. * target.h (Target::make_output_section): New method declaration.
  11618. (Target::relax): Add more parameters for input objects, symbol table
  11619. and layout. Adjust call to do_relax.
  11620. (Target::do_make_output_section): New method declaration.
  11621. (Target::do_relax): Add parameters for input objects, symbol table
  11622. and layout.
  11623. 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
  11624. * pread.c: Include stdio.h.
  11625. 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
  11626. * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
  11627. defined.
  11628. 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
  11629. * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
  11630. Change read_shndx type to unsigned int.
  11631. (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
  11632. int.
  11633. (Sized_dwarf_line_info::read_line_mappings): Likewise.
  11634. * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
  11635. Change read_shndx type to unsigned int.
  11636. (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
  11637. int.
  11638. (Sized_dwarf_line_info::read_line_mappings): Likewise.
  11639. * layout.cc (Layout::create_symtab_sections): Cast the result of
  11640. local_symcount * symsize to off_t in the gold_assert.
  11641. 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  11642. * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
  11643. R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
  11644. R_ARM_BASE_ABS.
  11645. (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
  11646. (Arm_relocate_functions::thm_abs5): New function.
  11647. (Arm_relocate_functions::abs12): New function.
  11648. (Arm_relocate_functions::abs16): New function.
  11649. (Arm_relocate_functions::base_abs): New function.
  11650. (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
  11651. (Scan::local): Remove special handling of R_ARM_ABS8. Handle
  11652. R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
  11653. R_ARM_BASE_ABS.
  11654. (Scan::global): Likewise.
  11655. (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
  11656. R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
  11657. (Relocatable_size_for_reloc::get_size_for_reloc): Handle
  11658. R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
  11659. R_ARM_BASE_ABS.
  11660. 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  11661. * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
  11662. (Arm_relocate_functions::movt_prel): New function.
  11663. (Arm_relocate_functions::thm_movw_prel_nc): New function.
  11664. (Arm_relocate_functions::thm_movt_prel): New function.
  11665. (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
  11666. R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
  11667. (Scan::global, Relocate::relocate): Likewise.
  11668. (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
  11669. 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
  11670. * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
  11671. Incremental_checker.
  11672. * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
  11673. unsigned int.
  11674. (class Incremental_inputs_header): New class.
  11675. (Incremental_inputs_header_writer): Edit comment.
  11676. (Incremental_inputs_entry): New class.
  11677. (Incremental_inputs_entry_writer): Edit comment.
  11678. (Sized_incremental_binary::do_find_incremental_inputs_section):
  11679. Add *strtab_shndx parameter, fill it.
  11680. (Sized_incremental_binary::do_check_inputs): New method.
  11681. (Incremental_checker::can_incrementally_link_output_file): Use
  11682. Sized_incremental_binary::check_inputs.
  11683. (Incremental_inputs::report_command_line): Save command line in
  11684. command_line_.
  11685. * incremental.h:
  11686. (Incremental_binary::find_incremental_inputs_section): New
  11687. method.
  11688. (Incremental_binary::do_find_incremental_inputs_section): Add
  11689. strtab_shndx parameter.
  11690. (Incremental_binary::do_check_inputs): New pure virtual method.
  11691. (Sized_incremental_binary::do_check_inputs): Declare.
  11692. (Incremental_checker::Incremental_checker): Add incremental_inputs
  11693. parameter, use it to initialize incremental_inputs_.
  11694. (Incremental_checker::incremental_inputs_): New field.
  11695. (Incremental_checker::command_line): New method.
  11696. (Incremental_checker::inputs): New method.
  11697. (Incremental_checker::command_line_): New field.
  11698. 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
  11699. * incremental.cc: Include <cstdarg> and "target-select.h".
  11700. (vexplain_no_incremental): New function.
  11701. (explain_no_incremental): New function.
  11702. (Incremental_binary::error): New method.
  11703. (Sized_incremental_binary::do_find_incremental_inputs_section): New
  11704. method.
  11705. (make_sized_incremental_binary): New function.
  11706. (open_incremental_binary): New function.
  11707. (can_incrementally_link_file): Add checks if output is ELF and has
  11708. inputs section.
  11709. * incremental.h: Include "elfcpp_file.h" and "output.h".
  11710. (Incremental_binary): New class.
  11711. (Sized_incremental_binary): New class.
  11712. (open_incremental_binary): Declare.
  11713. * object.cc (is_elf_object): Use
  11714. elfcpp::Elf_recognizer::is_elf_file.
  11715. (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
  11716. * output.h (Output_file::filesize): New method.
  11717. 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  11718. * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
  11719. New function.
  11720. (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
  11721. (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
  11722. function.
  11723. (Arm_relocate_functions::insert_val_thumb_movw_movt): New
  11724. function.
  11725. (Arm_relocate_functions::movw_abs_nc): New function.
  11726. (Arm_relocate_functions::movt_abs): New function.
  11727. (Arm_relocate_functions::thm_movw_abs_nc): New function.
  11728. (Arm_relocate_functions::thm_movt_abs): New function.
  11729. (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
  11730. R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
  11731. (Scan::global): Likewise.
  11732. (Relocate::relocate): Likewise.
  11733. (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
  11734. 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  11735. * arm.cc (Arm_relocate_functions::got_prel) New function.
  11736. (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
  11737. (Relocate::relocate): Likewise.
  11738. (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
  11739. 2009-10-06 Ian Lance Taylor <iant@google.com>
  11740. * options.h (class General_options): Define
  11741. split_stack_adjust_size parameter.
  11742. * object.h (class Object): Add uses_split_stack_ and
  11743. has_no_split_stack_ fields. Add uses_split_stack and
  11744. has_no_split_stack accessor functions. Declare
  11745. handle_split_stack_section.
  11746. (class Reloc_symbol_changes): Define.
  11747. (class Sized_relobj): Define Function_offsets. Declare
  11748. split_stack_adjust, split_stack_adjust_reltype, and
  11749. find_functions.
  11750. * object.cc (Object::handle_split_stack_section): New function.
  11751. (Sized_relobj::do_layout): Call handle_split_stack_section.
  11752. * dynobj.cc (Sized_dynobj::do_layout): Call
  11753. handle_split_stack_section.
  11754. * reloc.cc (Sized_relobj::relocate_sections): Call
  11755. split_stack_adjust for executable sections in split_stack
  11756. objects. Pass reloc_map to relocate_section.
  11757. (Sized_relobj::split_stack_adjust): New function.
  11758. (Sized_relobj::split_stack_adjust_reltype): New function.
  11759. (Sized_relobj::find_functions): New function.
  11760. * target-reloc.h: Include "object.h".
  11761. (relocate_section): Add reloc_symbol_changes parameter. Change
  11762. all callers.
  11763. * target.h (class Target): Add calls_non_split method. Declare
  11764. do_calls_non_split virtual method. Declare match_view and
  11765. set_view_to_nop.
  11766. * target.cc: Include "elfcpp.h".
  11767. (Target::do_calls_non_split): New function.
  11768. (Target::match_view): New function.
  11769. (Target::set_view_to_nop): New function.
  11770. * gold.cc (queue_middle_tasks): Give an error if mixing
  11771. split-stack and non-split-stack objects with -r.
  11772. * i386.cc (Target_i386::relocate_section): Add
  11773. reloc_symbol_changes parameter.
  11774. (Target_i386::do_calls_non_split): New function.
  11775. * x86_64.cc (Target_x86_64::relocate_section): Add
  11776. reloc_symbol_changes parameter.
  11777. (Target_x86_64::do_calls_non_split): New function.
  11778. * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
  11779. parameter.
  11780. * powerpc.cc (Target_powerpc::relocate_section): Add
  11781. reloc_symbol_changes parameter.
  11782. * sparc.cc (Target_sparc::relocate_section): Add
  11783. reloc_symbol_changes parameter.
  11784. * configure.ac: Call AM_CONDITIONAL for the default target.
  11785. * configure: Rebuild.
  11786. * testsuite/Makefile.am (TEST_AS): New variable.
  11787. (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
  11788. (check_DATA): Add split_i386 and split_x86_64 files.
  11789. (SPLIT_DEFSYMS): Define.
  11790. (split_i386_[1234n].o): New targets.
  11791. (split_i386_[124]): New targets.
  11792. (split_i386_[1234r].stdout): New targets.
  11793. (split_x86_64_[1234n].o): New targets.
  11794. (split_x86_64_[124]): New targets.
  11795. (split_x86_64_[1234r].stdout): New targets.
  11796. (MOSTLYCLEANFILES): Add new executables.
  11797. * testsuite/split_i386.sh: New file.
  11798. * testsuite/split_x86_64.sh: New file.
  11799. * testsuite/split_i386_1.s: New file.
  11800. * testsuite/split_i386_2.s: New file.
  11801. * testsuite/split_i386_3.s: New file.
  11802. * testsuite/split_i386_4.s: New file.
  11803. * testsuite/split_i386_n.s: New file.
  11804. * testsuite/split_x86_64_1.s: New file.
  11805. * testsuite/split_x86_64_2.s: New file.
  11806. * testsuite/split_x86_64_3.s: New file.
  11807. * testsuite/split_x86_64_4.s: New file.
  11808. * testsuite/split_x86_64_n.s: New file.
  11809. * testsuite/testfile.cc (Target_test): Update relocation_section
  11810. function.
  11811. * testsuite/Makefile.in: Rebuild.
  11812. 2009-10-06 Ian Lance Taylor <iant@google.com>
  11813. * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
  11814. (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
  11815. changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
  11816. handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
  11817. the address on ldo_addrs_.
  11818. (Target_i386::Relocate::fix_up_ldo): New function.
  11819. 2009-10-06 Rafael Espindola <espindola@google.com>
  11820. * plugin.cc (add_input_library): New.
  11821. (Plugin::load): Add add_input_library to tv.
  11822. (Plugin_manager::add_input_file): Add the is_lib argument.
  11823. (add_input_file): Update call to Plugin_manager::add_input_file.
  11824. (add_input_library): New.
  11825. * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
  11826. 2009-09-30 Doug Kwan <dougkwan@google.com>
  11827. * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
  11828. symbol and call Symbol::may_need_copy_reloc to determine if
  11829. a copy reloc is needed.
  11830. * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
  11831. nocopyreloc is given in command line.
  11832. (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
  11833. given in command line.
  11834. * i386.cc (Target_i386::may_need_copy_reloc): Remove.
  11835. (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
  11836. of the removed Target_i386::may_need_copy_reloc.
  11837. * options.h (copyreloc): New option with default value false.
  11838. * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
  11839. (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
  11840. instead of the removed Target_powerpc::may_need_copy_reloc.
  11841. * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
  11842. (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
  11843. instead of the removed Target_sparc::may_need_copy_reloc.
  11844. * symtab.h (Symbol::may_need_copy_reloc): New method definition.
  11845. * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
  11846. (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
  11847. instead of the removed Target_x86_64::may_need_copy_reloc.
  11848. 2009-09-30 Ian Lance Taylor <iant@google.com>
  11849. * object.h (class Object): Remove target_ field, and target,
  11850. sized_target, and set_target methods.
  11851. (Object::sized_target): Remove.
  11852. (class Sized_relobj): Update declarations. Remove sized_target.
  11853. * object.cc (Sized_relobj::setup): Remove target parameter.
  11854. Change all callers.
  11855. (Input_objects::add_object): Don't do anything with the target.
  11856. (make_elf_sized_object): Add punconfigured parameter. Change all
  11857. callers. Set or test parameter target.
  11858. * dynobj.cc (Sized_dynobj::target): Remove target parameter.
  11859. Change all callers.
  11860. * parameters.cc (Parameters::set_target): Change parameter type to
  11861. be non-const.
  11862. (Parameters::default_target): Remove.
  11863. (set_parameters_target): Change parameter type to be non-const.
  11864. (parameters_force_valid_target): New function.
  11865. (parameters_clear_target): New function.
  11866. * parameters.h (class Parameters): Update declarations. Remove
  11867. default_target method. Add sized_target and clear_target
  11868. methods. Change target_ to be non-const.
  11869. (set_parameters_target): Update declaration.
  11870. (parameters_force_valid_target): Declare.
  11871. (parameters_clear_target): Declare.
  11872. * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
  11873. as NULL if we aren't searching.
  11874. (Add_symbols::run): Don't check for compatible target.
  11875. * fileread.cc (Input_file::open_binary): Call
  11876. parameters_force_valid_target.
  11877. * gold.cc (queue_middle_tasks): Likewise.
  11878. * plugin.cc (make_sized_plugin_object): Likewise. Don't call
  11879. set_target on object.
  11880. * dynobj.h (class Sized_dynobj): Update declarations.
  11881. * archive.cc (Archive::get_elf_object_for_member): Return NULL if
  11882. make_elf_object returns NULL.
  11883. (Archive::include_member): Don't check whether object target is
  11884. compatible.
  11885. * output.cc (Output_section::add_input_section): Get target from
  11886. parameters.
  11887. (Output_section::relax_input_section): Likewise.
  11888. * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
  11889. parameters.
  11890. (Sized_relobj::do_scan_relocs): Likewise.
  11891. (Sized_relobj::relocate_sections): Likewise.
  11892. * resolve.cc (Symbol_table::resolve): Likewise.
  11893. * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
  11894. parameter. Change all callers.
  11895. (Symbol_table::add_from_object): Get target from parameters.
  11896. (Symbol_table::add_from_relobj): Don't check object target.
  11897. (Symbol_table::add_from_dynobj): Likewise.
  11898. (Symbol_table::define_special_symbol): Get target from
  11899. parameters.
  11900. * symtab.h (class Symbol_table): Update declaration.
  11901. * testsuite/binary_unittest.cc (gold_testsuite): Remove target
  11902. parameter. Change all callers. Clear parameter target.
  11903. (Binary_test): Test target here.
  11904. * testsuite/object_unittest.cc (gold_testsuite): Remove
  11905. target_test_pointer parameter. Change all callers.
  11906. (Object_test): Test target here.
  11907. 2009-09-26 Ian Lance Taylor <iant@google.com>
  11908. * testsuite/initpri1.c: Don't try to use constructor priorities if
  11909. compiling with gcc before 4.3.
  11910. 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
  11911. * testsuite/retain_symbols_file_test.sh (check_present): Change
  11912. output file name to retain_symbols_file_test.stdout.
  11913. (check_absent): Likewise.
  11914. 2009-09-18 Craig Silverstein <csilvers@google.com>
  11915. * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
  11916. * options.cc: Include <cerrno> and <fstream>.
  11917. (General_options::finalize): Parse -retain-symbols-file tag.
  11918. * options.h: New flag.
  11919. (General_options): New method should_retain_symbol, new
  11920. variable symbols_to_retain.
  11921. * symtab.cc (Symbol_table::sized_finalize_symbol): Test
  11922. should_retain_symbol map.
  11923. * testsuite/Makefile.am (retain_symbols_file_test): New test.
  11924. * testsuite/Makefile.in: Regenerate.
  11925. * testsuite/retain_symbols_file_test.sh: New file.
  11926. 2009-09-18 Nick Clifton <nickc@redhat.com>
  11927. * po/es.po: Updated Spanish translation.
  11928. 2009-09-17 Doug Kwan <dougkwan@google.com>
  11929. * debug.h (DEBUG_RELAXATION): New constant.
  11930. (DEBUG_ALL): Add DEBUG_RELAXATION.
  11931. (debug_string_to_enum): Add relaxation debug option.
  11932. * layout.cc
  11933. (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
  11934. Layout::Relaxation_debug_check::read_sections,
  11935. Layout::Relaxation_debug_check::read_sections): New method definitions.
  11936. (Layout::Layout): Initialize data members
  11937. record_output_section_data_from_scrips_,
  11938. script_output_section_data_list_ and relaxation_debug_check_.
  11939. (Layout::save_segments, Layout::restore_segments,
  11940. Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
  11941. Layout::relaxation_loop_body): New method definitions.
  11942. (Layout::finalize): Support relaxation. Move section layout code to
  11943. Layout::relaxation_loop_body.
  11944. (Layout::set_asection_address_from_script): Move code for orphan
  11945. section placement out.
  11946. (Layout::place_orphan_sections_in_script): New method definition.
  11947. * layout.h (Output_segment_headers, Output_file_header):
  11948. New forward class declarations.
  11949. (Layout::~Layout): Define.
  11950. (Layout::new_output_section_data_from_script): New method definition.
  11951. (Layout::place_orphan_sections_in_script): New method declaration.
  11952. (Layout::Segment_states): New type declaration.
  11953. (Layout::save_segments, Layout::restore_segments,
  11954. Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
  11955. Layout::relaxation_loop_body): New method declarations.
  11956. (Layout::Output_section_data_list): New type declaration.
  11957. (Layout::Relaxation_debug_check): New class definition.
  11958. (Layout::record_output_section_data_from_script_,
  11959. Layout::script_output_section_data_list_, Layout::segment_states_,
  11960. Layout::relaxation_debug_check_): New data members.
  11961. * output.cc: (Output_section_headers::do_size): New method definition.
  11962. (Output_section_headers::Output_section_headers): Move size
  11963. computation to Output_section_headers::do_size.
  11964. (Output_segment_headers::do_size): New method definition.
  11965. (Output_file_header::Output_file_header): Move size computation to
  11966. Output_file_header::do_size and call it.
  11967. (Output_file_header::do_size): New method definition.
  11968. (Output_data_group::Output_data_group): Adjust call to
  11969. Output_section_data.
  11970. (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
  11971. (Output_symtab_xindex::do_write): Add array bound check.
  11972. (Output_section::Input_section::print_to_mapfile): Handle
  11973. RELAXED_INPUT_SECTION_CODE.
  11974. (Output_section::Output_section): Initialize data member checkpoint_.
  11975. (Output_section::~Output_section): Delete checkpoint object pointed
  11976. by checkpoint_.
  11977. (Output_section::add_input_section): Always add an Input_section if
  11978. relaxing.
  11979. (Output_section::add_merge_input_section): Add assert.
  11980. (Output_section::relax_input_section): New method definition.
  11981. (Output_section::set_final_data_size): Set load address to zero for
  11982. an unallocated section.
  11983. (Output_section::do_address_and_file_offset_have_reset_values):
  11984. New method definition.
  11985. (Output_section::Input_section_sort_enty::Input_section_sort_enty):
  11986. Handle relaxed input section.
  11987. (Output_section::sort_attached_input_sections): Checkpoint input
  11988. section list lazily.
  11989. (Output_section::get_input_sections): Change type of input_sections to
  11990. list of Simple_input_section pointers. Checkpoint input section list
  11991. lazily. Also handle relaxed input sections.
  11992. (Output_section::add_input_section_for_script): Take a reference to
  11993. a Simple_input_section object instead of Relobj pointer and section
  11994. index as parameter. Handle relaxed input sections.
  11995. (Output_section::save_states, Output_section::restore_states): New
  11996. method definitions.
  11997. * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
  11998. (Output_data::is_data_size_fixed): New method definition.
  11999. (Output_data::reset_addresss_and_file_offset): Do not reset data size
  12000. if it is fixed.
  12001. (Output_data::address_and_file_offset_have_reset_values): New method
  12002. definition.
  12003. (Output_data::do_address_and_file_offset_have_reset_values): New method
  12004. definition.
  12005. (Output_data::set_data_size): Check that data size is not fixed.
  12006. (Output_data::fix_data_size): New method definition.
  12007. (Output_data::is_data_size_fixed_): New data member.
  12008. (Output_section_headers::set_final_data_size): New method definition.
  12009. (Output_section_headers::do_size): New method declaration.
  12010. (Output_segment_headers::set_final_data_size): New method definition.
  12011. (Output_segment_headers::do_size): New method declaration.
  12012. (Output_file_header::set_final_data_size)::New method definition.
  12013. (Output_file_header::do_size)::New method declaration.
  12014. (Output_section_data::Output_section_data): Add new parameter
  12015. is_data_size_fixed and use it to fix data size.
  12016. (Output_data_const::Output_data_const): Adjust call to base class
  12017. constructor and fix data size.
  12018. (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
  12019. base class constructor and fix data size.
  12020. (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
  12021. base class constructor and fix data size.
  12022. (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
  12023. class constructor and fix data size.
  12024. (Output_data_group::set_final_data_size): New method definition.
  12025. (Output_data_dynamic::Dynamic_entry::tag): New method definition.
  12026. (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
  12027. class constructor and fix data size.
  12028. (Output_relaxed_input_section): New class definition.
  12029. (Output_section::Simple_input_section): New class definition.
  12030. (Output_section::get_input_sections): Adjust parameter list.
  12031. (Output_section::add_input_section_for_script): Same.
  12032. (Output_section::save_states, Output_section::restore_states,
  12033. Output_section::do_address_and_file_offset_have_reset_values,
  12034. (Output_section::Input_section::Input_section): Handle
  12035. RELAXED_INPUT_SECTION_CODE. Add new overload for
  12036. Output_relaxed_input_section.
  12037. (Output_section::Input_section::is_input_section,
  12038. Output_section::Input_section::set_output_section): Handle relaxed
  12039. input section.
  12040. (Output_section::Input_section::is_relaxed_input_section,
  12041. Output_section::Input_section::output_section_data,
  12042. Output_section::Input_section::relaxed_input_section): New method
  12043. definitions.
  12044. (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
  12045. value.
  12046. (Output_section::Input_section::u1_): Update comments.
  12047. (Output_section::Input_section::u2_): Add new union member poris.
  12048. (Output_section::Checkpoint_output_section): New classs definition.
  12049. (Output_section::relax_input_section): New method declaration.
  12050. (Output_section::checkpoint_): New data member.
  12051. (Output_segment): Update comments.
  12052. (Output_segment::Output_segment): Un-privatize copy constructor.
  12053. (Output_segment::operator=): Un-privatize.
  12054. * script-sections.cc (Output_section_element::Input_section_list):
  12055. Change element type to Output_section::Simple_input_section.
  12056. (Output_section_element_dot_assignment::set_section_addresses):
  12057. Register output section data for relaxation clean up.
  12058. (Output_data_exression::Output_data_expression): Adjust call to base
  12059. constructor to fix data size.
  12060. (Output_section_element_data::set_section_addresses): Register
  12061. Output_data_expression object for relaxation clean up.
  12062. (struct Input_section_info): Replace Relobj pointer and section index
  12063. pair with Output_section::Simple_input_section and Convert struct to a
  12064. class.
  12065. (Input_section_sorter::operator()): Adjust access to
  12066. Input_section_info data member to use accessors.
  12067. (Output_section_element_input::set_section_addresses): Use layout
  12068. parameter. Adjust code to use Output_section::Simple_input_section
  12069. and Input_secction_info classes. Register filler for relaxation
  12070. clean up.
  12071. (Orphan_output_section::set_section_addresses): Replace Relobj pointer
  12072. and section index pair with Output_section::Simple_input_section
  12073. class. Adjust code accordingly.
  12074. (Phdrs_element::release_segment): New method definition.
  12075. (Script_sections::attach_sections_using_phdrs_clause): Do not modify
  12076. segment list.
  12077. (Script_sections::release_segments): New method definition.
  12078. * script-sections.h (Script_sections::release_segments): New
  12079. method declaration.
  12080. * target.h (Target::may_relax, Target::relax,
  12081. Target::do_may_relax, Target::do_relax): New method definitions.
  12082. 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  12083. * arm.cc (has_signed_unsigned_overflow): New function.
  12084. (Arm_relocate_functions::abs8): New function.
  12085. (Target_arm::Scan::local): Handle R_ARM_ABS8.
  12086. (Target_arm::Scan::global): Likewise.
  12087. (Target_arm::relocate::relocate): Likewise.
  12088. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
  12089. Likewise.
  12090. 2009-09-16 Cary Coutant <ccoutant@google.com>
  12091. * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
  12092. * testsuite/Makefile.in: Regenerate.
  12093. 2009-09-11 Nick Clifton <nickc@redhat.com>
  12094. * po/gold.pot: Updated by the Translation project.
  12095. 2009-09-08 Cary Coutant <ccoutant@google.com>
  12096. * output.cc (Output_file::open): Add execute permission to empty file.
  12097. * testsuite/Makefile.am (permission_test): New test.
  12098. * testsuite/Makefile.in: Regenerate.
  12099. 2009-09-02 Ian Lance Taylor <iant@google.com>
  12100. * output.cc (Output_file::resize): Call map_no_anonymous rather
  12101. than map.
  12102. 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
  12103. * gold.cc: Include "incremental.h".
  12104. (queue_initial_tasks): Call Incremental_checker methods.
  12105. * incremental.cc: Include "output.h".
  12106. (Incremental_checker::can_incrementally_link_output_file): New
  12107. method.
  12108. * incremental.h (Incremental_checker): New class.
  12109. * output.cc (Output_file::open_for_modification): New method.
  12110. (Output_file::map_anonymous): Changed return type to bool. Record
  12111. map in base_ field.
  12112. (Output_file::map_no_anonymous): New method, broken out of map.
  12113. (Output_file::map): Use map_no_anonymous and map_anonymous.
  12114. * output.h (class Output_file): Update declarations.
  12115. 2009-08-24 Cary Coutant <ccoutant@google.com>
  12116. * options.h (Command_line::Pre_options): New class.
  12117. (Command_line::pre_options): New member.
  12118. * options.cc (gold::options::ready_to_register): New variable.
  12119. (One_option::register_option): Do nothing if not registering options.
  12120. Assert if same short option registered twice.
  12121. (General_options::General_options): Turn off option registration when
  12122. done constructing.
  12123. (Command_line::Pre_options::Pre_options): New constructor.
  12124. 2009-08-24 Cary Coutant <ccoutant@google.com>
  12125. * options.h (General_options::no_keep_memory): Remove incorrect
  12126. short option.
  12127. 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  12128. * Makefile.am (am__skiplex, am__skipyacc): New.
  12129. * Makefile.in: Regenerate.
  12130. 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  12131. * Makefile.am (AM_CPPFLAGS): Renamed from ...
  12132. (INCLUDES): ... this.
  12133. * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
  12134. (AM_CPPFLAGS): Renamed from ...
  12135. (INCLUDE): ... this.
  12136. * Makefile.in, testsuite/Makefile.in: Regenerate.
  12137. * Makefile.in: Regenerate.
  12138. * aclocal.m4: Likewise.
  12139. * config.in: Likewise.
  12140. * configure: Likewise.
  12141. * testsuite/Makefile.in: Likewise.
  12142. * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
  12143. * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
  12144. * Makefile.in: Regenerate.
  12145. * testsuite/Makefile.in: Regenerate.
  12146. 2009-08-19 Cary Coutant <ccoutant@google.com>
  12147. * resolve.cc (Symbol_table::resolve): Don't complain about defined
  12148. symbols in shared libraries overridden by hidden or internal symbols
  12149. in the main program.
  12150. 2009-08-19 Chris Demetriou <cgd@google.com>
  12151. * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
  12152. checking source file names in error messages.
  12153. 2009-08-18 Doug Kwan <dougkwan@google.com>
  12154. * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
  12155. an elcpp::Ehdr as parameter. Adjust call to set_target.
  12156. * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
  12157. an elfcpp::Ehdr as parameter.
  12158. * object.cc (Object::set_target): Remove the version that looks up
  12159. a target and sets it.
  12160. (Sized_relobj::setup): Take a Target object instead of
  12161. an elfcpp::Ehdr as parameter. Adjust call to set_target.
  12162. (make_elf_sized_object): Find target and ask target to
  12163. make an ELF object.
  12164. * object.h: (Object::set_target): Remove the version that looks up
  12165. a target and sets it.
  12166. (Sized_relobj::setup): Take a Target object instead of
  12167. an elfcpp:Ehdr as parameter.
  12168. * target.cc: Include dynobj.h.
  12169. (Target::do_make_elf_object_implementation): New.
  12170. (Target::do_make_elf_object): New.
  12171. * target.h (Target::make_elf_object): New template declaration.
  12172. (Target::do_make_elf_object): New method declarations.
  12173. (Target::do_make_elf_object_implementation): New template declaration.
  12174. 2009-08-14 Ian Lance Taylor <iant@google.com>
  12175. * gold.h (FUNCTION_NAME): Define.
  12176. (gold_unreachable): Use FUNCTION_NAME.
  12177. 2009-08-12 Sriraman Tallam <tmsriram@google.com>
  12178. * icf.cc (Icf::find_identical_sections): Issue a warning when a
  12179. symbol in the --keep-unique list is not found.
  12180. 2009-08-12 Sriraman Tallam <tmsriram@google.com>
  12181. * icf.cc (Icf::find_identical_sections): Unfold symbols that have
  12182. been maked as --keep-unique.
  12183. (Icf::unfold_section): New function.
  12184. * icf.h (Icf::unfold_section): New function.
  12185. * options.h (General_options::keep_unique): New option.
  12186. * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
  12187. * testsuite/Makefile.in: Regenerate.
  12188. * testsuite/icf_keep_unique_test.sh: New file.
  12189. * testsuite/icf_keep_unique_test.cc: New file.
  12190. 2009-08-12 Cary Coutant <ccoutant@google.com>
  12191. PR 10471
  12192. * resolve.cc (Symbol_table::resolve): Check for references from
  12193. dynamic objects to hidden and internal symbols.
  12194. * testsuite/Makefile.am (hidden_test.sh): New test.
  12195. * testsuite/Makefile.in: Regenerate.
  12196. * testsuite/hidden_test.sh: New script.
  12197. * testsuite/hidden_test_1.c: New test source.
  12198. * testsuite/hidden_test_main.c: New test source.
  12199. 2009-08-11 Doug Kwan <dougkwan@google.com>
  12200. * arm.cc: Update comments.
  12201. (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
  12202. segment to locate the .ARM.exidx section if present.
  12203. 2009-08-09 Doug Kwan <dougkwan@google.com>
  12204. * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
  12205. patch.
  12206. 2009-08-07 Sriraman Tallam <tmsriram@google.com>
  12207. * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
  12208. compiler warnings.
  12209. 2009-08-06 Sriraman Tallam <tmsriram@google.com>
  12210. * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
  12211. valid tls_segment only for non-debug-section relocations.
  12212. * testsuite/Makefile.am: Add gc_tls_test.
  12213. * testsuite/Makefile.in: Regenerate.
  12214. * testsuite/gc_tls_test.cc: New file.
  12215. * testsuite/gc_tls_test.sh: New file.
  12216. 2009-08-05 Sriraman Tallam <tmsriram@google.com>
  12217. * icf.cc: New file.
  12218. * icf.h: New file.
  12219. * Makefile.am (CCFILES): Add icf.cc.
  12220. (HFILES): Add icf.h
  12221. * Makefile.in: Regenerate.
  12222. * dynobj.h (Sized_dynobj::do_section_entsize): New function.
  12223. * gc.h (gc_process_relocs): Populate lists used by icf to contain
  12224. section, symbol and addend information for the relocs.
  12225. * gold.cc (queue_middle_tasks): Call identical code folding.
  12226. * gold.h: Add defines for multimap.
  12227. * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
  12228. to the call of finalize_local_symbols.
  12229. * main.cc (main): Create object of class Icf.
  12230. * object.cc (Sized_relobj::do_layout): Allow this function to be
  12231. called twice during icf.
  12232. (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
  12233. to sections marked as identical by icf.
  12234. (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
  12235. when available.
  12236. (Sized_relobj::do_section_entsize): New function.
  12237. * object.h (Object::section_entsize): New function.
  12238. (Object::do_section_entsize): New pure virtual function.
  12239. (Relobj::finalize_local_symbols): Add new parameter.
  12240. (Relobj::do_section_entsize): New function.
  12241. * options.h (General_options::icf): New option.
  12242. (General_options::icf_iterations): New option.
  12243. (General_options::print_icf_sections): New option.
  12244. * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
  12245. * plugin.h (Sized_pluginobj::do_section_entsize): New function.
  12246. * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
  12247. icf.
  12248. * symtab.cc (Symbol_table::is_section_folded): New function.
  12249. (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
  12250. to sections marked as identical by icf.
  12251. * symtab.h (Symbol_table::set_icf): New function.
  12252. (Symbol_table::icf): New function.
  12253. (Symbol_table::is_section_folded): New function.
  12254. (Symbol_table::icf_): New data member.
  12255. * target-reloc.h (relocate_section): Ignore sections folded by icf.
  12256. * testsuite/Makefile.am: Add commands to build icf_test.
  12257. * testsuite/Makefile.in: Regenerate.
  12258. * testsuite/icf_test.sh: New file.
  12259. * testsuite/icf_test.cc: New file.
  12260. 2009-07-24 Chris Demetriou <cgd@google.com>
  12261. * layout.cc (is_compressible_debug_section): Fix incorrect
  12262. comment about compressed section names.
  12263. 2009-07-20 Ian Lance Taylor <ian@airs.com>
  12264. PR 10419
  12265. * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
  12266. 2009-07-16 Ian Lance Taylor <iant@google.com>
  12267. PR 10400
  12268. * layout.h: #include <map>.
  12269. (class Kept_section): Change from struct to class. Add accessors
  12270. and setters. Add section size to Comdat_group mapping. Change
  12271. Comdat_group to std::map. Add is_comdat_ field. Add
  12272. linkonce_size field in union.
  12273. (class Layout): Update declaration of find_or_add_kept_section.
  12274. Don't declare find_kept_object.
  12275. * layout.cc (Layout::find_or_add_kept_section): Remove candidate
  12276. parameter. Add object, shndx, is_comdat, and is_group_name
  12277. parameters. Change all callers. Adjust for new Kept_section.
  12278. (Layout::find_kept_object): Remove.
  12279. * object.cc (Sized_relobj::include_section_group): Update use of
  12280. Kept_section. Rename secnum to shndx. Only record
  12281. Kept_comdat_section if sections are the same size.
  12282. (Sized_relobj::include_linkonce_section): Update use of
  12283. Kept_section. Only record Kept_comdat_section if sections are the
  12284. same size. Set size of linkonce section.
  12285. (Sized_relobj::map_to_kept_section): Update call to
  12286. get_kept_comdat_section.
  12287. * object.h (class Sized_relobj): Rename fields in
  12288. Kept_comdat_section to drop trailing underscores; change object
  12289. field to Relobj*. Change Kept_comdat_section_table to store
  12290. struct rather than pointer.
  12291. (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
  12292. Add kept_object and kept_shndx parameters. Change all callers.
  12293. (Sized_relobj::get_kept_comdat_section): Change return type to
  12294. bool. Add kept_object and kept_shndx parameters. Change all
  12295. callers.
  12296. * plugin.cc (Pluginobj::include_comdat_group): Update call to
  12297. Layout::find_or_add_kept_section.
  12298. 2009-07-09 Ian Lance Taylor <iant@google.com>
  12299. * merge.cc (Object_merge_map::initialize_input_to_output_map):
  12300. Reserve space in the hash table.
  12301. 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
  12302. * fileread.cc (File_read::get_mtime): New method.
  12303. * fileread.h (Timespec): New structure.
  12304. (File_read::get_mtime): New method.
  12305. * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
  12306. Renamed from timestamp_nsec.
  12307. (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
  12308. Elf_Xword.
  12309. (Incremental_inputs_entry_write::timestamp_usec): Renamed from
  12310. timestamp_nsec.
  12311. (Incremental_inputs::report_archive): Save mtime; style fix.
  12312. (Incremental_inputs::report_obejct): Save mtime; style fix.
  12313. (Incremental_inputs::report_script): Save mtime; style fix.
  12314. (Incremental_inputs::finalize_inputs): Style fix.
  12315. (Incremental_inputs::finalize): Style fix.
  12316. (Incremental_inputs::create_input_section_data): Store inputs
  12317. mtime.
  12318. * incremental.h (Incremental_inputs::report_script): Add mtime
  12319. argument.
  12320. (Incremental_inputs::Input_info::Input_info): Intialize only one
  12321. union member.
  12322. (Incremental_inputs::Input_info::archive): Move to nameless
  12323. union.
  12324. (Incremental_inputs::Input_info::obejct): Move to nameless union.
  12325. (Incremental_inputs::Input_info::script): Move to nameless union.
  12326. (Incremental_inputs::mtime): New field.
  12327. * script.cc (read_input_script): Pass file mtime to
  12328. Incremental_input.
  12329. * script.h (Script_info::inputs): Style fix.
  12330. 2009-07-01 Ian Lance Taylor <ian@airs.com>
  12331. * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
  12332. instead of 32.
  12333. 2009-06-24 Ian Lance Taylor <iant@google.com>
  12334. PR 10156
  12335. * layout.cc (Layout::choose_output_section): If we find an
  12336. existing section, update the flags.
  12337. (Layout::create_notes): New function, broken out of
  12338. Layout::finalize.
  12339. (Layout::finalize): Don't create note sections.
  12340. (Layout::create_note): Don't crash if linker script discards
  12341. section.
  12342. (Layout::create_gold_note): Likewise.
  12343. (Layout::create_build_id): Likewise. Don't set
  12344. after_input_sections on the section.
  12345. (Layout::create_executable_stack_info): Remove target parameter.
  12346. Change caller.
  12347. * layout.h (class Layout): Declare create_notes. Update
  12348. declaration of create_executable_stack_info.
  12349. * gold.cc (queue_middle_tasks): Call create_notes.
  12350. * output.cc (Output_section::update_flags_for_input_section): Move
  12351. here from output.h. If SHF_ALLOC flag is newly set, mark address
  12352. invalid.
  12353. * output.h (Output_data::mark_address_invalid): New function.
  12354. (class Output_section): Only declare, not define,
  12355. update_flags_for_input_section. Remove set_flags.
  12356. 2009-06-24 Ian Lance Taylor <iant@google.com>
  12357. * script-sections.cc (Output_section_definition::
  12358. set_section_addresses): Rename shadowing local load_address to
  12359. laddr.
  12360. 2009-06-24 Ian Lance Taylor <iant@google.com>
  12361. PR 10244
  12362. * reloc.cc (relocate_sections): Skip empty relocation sections.
  12363. 2009-06-23 Ian Lance Taylor <iant@google.com>
  12364. PR 10156
  12365. * layout.cc (Layout::create_note): Use choose_output_section
  12366. rather than make_output_section.
  12367. 2009-06-23 Ian Lance Taylor <iant@google.com>
  12368. PR 10237
  12369. * options.cc (General_options::parse_V): Set printed_version_.
  12370. (General_options::General_options): Initialize printed_version_.
  12371. * options.h (class General_options): Add printed_version_ field.
  12372. * gold.cc (queue_initial_tasks): If there are no input files,
  12373. don't give a fatal error if we printed the version information.
  12374. (queue_middle_tasks): If using -r with a shared object, give a
  12375. fatal error rather than an ordinary error.
  12376. 2009-06-23 Ian Lance Taylor <iant@google.com>
  12377. PR 10219
  12378. * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
  12379. (Layout::make_output_section): Set have_stabstr_section_ if we see
  12380. a .stab*str section.
  12381. (Layout::finalize): Call link_stabs_sections.
  12382. (Layout::link_stabs_sections): New file.
  12383. * layout.h (class Layout): Add have_stabstr_section_ field.
  12384. Declare link_stabs_sections.
  12385. 2009-06-23 Doug Kwan <dougkwan@google.com>
  12386. * Makefile.am (libgold_a_LIBADD): New.
  12387. (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
  12388. * Makefile.in: Regenerate.
  12389. * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
  12390. * configure: Regenerate.
  12391. * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
  12392. * fileread.cc: Include sys/state.h
  12393. * gold.h: Declare memmem and strndup if found missing.
  12394. * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
  12395. 2009-06-23 Ian Lance Taylor <iant@google.com>
  12396. * configure.ac: Call AC_CHECK_DECLS using C, not C++.
  12397. * configure: Rebuild.
  12398. 2009-06-23 Ian Lance Taylor <iant@google.com>
  12399. PR 10147
  12400. * object.cc (Object::section_contents): Don't try to get a view if
  12401. the section has length zero.
  12402. (Object::handle_gnu_warning_section): If the section is empty, use
  12403. the name of the section as the warning.
  12404. 2009-06-23 Ian Lance Taylor <iant@google.com>
  12405. PR 10133
  12406. * stringpool.h (class Stringpool_template): Add optimize_ field.
  12407. (Stringpool_template::set_optimize): New function.
  12408. * stringpool.cc (Stringpool_template::Stringpool_template):
  12409. Initialize optimize_ field.
  12410. (Stringpool_template::set_string_offsets): Test local optimize
  12411. fild rather than parameter.
  12412. * layout.cc (Layout::Layout): Call set_optimize on the section
  12413. name stringpool.
  12414. 2009-06-22 Ian Lance Taylor <iant@google.com>
  12415. PR 10030
  12416. * yyscript.y: Parse TARGET.
  12417. * script.cc (script_set_target): New function.
  12418. * script-c.h (script_set_target): Declare.
  12419. * options.cc (General_options::string_to_object_format): Rename
  12420. from string_to_object_format in anonymous namespace. Change
  12421. callers.
  12422. * options.h (class General_options): Declare
  12423. string_to_object_format.
  12424. 2009-06-22 Ian Lance Taylor <iant@google.com>
  12425. * script-sections.cc (Script_sections::create_segments): Don't put
  12426. program headers in a PT_LOAD segment if -n or -N.
  12427. 2009-06-22 Ian Lance Taylor <iant@google.com>
  12428. PR 10141
  12429. * options.h (class General_options): Add -z lazy and -z now. Sort
  12430. -z options into alphabetical order.
  12431. * layout.cc (Layout::finish_dynamic_section): Handle -z now.
  12432. 2009-06-21 Ian Lance Taylor <iant@google.com>
  12433. * layout.cc (Layout::make_output_section): Call
  12434. Target::new_output_section.
  12435. (Layout::attach_allocated_section_to_segment): Put large section
  12436. sections in a separate load segment with the large segment flag
  12437. set.
  12438. (Layout::segment_precedes): Sort large data segments after other
  12439. load segments.
  12440. (align_file_offset): New static function.
  12441. (Layout::set_segment_offsets): Use align_file_offset.
  12442. * output.h (class Output_section): Add is_small_section_ and
  12443. is_large_section_ fields.
  12444. (Output_section::is_small_section): New function.
  12445. (Output_section::set_is_small_section): New function.
  12446. (Output_section::is_large_section): New function.
  12447. (Output_section::set_is_large_section): New function.
  12448. (Output_section::is_large_data_section): New function.
  12449. (class Output_segment): Add is_large_data_segment_ field.
  12450. (Output_segment::is_large_data_segment): New function.
  12451. (Output_segment::set_is_large_data_segment): New function.
  12452. * output.cc (Output_section::Output_section): Initialize new
  12453. fields.
  12454. (Output_segment::Output_segment): Likewise.
  12455. (Output_segment::add_output_section): Add assertion that large
  12456. data sections always go in large data segments. Force small data
  12457. sections to the end of the list of data sections. Force small BSS
  12458. sections to the start of the list of BSS sections. For large BSS
  12459. sections to the end of the list of BSS sections.
  12460. * symtab.h (class Symbol): Declare is_common_shndx.
  12461. (Symbol::is_defined): Check Symbol::is_common_shndx.
  12462. (Symbol::is_common): Likewise.
  12463. (class Symbol_table): Define enum Commons_section_type. Update
  12464. declarations. Add small_commons_ and large_commons_ fields.
  12465. * symtab.cc (Symbol::is_common_shndx): New function.
  12466. (Symbol_table::Symbol_table): Initialize new fields.
  12467. (Symbol_table::add_from_object): Put small and large common
  12468. symbols in the right list.
  12469. (Symbol_table::sized_finalized_symbol): Check
  12470. Symbol::is_common_shndx.
  12471. (Symbol_table::sized_write_globals): Likewise.
  12472. * common.cc (Symbol_table::do_allocate_commons): Allocate new
  12473. common symbol lists. Don't call do_allocate_commons_list if the
  12474. list is empty.
  12475. (Symbol_table::do_allocate_commons_list): Remove is_tls
  12476. parameter. Add comons_section_type parameter. Change all
  12477. callers. Handle small and large common symbols.
  12478. * object.cc (Sized_relobj::do_finalize_local_symbols): Check
  12479. Symbol::is_common_shndx.
  12480. * resolve.cc (symbol_to_bits): Likewise.
  12481. * target.h (Target::small_common_shndx): New function.
  12482. (Target::small_common_section_flags): New function.
  12483. (Target::large_common_shndx): New function.
  12484. (Target::large_common_section_flags): New function.
  12485. (Target::new_output_section): New function.
  12486. (Target::Target_info): Add small_common_shndx, large_common_shndx,
  12487. small_common_section_flags, and large_common_section_flags
  12488. fields.
  12489. (Target::do_new_output_section): New virtual function.
  12490. * arm.cc (Target_arm::arm_info): Initialize new fields.
  12491. * i386.cc (Target_i386::i386_info): Likewise.
  12492. * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
  12493. Likewise.
  12494. * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
  12495. * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
  12496. (Target_x86_64::do_new_output_section): New function.
  12497. * configure.ac: Define conditional MCMODEL_MEDIUM.
  12498. * testsuite/Makefile.am (check_PROGRAMS): Add large.
  12499. (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
  12500. (large_LDFLAGS): Define.
  12501. * testsuite/large.c: New file.
  12502. * testsuite/testfile.cc (Target_test::test_target_info):
  12503. Initialize new fields.
  12504. * configure, testsuite/Makefile.in: Rebuild.
  12505. 2009-06-05 Doug Kwan <dougkwan@google.com>
  12506. * Makefile.am (CCFILES): Add target.cc.
  12507. * Makefile.in: Regenerate.
  12508. * i386.cc (class Target_i386): Define new virtual method to
  12509. override do_is_local_label_name in parent.
  12510. * object.cc (Sized_relobj::do_count_local_symbols): Discard
  12511. local symbols if --discard-locals or -X is given.
  12512. * options.h (class General_options): Declare new options
  12513. '--discard-locals' and '-X' for discarding locals.
  12514. * target.h (class Target): Define new methods is_local_label_name.
  12515. Declare new virtual method do_is_local_label_name.
  12516. * target.cc: New file.
  12517. * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
  12518. (check_SCRIPTS): Add discard_locals_test.sh.
  12519. (check_DATA): Add discard_local_tests.syms.
  12520. (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
  12521. (discard_local_tests.syms, discard_locals_test.o): New make rules.
  12522. * testsuite/Makefile.in: Regenerate.
  12523. * testsuite/discard_locals_test.c: New file.
  12524. * testsuite/discard_locals_test.sh: Same.
  12525. 2009-06-05 Doug Kwan <dougkwan@google.com>
  12526. * object.cc (Sized_relobj::Sized_relobj): Initialize
  12527. discarded_eh_frame_shndx_ to -1U.
  12528. (Sized_relobj::do_layout): Record index of a discard .eh_frame
  12529. section.
  12530. (Sized_relobj::do_count_local_symbols): Skip local symbols in
  12531. a discarded .eh_frame section.
  12532. (Sized_relobj::do_finalize_local_symbols): Ditto.
  12533. * object.h (class Sized_relobj): Declare new member
  12534. discarded_eh_frame_shndx_.
  12535. * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
  12536. (local_labels_test.o, local_labels_test): New rules.
  12537. * testsuite/Makefile.in: Regenerate.
  12538. 2009-06-04 Doug Kwan <dougkwan@google.com>
  12539. * layout.cc (Layout::section_name_mapping): Add mapping for
  12540. special ARM sections.
  12541. 2009-06-03 Doug Kwan <dougkwan@google.com>
  12542. * arm.cc (utils::sign_extend): Reverse test in gold_assert.
  12543. (utils::has_overflow): Same.
  12544. 2009-06-03 Ian Lance Taylor <iant@google.com>
  12545. * layout.cc (Layout::section_name_mapping): New array, replacing
  12546. Layout::linkonce_mapping.
  12547. (Layout::section_name_mapping_count): New variable, replacing
  12548. Layout::linkonce_mapping_count.
  12549. (Layout::linkonce_output_name): Remove.
  12550. (Layout::output_section_name): Rewrite.
  12551. * layout.h (class Layout): Rename Linkonce_mapping to
  12552. Section_name_mapping, linkonce_mapping to section_name_mapping,
  12553. linkonce_mapping_count to section_name_mapping_count. Don't
  12554. declare linkonce_output_name.
  12555. 2009-06-03 Doug Kwan <dougkwan@google.com>
  12556. * arm.cc (namespace utils): New.
  12557. (Target_arm::reloc_is_non_pic): Define new method.
  12558. (class Arm_relocate_functions): New.
  12559. (Target_arm::Relocate::relocate): Handle relocation types used by
  12560. Android.
  12561. 2009-06-03 Ian Lance Taylor <iant@google.com>
  12562. * arm.cc (Target_arm::scan::global): Use || instead of |.
  12563. 2009-06-02 Doug Kwan <dougkwan@google.com>
  12564. * arm.cc (Target_arm::Scan::Scan): Initialize
  12565. issued_non_pic_error_.
  12566. (class Target_arm::Scan): Declare new method check_non_pic.
  12567. Define new method symbol_needs_plt_entry.
  12568. Declare new data member issued_non_pic_error_.
  12569. (class Target_arm::Relocate): Declare new method
  12570. should_apply_static_reloc.
  12571. (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
  12572. (Target_arm::Scan::check_non_pic): Define new method.
  12573. (Target_arm::Scan::local): Handle a small subset of reloc types used
  12574. by Android.
  12575. (Target_arm::Scan::local): Same.
  12576. (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
  12577. 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
  12578. * incremental.cc (Incremental_inputs::report_command_line): Filter
  12579. out --incremental-* options.
  12580. 2009-05-29 Doug Kwan <dougkwan@google.com>
  12581. * arm.cc (Output_data_plt_arm): Forward declaration for new
  12582. template class.
  12583. (class Target_arm): Update comment.
  12584. (Target_arm::Target_arm): Initialize new data members GOT_,
  12585. PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
  12586. Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
  12587. and Target_arm::rel_dyn_section.
  12588. Declare new_enum Target_arm::Got_type.
  12589. Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
  12590. and DYNBSS_.
  12591. Update commments for member do_dynsym_value.
  12592. (Target_arm::got_size, Target_arm::plt_section,
  12593. Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
  12594. new methods inside class defintion.
  12595. (Target_arm::got_section): Define new method.
  12596. (Target_arm::rel_dyn_section): Same.
  12597. (Output_data_plt_arm): New template class.
  12598. (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
  12599. (Output_data_plt_arm:do_adjust_output_section): Define new method.
  12600. (Output_data_plt_arm::add_entry): Same.
  12601. (Output_data_plt_arm::first_plt_entry): Define new
  12602. static data member for PLT instruction template.
  12603. (Output_data_plt_arm::plt_entry): Same.
  12604. (Output_data_plt_arm::do_write): Define new method.
  12605. (Target_arm::make_plt_entry): Same.
  12606. (Target_arm::do_finalize_sections): Same.
  12607. (Target_arm::do_dynsym_value): Same.
  12608. 2009-05-28 Doug Kwan <dougkwan@google.com>
  12609. * Makefile.am (TARGETSOURCES): Add arm.cc.
  12610. (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
  12611. * Makefile.in: Regenerate.
  12612. * arm.cc: New file.
  12613. * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
  12614. 2009-05-26 Doug Kwan <dougkwan@google.com>
  12615. * options.cc (General_options::parse_exclude_libs). Fix a comment.
  12616. (General_options::check_excluded_libs): Strip off directories in
  12617. archive name before matching like GNU ld does.
  12618. * testsuite/Makefile.am (MOSTLYCLEANFILES,
  12619. exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
  12620. (exclude_libs_test_LDFLAGS): Add linker option
  12621. -Wl,--exclude-libs,libexclude_libs_test_3
  12622. (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
  12623. an explicit archive without using -l.
  12624. (alt/libexclude_libs_test_3.a): New make rule.
  12625. * testsuite/Makefile.in: Regenerate.
  12626. * testsuite/exclude_libs_test.c : Declare lib3_default().
  12627. (main): Call it.
  12628. * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
  12629. * exclude_libs_test_3.c: New file.
  12630. 2009-05-26 Nick Clifton <nickc@redhat.com>
  12631. * po/id.po: New Indonesian translation.
  12632. * po/gold.pot: Updated template file.
  12633. 2009-05-22 Sriraman Tallam <tmsriram@google.com>
  12634. * testsuite/Makefile.am: Add -ffunction-sections to compile
  12635. gc_comdat_test files. Add -Wl,--gc-sections to build
  12636. gc_comdat_test.
  12637. * testsuite/Makefile.in: Regenerate.
  12638. * testsuite/gc_comdat_test.sh: Fix the condition around grep.
  12639. 2009-05-21 Sriraman Tallam <tmsriram@google.com>
  12640. * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
  12641. kept comdat section was garbage collected.
  12642. * testsuite/Makefile.am: Add test gc_comdat_test.sh.
  12643. * testsuite/Makefile.in: Regenerate.
  12644. * testsuite/gc_comdat_test.sh: New file.
  12645. * testsuite/gc_comdat_test_1.cc: New file.
  12646. * testsuite/gc_comdat_test_2.cc: New file.
  12647. 2009-05-19 Doug Kwan <dougkwan@google.com>
  12648. * archive.cc (Archive::Archive): Move constructor from archive.h
  12649. to here. Initialize no_export_.
  12650. (Archive::get_elf_object_for_member): Set no_export flag of object.
  12651. * archive.h (Archive::Archive): Move constructor body to
  12652. archive.cc.
  12653. (Archive::no_export): New method.
  12654. (Archive::no_export_): New field.
  12655. * object.h (Object::Object): Initialize no_export_ to false.
  12656. (Object::no_export, Object::set_no_export): New methods.
  12657. (Object::no_export_): New field.
  12658. * options.cc (General_options::parse_exclude_libs): New method.
  12659. (General_options::check_excluded_libs) Same.
  12660. * options.h (exclude_libs): New option.
  12661. (General_options::check_excluded_libs): New method declaration.
  12662. (General_options::excluded_libs_): New field.
  12663. * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
  12664. default or protected visibility if an object has no-export flag set.
  12665. testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
  12666. (check_SCRIPTS): Add exclude_libs_test.sh.
  12667. (check_DATA): Add exclude_libs_test.syms.
  12668. (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
  12669. libexclude_libs_test_1.a and libexclude_libs_test_2.a.
  12670. (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
  12671. exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
  12672. (exclude_libs_test.syms, libexclude_libs_test_1.a,
  12673. libexclude_libs_test_2.a): New rules.
  12674. * testsuite/Makefile.in: Regenerate.
  12675. * testsuite/exclude_libs_test.c: New file.
  12676. * testsuite/exclude_libs_test.sh: Ditto.
  12677. * testsuite/exclude_libs_test_1.c: Ditto.
  12678. * testsuite/exclude_libs_test_2.c: Ditto.
  12679. 2009-05-15 Ian Lance Taylor <iant@google.com>
  12680. * configure.ac: Check for declarations for cases where libiberty.h
  12681. checks HAVE_DECL_xxx.
  12682. * configure, config.in: Rebuild.
  12683. 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
  12684. * gold.h (Incremental_argument_list): Remove (invalid) forward
  12685. declaration.
  12686. * incremental.cc (Incremental_inputs::report_achive): New method.
  12687. (Incremental_inputs::report_object): New method.
  12688. (Incremental_inputs::report_script): New method.
  12689. (Incremental_inputs::finalize_inputs): New method.
  12690. (Incremental_inputs::finalize): Call finalize_inputs().
  12691. (Incremental_inputs::sized_create_incremental_inputs_section_data):
  12692. Create inputs entries.
  12693. * incremental.h (Incremental_input_type): New enum.
  12694. (Incremental_inputs::Incremental_input): Initialize new fields.
  12695. (Incremental_inputs::report_inputs): New method.
  12696. (Incremental_inputs::report_achive): New method.
  12697. (Incremental_inputs::report_object): New method.
  12698. (Incremental_inputs::report_script): New method.
  12699. (Incremental_inputs::finalize_inputs): New method.
  12700. (Incremental_inputs::Input_info): New struct.
  12701. (Incremental_inputs::Input_info_map): New typedef.
  12702. (Incremental_inputs::lock_): New field.
  12703. (Incremental_inputs::Inputs_): New field.
  12704. (Incremental_inputs::Inputs_map): New field.
  12705. * main.cc (main): Call Incremental_input::report_inputs.
  12706. * options.h (Input_argument_list): Typedef moved from
  12707. Input_arguments.
  12708. (Input_file_group::Files): Remove, use ::Input_argument_list.
  12709. (Input_file_group::Input_argument_list): Remove, use
  12710. ::Input_argument_list.
  12711. * plugin.cc (Plugin_manager::add_input_file): Add error in
  12712. incremental build.
  12713. * read_syms.cc (do_read_syms): Call Incremental_input::report_*
  12714. functions.
  12715. * script.cc (read_input_script): Call
  12716. Incremental_input::report_script.
  12717. * script.h (Script_info): New class.
  12718. 2009-04-27 Ian Lance Taylor <iant@google.com>
  12719. * x86_64.cc (do_adjust_output_section): Set entsize to
  12720. plt_entry_size.
  12721. 2009-04-23 Elliott Hughes <enh@google.com>
  12722. * output.cc (Output_file::close): After short writes, continue
  12723. writing from the correct offset in the buffer being written.
  12724. 2009-04-23 Chris Demetriou <cgd@google.com>
  12725. * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
  12726. * configure: Regenerate.
  12727. * config.in: Regenerate.
  12728. * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
  12729. if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
  12730. 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
  12731. * incremental.cc (Incremental_inputs_header_data): Renamed from
  12732. Incremental_input_header_data.
  12733. (Incremental_inputs_header_data::data_size): New field.
  12734. (Incremental_inputs_header_data::put_input_file_count): Renamed
  12735. from input_file_count.
  12736. (Incremental_inputs_header_data::put_command_line_offset): Renamed
  12737. from command_line_offset.
  12738. (Incremental_inputs_header_data::put_reserved): Renamed from
  12739. put_reserved.
  12740. (Incremental_inputs_entry_data): Renamed from
  12741. Incremental_input_entry_data.
  12742. (Incremental_inputs_entry_data::data_size): New field.
  12743. (Incremental_inputs::report_command_line): New method.
  12744. (Incremental_inputs::finalize): New method.
  12745. (Incremental_inputs::create_incremental_inputs_data): New method.
  12746. (Incremental_inputs::sized_create_incremental_inputs_data): New method.
  12747. * incremental.h: New file.
  12748. * layout.cc (Layout::Layout): Handle new incremental_inputs_.
  12749. (Layout::finalize): Create incremental inputs section in
  12750. incremental builds.
  12751. (Layout::create_incremental_info_sections): New method.
  12752. * layout.h (Layout::incremental_inputs): New method.
  12753. (Layout::create_incremental_info_sections): New method.
  12754. (Layout::incremental_inputs_): New field.
  12755. * main.cc (main): Notify Incremental_input of the command line.
  12756. 2009-04-01 Ian Lance Taylor <iant@google.com>
  12757. Mikolaj Zalewski <mikolajz@google.com>
  12758. * gold.h (reserve_unordered_map): Define, three versions, one for
  12759. each version of Unordered_map.
  12760. * layout.cc (Layout::Layout): Remove options parameter. Add
  12761. number_of_input_files parameter. Don't initialize options_.
  12762. Initialize number_of_input_files_ and resized_signatures_. Move
  12763. sections_are_attached_.
  12764. (Layout::layout_group): Reserve space for group_signatures_.
  12765. (Layout::find_or_add_kept_section): Change name parameter to be a
  12766. reference. Resize signatures_ map when it gets large enough.
  12767. (Layout::layout_eh_frame): Use parameters->options() instead of
  12768. this->options_.
  12769. (Layout::make_output_section): Likewise.
  12770. (Layout::attach_allocated_section_to_segment): Likewise.
  12771. (Layout::finalize, Layout::create_executable_stack): Likewise.
  12772. (Layout::set_segment_offsets, Layout::create_interp): Likewise.
  12773. (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
  12774. * layout.h (class Layout): Update declarations. Remove options_
  12775. field. Add number_of_input_files_ and resized_signatures_
  12776. fields. Move sections_are_attached_ field.
  12777. * main.cc (main): Pass number of input files to Layout
  12778. constructor. Don't pass options.
  12779. 2009-03-30 Ian Lance Taylor <iant@google.com>
  12780. * ffsll.c (ffsll): Correct implementation.
  12781. 2009-03-27 Ian Lance Taylor <iant@google.com>
  12782. * ffsll.c: New file.
  12783. * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
  12784. * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
  12785. * ftruncate.c (ftruncate): Declare before definition.
  12786. * mremap.c (mremap): Likewise.
  12787. * pread.c (pread): Likewise.
  12788. * configure, Makefile.in, config.in: Rebuild.
  12789. * mremap.c: New file.
  12790. * configure.ac: Call AC_REPLACE_FUNCS on mremap.
  12791. * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
  12792. (mremap): Declare if HAVE_MREMAP is not defined.
  12793. * configure, Makefile.in, config.in: Rebuild.
  12794. 2009-03-27 Cary Coutant <ccoutant@google.com>
  12795. * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
  12796. position independent.
  12797. * sparc.cc (Target_sparc::check_non_pic): Likewise.
  12798. * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
  12799. 2009-03-24 Cary Coutant <ccoutant@google.com>
  12800. * symtab.h (needs_plt_entry): Check for unsatisfied reference from
  12801. an executable.
  12802. (needs_dynamic_reloc): Likewise.
  12803. 2009-03-24 Ian Lance Taylor <iant@google.com>
  12804. * yyscript.y (file_cmd): Recognize EXTERN.
  12805. (extern_name_list, extern_name_list_body): New nonterminals.
  12806. * script.cc (script_add_extern): Define.
  12807. * script-c.h (script_add_extern): Declare.
  12808. 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
  12809. * object.cc (is_elf_object): Define.
  12810. * object.h (is_elf_object): Declare.
  12811. * archive.cc (Archive::get_elf_object_for_member): Call
  12812. is_elf_object.
  12813. * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
  12814. 2009-03-24 Elliott Hughes <enh@google.com>
  12815. * output.cc (Output_file::map_anonymous): Define.
  12816. (Output_file::map): Use map_anonymous. If the regular mmap fails,
  12817. try an anonymous one. Report the size if the mmap fails.
  12818. * output.h (class Output_file): Declare map_anonymous.
  12819. 2009-03-24 Ian Lance Taylor <iant@google.com>
  12820. * target-select.cc (instantiate_target): Don't acquire the lock if
  12821. the instantiated_target_ field has already been set.
  12822. 2009-03-23 Ian Lance Taylor <iant@google.com>
  12823. * gold-threads.h (class Initialize_lock): Define.
  12824. * gold-threads.cc (class Initialize_lock_once): Define.
  12825. (initialize_lock_control): New static variable.
  12826. (initialize_lock_pointer): New static variable.
  12827. (initialize_lock_once): New static function.
  12828. (Initialize_lock::Initialize_lock): Define.
  12829. (Initialize_lock::initialize): Define.
  12830. * target-select.h: Include "gold-threads.h".
  12831. (class Target_selector): Add lock_ and initialize_lock_ fields.
  12832. Don't define instantiate_target, just declare it.
  12833. * target-select.cc (Target_selector::Target_selector): Initialize
  12834. new fields.
  12835. (Target_selector::instantiate_target): Define.
  12836. * descriptors.h: Include "gold-threads.h".
  12837. (class Descriptors): Add initialize_lock_ field.
  12838. * descriptors.cc (Descriptors::Descriptors): Initialize new
  12839. field.
  12840. (Descriptors::open): Use initialize_lock_ field
  12841. * errors.h (class Errors): Add initialize_lock_ field.
  12842. * errors.cc (Errors::Errors): Initialize new field.
  12843. (Errors::initialize_lock): Use initialize_lock_ field.
  12844. * powerpc.cc (class Target_selector_powerpc): Remove
  12845. instantiated_target_ field. In do_recognize call
  12846. instantiate_target rather than do_instantiate_target. In
  12847. do_instantiate_target just allocate a new target.
  12848. * sparc.cc (class Target_selector_sparc): Likewise.
  12849. * freebsd.h: New file.
  12850. * i386.cc: Include "freebsd.h".
  12851. (Target_i386): Derive from Target_freebsd rather than
  12852. Sized_target.
  12853. (Target_selector_i386): Derive from Target_selector_freebsd rather
  12854. than Target_selector.
  12855. * x86_64.cc: Include "freebsd.h".
  12856. (Target_x86_64): Derive from Target_freebsd rather than
  12857. Sized_target.
  12858. (Target_selector_x86_64): Derive from Target_selector_freebsd
  12859. rather than Target_selector.
  12860. * target.h (class Target): Add adjust_elf_header and
  12861. do_adjust_elf_header.
  12862. * output.cc (Output_file_header:: do_sized_write): Call target
  12863. adjust_elf_header routine.
  12864. * configure.tgt: Set targ_osabi.
  12865. * configure.ac: Define GOLD_DEFAULT_OSABI.
  12866. * parameters.cc (Parameters::default_target): Pass
  12867. GOLD_DEFAULT_OSABI to select_target.
  12868. * target-select.h (class Target_selector): Make instantiate_target
  12869. protected rather than private.
  12870. * Makefile.am (HFILES): Add freebsd.h.
  12871. * configure, Makefile.in, config.in: Rebuild.
  12872. * merge.cc (do_add_input_section): Correct pend value. Change
  12873. message about last entry not being null terminated from error to
  12874. warning.
  12875. 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
  12876. * incremental.cc: New file.
  12877. * Makefile.am (CCFILES): Add incremental.cc.
  12878. * Makefile.in: Rebuild.
  12879. 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
  12880. * layout.cc (Layout::output_section_name): Preserve names
  12881. of '.note.' sections.
  12882. 2009-03-19 Ian Lance Taylor <iant@google.com>
  12883. * descriptors.cc (Descriptors::open): Check that the options are
  12884. valid before using them.
  12885. 2009-03-18 Ian Lance Taylor <iant@google.com>
  12886. * script-sections.h: Include <list>.
  12887. (class Script_sections): Change Sections_elements from std::vector
  12888. to std::list. Typedef public Elements_iterator. Add
  12889. orphan_section_placement_, data_segment_align_start_, and
  12890. saw_data_segment_align_ fields. Remove data_segment_align_index_
  12891. field.
  12892. * script-sections.cc (class Orphan_section_placement): New class.
  12893. (class Sections_element): Add virtual functions is_relro and
  12894. orphan_section_init. Remove virtual function place_orphan_here.
  12895. (class Output_section_definition): Add is_relro and
  12896. orphan_section_init. Remove place_orphan_here.
  12897. (class Orphan_output_section): Likewise.
  12898. (Script_sections::Script_sections): Update for field changes.
  12899. (Script_sections::data_segment_align): Set saw_data_segment_align_
  12900. and data_segment_align_start_, not data_segment_align_index.
  12901. (Script_sections::data_segment_relro_end): Check
  12902. saw_data_segment_align_. Use data_segment_align_start_ rather
  12903. than data_segment_align_index_.
  12904. (Script_sections::place_orphan): Rewrite to use
  12905. Orphan_section_placement.
  12906. 2009-03-17 Ian Lance Taylor <iant@google.com>
  12907. * archive.cc (Archive::add_symbols): Check for a version attached
  12908. to the symbol name in the archive map.
  12909. * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
  12910. (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
  12911. (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
  12912. (ver_test_11.a): New target.
  12913. * testsuite/Makefile.in: Rebuild.
  12914. * configure.ac: Check for chsize and posix_fallocate. Replace
  12915. ftruncate.
  12916. * ftruncate.c: New file, from gnulib.
  12917. * output.cc (posix_fallocate): Define dummy version if not
  12918. HAVE_POSIX_FALLOCATE.
  12919. (Output_file::map): Call posix_fallocate rather than lseek and
  12920. write.
  12921. * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
  12922. * configure, Makefile.in, config.in: Rebuild.
  12923. 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
  12924. * layout.h (Layout::create_note): Add section_name parameter.
  12925. * layout.cc (Layout::create_note): Likewise.
  12926. (Layout::create_build_id, Layout::create_gold_note): Fix callers.
  12927. 2009-03-17 Ian Lance Taylor <iant@google.com>
  12928. * descriptors.cc: Include "options.h".
  12929. (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
  12930. (Descriptors::open): Always use O_CLOEXEC when opening a new
  12931. descriptor. If we have a plugin, and O_CLOEXEC was not defined,
  12932. then set FD_CLOEXEC.
  12933. * sparc.cc (class Target_sparc): Add has_got_section.
  12934. (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
  12935. make sure we have a GOT section.
  12936. * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
  12937. (Target_sparc::Scan::local): Likewise.
  12938. (Target_sparc::Scan::global): Likewise.
  12939. (Target_sparc::Relocate::relocate): Likewise.
  12940. (Target_sparc::Relocate::relocate_tls): Likewise.
  12941. * symtab.cc (Symbol_table::define_default_version): New function,
  12942. broken out of add_from_object.
  12943. (Symbol_table::add_from_object): Call define_default_version.
  12944. (Symbol_table::define_special_symbol): Add resolve_oldsym
  12945. parameter. Change all callers. If the version for a symbol comes
  12946. from a version script, resolve it with the symbol with the same
  12947. name with no version. Also add the symbol without a version if
  12948. appropriate.
  12949. (do_define_in_output_data): If resolving with oldsym, don't delete
  12950. sym.
  12951. (do_define_in_output_segment): Likewise.
  12952. (do_define_as_constant): Likewise.
  12953. * symtab.h (class Symbol_table): Update declarations.
  12954. 2009-03-13 Ian Lance Taylor <iant@google.com>
  12955. * readsyms.cc (Read_symbols::incompatible_warning): New function.
  12956. (Read_symbols::requeue): New function.
  12957. (Read_symbols::do_read_symbols): If make_elf_object fails because
  12958. the target type is not configured, and the file was searched for,
  12959. issue a warning and retry with the next directory.
  12960. (Add_symbols::run): If the file has an incompatible format, and
  12961. it was searched for, requeue the Read_symbols task. On error,
  12962. release the object.
  12963. * readsyms.h (class Read_symbols): Add dirindex_ field. Add
  12964. dirindex parameter to constructor. Change all callers. Declare
  12965. incompatible_warning and requeue.
  12966. (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
  12967. input_argument_ and input_group_ fields. Add them to
  12968. constructor. Change all callers.
  12969. (class Read_script): Add dirindex_ field. Add it to constructor.
  12970. Change all callers.
  12971. * archive.cc (Archive::setup): Remove input_objects parameter.
  12972. Change all callers.
  12973. (Archive::get_file_and_offset): Likewise.
  12974. (Archive::read_all_symbols): Likewise.
  12975. (Archive::read_symbols): Likewise.
  12976. (Archive::get_elf_object_for_member): Remove input_objects
  12977. parameter. Add punconfigured parameter. Change all callers.
  12978. (Archive::add_symbols): Change return type to bool. Check return
  12979. value of include_member.
  12980. (Archive::include_all_members): Likewise.
  12981. (Archive::include_member): Change return type to bool. Return
  12982. false if first included object has incompatible target. Set
  12983. included_member_ field.
  12984. (Add_archive_symbols::run): If add_symbols returns false, requeue
  12985. Read_symbols task.
  12986. * archive.h (class Archive): Add included_member_ field.
  12987. Initialize it in constructor. Add input_file and searched_for
  12988. methods. Update declarations.
  12989. (class Add_archive_symbols): Add dirpath_, dirindex_, and
  12990. input_argument_ fields. Add them to constructor. Change all
  12991. callers.
  12992. * script.cc: Include "target-select.h".
  12993. (class Parser_closure): Add skip_on_incompatible_target_ and
  12994. found_incompatible_target_ fields. Add
  12995. skip_on_incompatible_target parameter to constructor. Change all
  12996. callers. Add methods skip_on_incompatible_target,
  12997. clear_skip_on_incompatible_target, found_incompatible_target, and
  12998. set_found_incompatible_target.
  12999. (read_input_script): Add dirindex parameter. Change all callers.
  13000. If parser finds an incompatible target, requeue Read_symbols
  13001. task.
  13002. (script_set_symbol): Clear skip_on_incompatible_target in
  13003. closure.
  13004. (script_add_assertion, script_parse_option): Likewise.
  13005. (script_start_sections, script_add_phdr): Likewise.
  13006. (script_check_output_format): New function.
  13007. * script.h (read_input_script): Update declaration.
  13008. * script-c.h (script_check_output_format): Declare.
  13009. * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
  13010. (ignore_cmd): Remove OUTPUT_FORMAT.
  13011. * fileread.cc (Input_file::Input_file): Add explicit this.
  13012. (Input_file::will_search_for): New function.
  13013. (Input_file::open): Add pindex parameter. Change all callers.
  13014. * fileread.h (class Input_file): Add input_file_argument method.
  13015. Declare will_search_for. Update declarations.
  13016. * object.cc (make_elf_object): Add punconfigured parameter.
  13017. Change all callers.
  13018. * object.h (class Object): Make input_file public. Add
  13019. searched_for method.
  13020. (make_elf_object): Update declaration.
  13021. * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
  13022. restart search.
  13023. * dirsearch.h (class Dirsearch): Update declaration.
  13024. * options.h (class General_options): Add --warn-search-mismatch.
  13025. * parameters.cc (Parameters::is_compatible_target): New function.
  13026. * parameters.h (class Parameters): Declare is_compatible_target.
  13027. * workqueue.cc (Workqueue::add_blocker): New function.
  13028. * workqueue.h (class Workqueue): Declare add_blocker.
  13029. * fileread.cc (Input_file::open): Remove options parameter.
  13030. Change all callers.
  13031. (Input_file::open_binary): Likewise.
  13032. * script.cc (read_input_script): Likewise.
  13033. * readsyms.h (class Read_symbols): Remove options_ field. Remove
  13034. options parameter from constructor. Change all callers.
  13035. (class Read_script): Likewise.
  13036. * fileread.h (class Input_file): Update declarations.
  13037. * script.h (read_input_script): Update declaration.
  13038. 2009-03-10 Nick Clifton <nickc@redhat.com>
  13039. * po/es.po: New Spanish translation.
  13040. 2009-03-06 Cary Coutant <ccoutant@google.com>
  13041. * options.cc (parse_short_option): Keep dash_z from registering itself.
  13042. 2009-03-03 Ian Lance Taylor <iant@google.com>
  13043. PR 9918
  13044. * target-reloc.h (relocate_section): Pass output_section to
  13045. relocate.
  13046. * i386.cc (Target_i386::should_apply_static_reloc): Add
  13047. output_section parameter. Change all callers.
  13048. (Target_i386::Relocate::relocate): Add output_section parameter.
  13049. * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
  13050. * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
  13051. * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
  13052. * testsuite/two_file_shared.sh: New script.
  13053. * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
  13054. (check_DATA): Add two_file_shared.dbg.
  13055. (two_file_shared.dbg): New target.
  13056. * testsuite/Makefile.in: Rebuild.
  13057. 2009-03-01 Ian Lance Taylor <iant@google.com>
  13058. * configure.ac: Check for byteswap.h.
  13059. * configure: Rebuild.
  13060. * config.in: Rebuild.
  13061. 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
  13062. * layout.cc (Layout::find_or_add_kept_section): New function.
  13063. (Layout::add_comdat): Removed.
  13064. * layout.h (struct Kept_section): Move out of class Layout.
  13065. Remove trailing underscores from field names. Add group_sections
  13066. field. Rename group_ field to is_group. Change all uses.
  13067. (class Layout): Declare find_or_add_kept_section, not add_comdat.
  13068. * object.cc (Sized_relobj::Sized_relobj): Don't initialize
  13069. comdat_groups_ field.
  13070. (Sized_relobj::include_section_group): Use
  13071. find_or_add_kept_section and Kept_section::group_sections.
  13072. (Sized_relobj::include_linkonce_section): Likewise.
  13073. * object.cc (class Sized_relobj): Don't define Comdat_group or
  13074. Comdat_group_table. Remove find_comdat_group and
  13075. add_comdat_group. Remove comdat_groups_ field.
  13076. * plugin.cc (include_comdat_group): Use
  13077. Layout::find_or_add_kept_section.
  13078. 2009-02-28 Ian Lance Taylor <iant@google.com>
  13079. * README: --gc-sections and map files are now supported. Document
  13080. some build requirements.
  13081. PR 6992
  13082. * symtab.cc (Symbol_table::sized_write_section_symbol): In a
  13083. relocatable link set the value of the section symbol to zero.
  13084. * object.cc (Sized_relobj::do_finalize_local_symbols): In a
  13085. relocatable link don't include the section address in the local
  13086. symbol value.
  13087. 2009-02-27 Ian Lance Taylor <iant@google.com>
  13088. PR 6811
  13089. * options.h (class Search_directory): Add is_system_directory.
  13090. (class General_options): Declare is_in_system_directory.
  13091. * options.cc (get_relative_sysroot): Make static.
  13092. (get_default_sysroot): Make static.
  13093. (General_optoins::is_in_system_directory): New function.
  13094. * fileread.cc (Input_file::is_in_system_directory): New function.
  13095. * fileread.h (class Input_file): Declare is_in_system_directory.
  13096. * object.h (class Object): Add is_in_system_directory.
  13097. (class Input_objects): Remove system_library_directory_ field.
  13098. * object.cc (Input_objects::add_object): Don't set
  13099. system_library_directory_.
  13100. (input_objects::found_in_system_library_directory): Remove.
  13101. * symtab.cc (Symbol_table::write_globals): Remove input_objects
  13102. parameter. Change all callers.
  13103. (Symbol_table::sized_write_globals): Likewise.
  13104. (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
  13105. Call Object::is_in_system_directory.
  13106. * symtab.h (class Symbol_table): Update declarations.
  13107. PR 5990
  13108. * descriptors.h (Open_descriptor): Add is_on_stack field.
  13109. * descriptors.cc (Descriptors::open): If the descriptor is on the
  13110. top of the stack, remove it. Initialize is_on_stack field.
  13111. (Descriptors::release): Only add pod to stack if it is not on the
  13112. stack already.
  13113. (Descriptors::close_some_descriptor): Clear stack_next and
  13114. is_on_stack fields.
  13115. PR 7091
  13116. * output.cc (Output_section::find_starting_output_address): Rename
  13117. from starting_output_address; add PADDR parameter; change return
  13118. type.
  13119. * output.h (class Output_section): Declare
  13120. find_starting_output_address instead of starting_output_address.
  13121. * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
  13122. section symbol for which we can't find a merge section.
  13123. PR 9836
  13124. * symtab.cc (Symbol_table::add_from_object): If the visibility is
  13125. hidden or internal, force the symbol to be local.
  13126. * resolve.cc (Symbol::override_visibility): Define.
  13127. (Symbol::override_base): Use override_visibility.
  13128. (Symbol_table::resolve): Likewise.
  13129. (Symbol::override_base_with_special): Likewise.
  13130. (Symbol_table::override_with_special): If the visibility is hidden
  13131. or internal, force the symbol to be local.
  13132. * symtab.h (class Symbol): Add set_visibility and
  13133. override_visibility.
  13134. * testsuite/ver_test_1.sh: New file.
  13135. * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
  13136. (check_DATA): Add ver_test_1.syms.
  13137. (ver_test_1.syms): New target.
  13138. * testsuite/Makefile.in: Rebuild.
  13139. 2009-02-25 Cary Coutant <ccoutant@google.com>
  13140. * layout.cc (Layout::choose_output_section): Don't rename sections
  13141. when using a linker script that has a SECTIONS clause.
  13142. * Makefile.in: Regenerate.
  13143. * testsuite/Makefile.am (script_test_5.sh): New test case.
  13144. * testsuite/Makefile.in: Regenerate.
  13145. * testsuite/script_test_5.cc: New file.
  13146. * testsuite/script_test_5.sh: New file.
  13147. * testsuite/script_test_5.t: New file.
  13148. 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
  13149. * archive.cc (Archive::include_member): Update calls to add_symbols.
  13150. * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
  13151. the Layout argument.
  13152. * dynobj.h (do_add_symbols): Add the Layout argument.
  13153. * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
  13154. Layout argument.
  13155. * object.h (Object::add_symbols): Add the Layout argument.
  13156. (Object::do_add_symbols): Add the Layout argument.
  13157. (Sized_relobj::do_add_symbols): Add the Layout argument.
  13158. * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
  13159. Unify the two versions.
  13160. (Add_plugin_symbols): Remove.
  13161. * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
  13162. (Sized_pluginobj::do_add_symbols): Unify the two versions.
  13163. (Add_plugin_symbols): Remove.
  13164. * readsyms.cc (Read_symbols::do_read_symbols): Update call to
  13165. Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
  13166. (Add_symbols::run): Make it work with Pulginobj.
  13167. 2009-02-06 Ian Lance Taylor <iant@google.com>
  13168. * object.cc (Sized_relobj::do_layout): Make info message start
  13169. with lower case letter.
  13170. 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
  13171. * binary.cc: Fix file comment.
  13172. * options.h (enum Incremental_disposition): Define.
  13173. (class General_options): Add new options: --incremental,
  13174. --incremental_changed, --incremental_unchanged,
  13175. --incremental_unknown. Add incremental_disposition_ and
  13176. implicit_incremental_ fields.
  13177. (General_options::incremental_disposition): New function.
  13178. (class Position_dependent_options): Add incremental_disposition
  13179. option.
  13180. (Position_dependent_options::copy_from_options): Set incremental
  13181. dispositions.
  13182. * options.cc (General_options::parse_incremental_changed): New
  13183. function.
  13184. (General_options::parse_incremental_unchanged): New function.
  13185. (General_options::parse_incremental_unknown): New function.
  13186. (General_options::General_options): Initialize new fields
  13187. incremental_disposition_ and implicit_incremental_.
  13188. (General_options::finalize): Check for uasge of --incremental-*
  13189. without --incremental.
  13190. 2009-02-06 Chris Demetriou <cgd@google.com>
  13191. * gold.h (gold_undefined_symbol): Change to take only a Symbol
  13192. pointer and to report location as the file name associated with
  13193. the symbol.
  13194. (gold_undefined_symbol_at_location): New function to replace the
  13195. old gold_undefined_symbol functionality.
  13196. * target-reloc.h (relocate_section): Update to use
  13197. gold_undefined_symbol_at_location.
  13198. * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
  13199. Call gold_undefined_symbol function rather than gold_error.
  13200. * errors.h (Errors::undefined_symbol): Take location as a
  13201. string, rather than calculating it from a relocation.
  13202. * errors.cc (Errors::fatal): Print "fatal error:" before the
  13203. formatted message.
  13204. (Errors::error, Errors::error_at_location): Print "error: "
  13205. before the formatted message.
  13206. (Errors::undefined_symbol): Take location as a string, rather
  13207. than calculating it from a relocation.
  13208. (gold_undefined_symbol_at_location): New function akin to
  13209. old gold_undefined_symbol, calculates location from relocation.
  13210. (gold_undefined_symbol): Change to take only a Symbol pointer
  13211. and to report location as the file name associated with the symbol.
  13212. * testsuite/debug_msg.sh: Update for changed error messages.
  13213. * testsuite/undef_symbol.sh: Likewise.
  13214. 2009-02-04 Duncan Sands <baldrick@free.fr>
  13215. PR 9812
  13216. * reduced_debug_output.h
  13217. (Output_reduced_debug_abbrev_section::failed): Use format for
  13218. gold_warning.
  13219. (Output_reduced_debug_info_section::faild): Likewise.
  13220. 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
  13221. * script.cc (Lazy_demangler): New class.
  13222. (Version_script_info::get_symbol_version_helper): Demangle a
  13223. symbol only once.
  13224. 2009-01-29 Cary Coutant <ccoutant@google.com>
  13225. * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
  13226. to __tls_get_addr.
  13227. * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
  13228. 2009-01-28 Ian Lance Taylor <iant@google.com>
  13229. * version.cc (version_string): Bump to 1.9.
  13230. * gold.h: Include <cstring> and <stdint.h>.
  13231. * version.cc: Include <cstdio>.
  13232. * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
  13233. warning.
  13234. * reduced_debug_output.cc (insert_into_vector): Rename from
  13235. Insert_into_vector; change all callers. Use Swap_unaligned to
  13236. avoid aliasing issue; remove union since it is unnecessary.
  13237. 2009-01-27 Sriraman Tallam <tmsriram@google.com>
  13238. * Makefile.am (CCFILES): Add gc.cc.
  13239. (HFILES): Add gc.h.
  13240. * Makefile.in: Regenerate.
  13241. * gold.cc (Gc_runner): New class.
  13242. (queue_initial_tasks): Call garbage collection related tasks
  13243. when corresponding options are invoked.
  13244. (queue_middle_gc_tasks): New function.
  13245. (queue_middle_tasks): Reorder tasks to allow relocs to be read and
  13246. processed early before laying out sections during garbage collection.
  13247. * gold.h (queue_middle_gc_tasks): New function.
  13248. (is_prefix_of): Move from "layout.cc".
  13249. * i386.cc (Target_i386::gc_process_relocs): New function.
  13250. * layout.cc (is_prefix_of): Remove. Move to "gold.h"
  13251. * main.cc (main): Create object of class "Garbage_collection".
  13252. * object.cc (Relobj::copy_symbols_data): New function.
  13253. (Relobj::is_section_name_included): New function.
  13254. (Sized_relobj::do_layout): Allow this function to be called twice
  13255. during garbage collection and defer layout of section during the
  13256. first call.
  13257. * object.h (Relobj::get_symbols_data): New function.
  13258. (Relobj::is_section_name_included): New function.
  13259. (Relobj::copy_symbols_data): New function.
  13260. (Relobj::set_symbols_data): New function.
  13261. (Relobj::get_relocs_data): New function.
  13262. (Relobj::set_relocs_data): New function.
  13263. (Relobj::is_output_section_offset_invalid): New pure virtual function.
  13264. (Relobj::gc_process_relocs): New function.
  13265. (Relobj::do_gc_process_relocs): New pure virtual function.
  13266. (Relobj::sd_): New data member.
  13267. (Sized_relobj::is_output_section_offset_invalid): New function.
  13268. (Sized_relobj::do_gc_process_relocs): New function.
  13269. * options.h (General_options::gc_sections): Modify to not be a no-op.
  13270. (General_options::print_gc_sections): New option.
  13271. * plugin.cc (Plugin_finish::run): Remove function call to
  13272. Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
  13273. * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
  13274. * reloc.cc (Read_relocs::run): Add task to process relocs and
  13275. determine unreferenced sections when doing garbage collection.
  13276. (Gc_process_relocs): New class.
  13277. (Sized_relobj::do_gc_process_relocs): New function.
  13278. (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
  13279. sections that are garbage collected.
  13280. * reloc.h (Gc_process_relocs): New class.
  13281. * sparc.cc (Target_sparc::gc_process_relocs): New function.
  13282. * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
  13283. symbols whose corresponding sections are garbage collected.
  13284. (Symbol_table::Symbol_table): Add new parameter for the garbage
  13285. collection object.
  13286. (Symbol_table::gc_mark_undef_symbols): New function.
  13287. (Symbol_table::gc_mark_symbol_for_shlib): New function.
  13288. (Symbol_table::gc_mark_dyn_syms): New function.
  13289. (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
  13290. as garbage.
  13291. (Symbol_table::add_from_object): Likewise.
  13292. (Symbol_table::add_from_relobj): When building shared objects, do not
  13293. treat externally visible symbols as garbage.
  13294. (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
  13295. table information for static and relocatable links.
  13296. * symtab.h (Symbol_table::set_gc): New function.
  13297. (Symbol_table::gc): New function.
  13298. (Symbol_table::gc_mark_undef_symbols): New function.
  13299. (Symbol_table::gc_mark_symbol_for_shlib): New function.
  13300. (Symbol_table::gc_mark_dyn_syms): New function.
  13301. (Symbol_table::gc_): New data member.
  13302. * target.h (Sized_target::gc_process_relocs): New pure virtual
  13303. function.
  13304. * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
  13305. * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
  13306. 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
  13307. * options.h (General_options::gc_sections): Define as a no-op for now.
  13308. (General_options::no_keep_memory): Ditto.
  13309. (General_options::Bshareable): Define.
  13310. * options.cc (General_options::finalize): Honor -Bshareable.
  13311. 2009-01-20 Andreas Schwab <schwab@suse.de>
  13312. * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
  13313. read the value in the contents, since we don't use it. Use the
  13314. template endianness when writing.
  13315. (Relocate::relocate): Use it for R_PPC_REL16_HA.
  13316. 2009-01-19 Andreas Schwab <schwab@suse.de>
  13317. * configure.tgt (powerpc64-*): Fix targ_obj.
  13318. 2009-01-15 Ian Lance Taylor <iant@google.com>
  13319. * object.cc (Sized_relobj::write_local_symbols): Don't write out
  13320. local symbols when stripping all symbols.
  13321. 2009-01-14 Cary Coutant <ccoutant@google.com>
  13322. * output.cc (Output_reloc): Add explicit instantiations.
  13323. 2009-01-14 Cary Coutant <ccoutant@google.com>
  13324. * archive.cc (Archive::get_elf_object_for_member): Remove call
  13325. to File_read::claim_for_plugin.
  13326. * descriptors.cc (Descriptors::open): Remove reference to
  13327. is_claimed.
  13328. (Descriptors::claim_for_plugin): Remove.
  13329. * descriptors.h (Descriptors::claim_for_plugin): Remove.
  13330. (Descriptors::is_claimed): Remove.
  13331. (claim_descriptor_for_plugin): Remove.
  13332. * fileread.cc (File_read::claim_for_plugin): Remove.
  13333. * fileread.h (File_read::claim_for_plugin): Remove.
  13334. (File_read::descriptor): Reopen descriptor if necessary.
  13335. * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
  13336. (Plugin_manager::all_symbols_read): Add task parameter. Change
  13337. all callers.
  13338. (Plugin_manager::get_input_file): New function.
  13339. (Plugin_manager::release_input_file): New function.
  13340. (Pluginobj::Pluginobj): Add filesize parameter and initialize
  13341. corresponding data member.
  13342. (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
  13343. and pass to base constructor. Change all callers.
  13344. (get_input_file, release_input_file): New functions.
  13345. (make_sized_plugin_object): Add filesize parameter. Change all callers.
  13346. * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
  13347. (Plugin_manager::all_symbols_read): Add task parameter.
  13348. (Plugin_manager::get_input_file): New function.
  13349. (Plugin_manager::release_input_file): New function.
  13350. (Plugin_manager::task_): New data member.
  13351. (Pluginobj::Pluginobj): Add filesize parameter.
  13352. (Pluginobj::filename): New function.
  13353. (Pluginobj::descriptor): New function.
  13354. (Pluginobj::filesize): New function.
  13355. (Pluginobj::filesize_): New data member.
  13356. (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
  13357. * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
  13358. File_read::claim_for_plugin; use Object::unlock to unlock the file.
  13359. * testsuite/Makefile.am (plugin_test_4): New test case for plugins
  13360. with archive libraries.
  13361. * testsuite/Makefile.in: Regenerate.
  13362. * testsuite/plugin_test.c (struct sym_info): New type.
  13363. (get_input_file, release_input_file): New static variables.
  13364. (onload): Capture new transfer vector entries.
  13365. (claim_file_hook): Stop reading at end of file according to filesize.
  13366. Factor out parsing of readelf output into separate function.
  13367. (all_symbols_read_hook): Exercise get_input_file and release_input_file
  13368. APIs and get the source file name from the symbol table. Convert
  13369. source file name to corresponding object file name. Print info
  13370. message when adding new input files.
  13371. (parse_readelf_line): New function.
  13372. * testsuite/plugin_test_1.sh: Add checks for new info messages.
  13373. * testsuite/plugin_test_2.sh: Likewise.
  13374. * testsuite/plugin_test_3.sh: Likewise.
  13375. * testsuite/plugin_test_4.sh: New test case.
  13376. 2009-01-07 Ian Lance Taylor <iant@google.com>
  13377. * version.cc (version_string): Bump to 1.8.
  13378. 2008-12-23 Cary Coutant <ccoutant@google.com>
  13379. * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
  13380. * plugin.cc (Plugin_manager::finish): Rename as
  13381. layout_deferred_objects. Move cleanup to separate function.
  13382. (Plugin_manager::cleanup): New function.
  13383. (Plugin_finish::run): Call layout_deferred_objects and cleanup
  13384. separately.
  13385. * plugin.h (Plugin_manager::finish): Rename as
  13386. layout_deferred_objects.
  13387. (Plugin_manager::cleanup): New function.
  13388. (Plugin_manager::cleanup_done): New field.
  13389. 2008-12-23 Cary Coutant <ccoutant@google.com>
  13390. * plugin.cc (is_visible_from_outside): New function.
  13391. (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
  13392. so we don't return "IR only" status for exported symbols or -r links.
  13393. * testsuite/Makefile.am (plugin_test_3): New test case.
  13394. * testsuite/Makefile.in: Regenerate.
  13395. * testsuite/plugin_test_3.sh: New file.
  13396. 2008-12-22 Cary Coutant <ccoutant@google.com>
  13397. * object.cc (Sized_relobj::layout_section): New function.
  13398. (Sized_relobj::do_layout): Defer layout of input sections until after
  13399. plugin has provided replacement files.
  13400. (Sized_relobj::do_layout_deferred_sections): New function.
  13401. * object.h (Relobj::set_section_offset): Remove virtual keyword.
  13402. (Relobj::layout_deferred_sections): New function.
  13403. (Relobj::do_layout_deferred_sections): New function.
  13404. (Sized_relobj::do_layout_deferred_sections): New function.
  13405. (Sized_relobj::layout_section): New function.
  13406. (Sized_relobj::Deferred_layout): New structure.
  13407. (Sized_relobj::deferred_layout_): New field.
  13408. * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
  13409. Change all callers. Layout deferred sections.
  13410. (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
  13411. references.
  13412. (Plugin_hook::run): Move code from do_plugin_hook inline.
  13413. (Plugin_hook::do_plugin_hook): Remove.
  13414. * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
  13415. (Plugin_manager::finish): Renamed, was cleanup.
  13416. (Plugin_manager::should_defer_layout): New function.
  13417. (Plugin_manager::add_deferred_layout_object): New function.
  13418. (Plugin_manager::Deferred_layout_list): New type.
  13419. (Plugin_manager::deferred_layout_objects_): New field.
  13420. (Plugin_hook::do_plugin_hook): Remove.
  13421. 2008-12-17 Ian Lance Taylor <iant@google.com>
  13422. * options.h (class General_options): Add --no case for
  13423. --export-dynamic.
  13424. 2008-12-16 Cary Coutant <ccoutant@google.com>
  13425. * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
  13426. vector.
  13427. (Plugin_manager::claim_file): Create plugin object even if
  13428. plugin did not call the add_symbols callback.
  13429. (Plugin_obj::get_symbol_resolution_info): Guard against plugin
  13430. asking for more symbols than were added.
  13431. * testsuite/Makefile.am (plugin_test_1): Add test case with
  13432. no global symbols.
  13433. (empty.syms): New target.
  13434. * testsuite/Makefile.in: Regenerate.
  13435. * testsuite/plugin_test.c (claim_file_hook): Add new debug
  13436. message. Don't call add_symbols if no globals.
  13437. (all_symbols_read_hook): Don't provide replacement for empty
  13438. claimed file.
  13439. 2008-12-12 Ian Lance Taylor <iant@google.com>
  13440. * target-reloc.h (Default_scan_relocatable_relocs): Only discard
  13441. r_type == 0 for a local symbol with r_sym == 0.
  13442. (scan_relocatable_relocs): Pass r_sym to
  13443. local_non_section_strategy.
  13444. * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
  13445. r_sym parameter.
  13446. * configure.ac: Update test for TLS descriptors: they are
  13447. supported as of glibc 2.9.
  13448. * configure: Rebuild.
  13449. 2008-12-11 Ian Lance Taylor <iant@google.com>
  13450. PR 7091
  13451. * target-reloc.h (Default_scan_relocatable_relocs): For each
  13452. function, map r_type == 0 to RELOC_DISCARD.
  13453. 2008-12-10 Cary Coutant <ccoutant@google.com>
  13454. * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
  13455. object to override a kept COMDAT group from a plugin object.
  13456. 2008-12-09 Ian Lance Taylor <iant@google.com>
  13457. PR 7088
  13458. * yyscript.y (file_cmd): Handle INPUT.
  13459. * testsuite/initpri1.c: Change all declarations to be full
  13460. prototypes by adding void, to avoid compiler warnings.
  13461. 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
  13462. * options.cc (General_options::parse_plugin_opt): New.
  13463. (General_options::add_plugin): The argument now is just the filename.
  13464. (General_options::add_plugin_option): New.
  13465. * options.h (plugin_opt): New.
  13466. (add_plugin): Change argument name.
  13467. (add_plugin_option): New.
  13468. * plugin.cc (Plugin::load): Don't parse the plugin option.
  13469. * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
  13470. (Plugin::add_option): New.
  13471. (Plugin::args_): Change type.
  13472. (Plugin::filename_): New.
  13473. (Plugin_manager::add_plugin_option): New.
  13474. * testsuite/Makefile.am (plugin_test_1): Use new syntax.
  13475. * testsuite/Makefile.in: Regenerate.
  13476. 2008-12-05 Cary Coutant <ccoutant@google.com>
  13477. * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
  13478. Handle --strip-lto-sections option.
  13479. * options.h (strip_lto_sections): New option.
  13480. 2008-12-01 Cary Coutant <ccoutant@google.com>
  13481. * plugin.cc (ld_plugin_message): Change format parameter to const.
  13482. Fix mismatch between new[] and delete.
  13483. 2008-11-14 Cary Coutant <ccoutant@google.com>
  13484. * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
  13485. instead of -1U.
  13486. 2008-11-05 Craig Silverstein <csilvers@google.com>
  13487. * options.cc (General_options::parse_dynamic_list): New function.
  13488. * options.h (General_options): New flags dynamic_list,
  13489. dynamic_list_data, dynamic_list_cpp_new, and
  13490. dynamic_list_cpp_typeinfo. New variable dynamic_list_.
  13491. (General_options::in_dynamic_list): New function.
  13492. * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
  13493. (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
  13494. (Lex::can_continue_name): Likewise.
  13495. (yylex): Likewise.
  13496. (read_script_file): New parameter script_options.
  13497. (read_dynamic_list): New function.
  13498. (Script_options::define_dynamic_list): New function.
  13499. (dynamic_list_keyword_parsecodes): New variable.
  13500. (dynamic_list_keywords): New variable.
  13501. * script.h (Script_options::define_dynamic_list): New function
  13502. prototype.
  13503. (read_dynamic_list): New function prototype.
  13504. * symtab.cc (strprefix): New macro.
  13505. (Symbol::should_add_dynsym_entry): Support dynamic_list,
  13506. dynamic_list_data, dynamic_list_cpp_new, and
  13507. dynamic_list_cpp_typeinfo.
  13508. * yyscript.y (PARSING_DYNAMIC_LIST): New token.
  13509. (dynamic_list_expr): New rule.
  13510. (dynamic_list_nodes): Likewise.
  13511. (dynamic_list_node): Likewise.
  13512. * testsuite/Makefile.am (dynamic_list): New test.
  13513. * testsuite/Makefile.in: Regenerated.
  13514. * testsuite/dynamic_list.t: New file.
  13515. * testsuite/dynamic_list.sh: New file.
  13516. 2008-11-05 Craig Silverstein <csilvers@google.com>
  13517. * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
  13518. * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
  13519. (t11_last): Likewise.
  13520. * testsuite/ver_test_6.c (main): Likewise.
  13521. 2008-10-07 Cary Coutant <ccoutant@google.com>
  13522. * options.c (General_options::finalize): Add check for -static and
  13523. -shared.
  13524. * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
  13525. is not empty.
  13526. 2008-10-02 Cary Coutant <ccoutant@google.com>
  13527. * plugin.cc (make_sized_plugin_object): Fix conditional
  13528. compilation to work when not all targets are enabled.
  13529. 2008-09-29 Cary Coutant <ccoutant@google.com>
  13530. * archive.cc (Archive::get_file_and_offset): Use filename instead
  13531. of name to get library path.
  13532. (Archive::include_member): Unlock external member of a thin archive.
  13533. * testsuite/Makefile.am (TEST_AR): New variable.
  13534. (thin_archive_test_1): New test.
  13535. (thin_archive_test_2): New test.
  13536. * testsuite/Makefile.in: Regenerate.
  13537. * testsuite/thin_archive_main.cc: New file.
  13538. * testsuite/thin_archive_test_1.cc: New file.
  13539. * testsuite/thin_archive_test_2.cc: New file.
  13540. * testsuite/thin_archive_test_3.cc: New file.
  13541. * testsuite/thin_archive_test_4.cc: New file.
  13542. 2008-09-29 Cary Coutant <ccoutant@google.com>
  13543. * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
  13544. * object.cc (Sized_relobj::do_layout): Use constant invalid_address
  13545. instead of -1U.
  13546. (Sized_relobj::do_finalize_local_symbols): Likewise.
  13547. (Sized_relobj::map_to_kept_section): Likewise.
  13548. * object.h (Sized_relobj::invalid_address): New constant.
  13549. (Sized_relobj::do_output_section_offset): Check for invalid_address
  13550. and return -1ULL.
  13551. * output.cc (Output_reloc::local_section_offset): Use constant
  13552. invalid_address instead of -1U.
  13553. (Output_reloc::get_address): Likewise.
  13554. (Output_section::output_address): Change -1U to -1ULL.
  13555. * output.h (Output_reloc::invalid_address): New constant.
  13556. * reloc.cc (Sized_relobj::write_sections): Use constant
  13557. invalid_address instead of -1U.
  13558. (Sized_relobj::relocate_sections): Likewise.
  13559. * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
  13560. values for merge sections.
  13561. * target-reloc.h (relocate_for_relocatable): Use constant
  13562. invalid_address instead of -1U.
  13563. 2008-09-19 Cary Coutant <ccoutant@google.com>
  13564. Add plugin functionality for link-time optimization (LTO).
  13565. * configure.ac (plugins): Add --enable-plugins option.
  13566. * configure: Regenerate.
  13567. * config.in: Regenerate.
  13568. * Makefile.am (LIBDL): New variable.
  13569. (CCFILES): Add plugin.cc.
  13570. (HFILES): Add plugin.h.
  13571. (ldadd_var): Add LIBDL.
  13572. * Makefile.in: Regenerate.
  13573. * archive.cc: Include "plugin.h".
  13574. (Archive::setup): Don't preread archive symbols when using a plugin.
  13575. (Archive::get_file_and_offset): Add memsize parameter. Change callers.
  13576. (Archive::get_elf_object_for_member): Call plugin hooks for claiming
  13577. files.
  13578. (Archive::include_member): Add symbols from plugin objects.
  13579. * archive.h (Archive::get_file_and_offset): Add memsize parameter.
  13580. * descriptors.cc (Descriptors::open): Check for file descriptors
  13581. abandoned by plugins.
  13582. (Descriptors::claim_for_plugin): New function.
  13583. * descriptors.h (Descriptors::claim_for_plugin): New function.
  13584. (Open_descriptor::is_claimed): New field.
  13585. (claim_descriptor_for_plugin): New function.
  13586. * fileread.cc (File_read::claim_for_plugin): New function.
  13587. * fileread.h (File_read::claim_for_plugin): New function.
  13588. (File_read::descriptor): New function.
  13589. * gold.cc: Include "plugin.h".
  13590. (queue_initial_tasks): Add task to call plugin hooks for generating
  13591. new object files.
  13592. * main.cc: Include "plugin.h".
  13593. (main): Load plugin libraries.
  13594. * object.h (Pluginobj): Declare.
  13595. (Object::pluginobj): New function.
  13596. (Object::do_pluginobj): New function.
  13597. (Object::set_target): New function.
  13598. * options.cc: Include "plugin.h".
  13599. (General_options::parse_plugin): New function.
  13600. (General_options::General_options): Initialize plugins_ field.
  13601. (General_options::add_plugin): New function.
  13602. * options.h (Plugin_manager): Declare.
  13603. (General_options): Add --plugin option.
  13604. (General_options::has_plugins): New function.
  13605. (General_options::plugins): New function.
  13606. (General_options::add_plugin): New function.
  13607. (General_options::plugins_): New field.
  13608. * plugin.cc: New file.
  13609. * plugin.h: New file.
  13610. * readsyms.cc: Include "plugin.h".
  13611. (Read_symbols::do_read_symbols): Check for archive before checking
  13612. for ELF file. Call plugin hooks to claim files.
  13613. * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
  13614. from a real object file; force override when processing replacement
  13615. files.
  13616. * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
  13617. (Symbol::init_base_object): Likewise.
  13618. (Symbol::init_base_output_data): Likewise.
  13619. (Symbol::init_base_output_segment): Likewise.
  13620. (Symbol::init_base_constant): Likewise.
  13621. (Symbol::init_base_undefined): Likewise.
  13622. (Symbol::output_section): Assert that object is not a plugin.
  13623. (Symbol_table::add_from_pluginobj): New function.
  13624. (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
  13625. undefined.
  13626. (Symbol_table::sized_write_globals): Likewise.
  13627. (Symbol_table::add_from_pluginobj): Instantiate template.
  13628. * symtab.h (Sized_pluginobj): Declare.
  13629. (Symbol::in_real_elf): New function.
  13630. (Symbol::set_in_real_elf): New function.
  13631. (Symbol::in_real_elf_): New field.
  13632. (Symbol_table::add_from_pluginobj): New function.
  13633. * testsuite/Makefile.am (AM_CFLAGS): New variable.
  13634. (LIBDL): New variable.
  13635. (LDADD): Add LIBDL.
  13636. (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
  13637. (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
  13638. (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
  13639. (MOSTLYCLEANFILES): Likewise.
  13640. * testsuite/Makefile.in: Regenerate.
  13641. * testsuite/plugin_test.c: New file.
  13642. * testsuite/plugin_test_1.sh: New file.
  13643. * testsuite/plugin_test_2.sh: New file.
  13644. 2008-09-16 Ian Lance Taylor <iant@google.com>
  13645. * target-reloc.h (relocate_section): Check whether a symbol is
  13646. defined by the ABI before reporting an undefined symbol error.
  13647. * target.h (Target::is_defined_by_abi): Make parameter const.
  13648. (Target::do_is_defined_by_abi): Likewise.
  13649. * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
  13650. * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
  13651. * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
  13652. * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
  13653. * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
  13654. * testsuite/Makefile.in: Rebuild.
  13655. * fileread.cc (make_view): Add casts to avoid warning.
  13656. 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
  13657. * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
  13658. * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
  13659. 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
  13660. * options.h (General_options::output_is_executable): New.
  13661. (General_options::output_is_pie): New.
  13662. * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
  13663. for shared libraries.
  13664. * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
  13665. 2008-09-11 Chris Demetriou <cgd@google.com>
  13666. * options.h (origin): New -z option.
  13667. * layout.cc (Layout:finish_dynamic_section): If "-z origin"
  13668. is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
  13669. in DT_FLAGS_1.
  13670. 2008-09-05 Cary Coutant <ccoutant@google.com>
  13671. * fileread.cc (File_read::make_view): Add check for attempt to map
  13672. beyond end of file.
  13673. 2008-09-05 Cary Coutant <ccoutant@google.com>
  13674. * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
  13675. explicit instantiations.
  13676. 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
  13677. PR gold/6858
  13678. * options.cc (General_options::finalize): Allow undefined symbols
  13679. in shlibs if linking -shared.
  13680. PR gold/6859
  13681. * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
  13682. symbols as not needing a dynsym entry.
  13683. 2008-08-20 Craig Silverstein <csilvers@google.com>
  13684. * fileread.cc (File_read::open): Do not lock the file unless it
  13685. was successfully opened.
  13686. 2008-08-14 Cary Coutant <ccoutant@google.com>
  13687. * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
  13688. Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
  13689. * testsuite/tls_test.cc (struct int128): 128-bit struct
  13690. for testing TLS relocs with non-zero addend.
  13691. (v12): New TLS variable.
  13692. (t12): New test.
  13693. (t_last): Add check for v12.
  13694. * testsuite/tls_test.h (t12): New function.
  13695. * testsuite/tls_test_main.cc (thread_routine): Call new test.
  13696. 2008-08-13 Ian Lance Taylor <iant@google.com>
  13697. * layout.cc (Layout::attach_allocated_section_to_segment): Don't
  13698. set tls_segment_ or relro_segment_.
  13699. (Layout::make_output_segment): Set tls_segment_ and relro_segment_
  13700. when appropriate.
  13701. * output.h (Output_section::clear_is_relro): New function.
  13702. * output.cc (Output_segment::add_output_section): Handle SHF_TLS
  13703. sections specially even when output_data_ is empty.
  13704. (Output_segment::maximum_alignment): When first section is relro,
  13705. only force alignment for PT_LOAD segments.
  13706. * script.cc (script_data_segment_align): New function.
  13707. (script_data_segment_relro_end): New function.
  13708. * script-c.h (script_data_segment_align): Declare.
  13709. (script_data_segment_relro_end): Declare.
  13710. * script-sections.h (class Script_sections): Declare
  13711. data_segment_align and data_segment_relro_end. Add fields
  13712. segment_align_index_ and saw_relro_end_.
  13713. * script-sections.cc (class Sections_element): Add set_is_relro
  13714. virtual function. Add new bool* parameter to place_orphan_here.
  13715. Add get_output_section virtual function.
  13716. (class Output_section_definition): Add set_is_relro. Add new
  13717. bool* parameter to place_orphan_here. Add get_output_section.
  13718. Add is_relro_ field.
  13719. (Output_section_definition::Output_section_definition): Initialize
  13720. evaluated_address_, evaluated_load_address, evaluated_addralign_,
  13721. and is_relro_ fields.
  13722. (Output_section_definition::place_orphan_here): Add is_relro
  13723. parameter.
  13724. (Output_section_definition::set_section_addresses): Set relro for
  13725. output section.
  13726. (Output_section_definition::alternate_constraint): Likewise.
  13727. (class Orphan_output_section): Add new bool* parameter to
  13728. place_orphan_here. Add get_output_section.
  13729. (Orphan_output_section::place_orphan_here): Add is_relro
  13730. parameter.
  13731. (Script_sections::Script_sections): Initialize
  13732. data_segment_align_index_ and saw_relro_end_.
  13733. (Script_sections::data_segment_align): New function.
  13734. (Script_sections::data_segment_relro_end): New function.
  13735. (Script_sections::place_orphan): Set or clear is_relro.
  13736. (Script_sections::set_section_addresses): Force alignment of first
  13737. TLS section.
  13738. * yyscript.y (exp): Call script_data_segment_align and
  13739. script_data_segment_relro_end.
  13740. * testsuite/relro_script_test.t: New file.
  13741. * testsuite/relro_test.cc (using_script): Declare.
  13742. (t1, t2): Test using_script.
  13743. * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
  13744. (relro_script_test_SOURCES): Define.
  13745. (relro_script_test_DEPENDENCIES): Define.
  13746. (relro_script_test_LDFLAGS): Define.
  13747. (relro_script_test_LDADD): Define.
  13748. (relro_script_test.so): New target.
  13749. * testsuite/Makefile.in: Rebuild.
  13750. 2008-08-06 Cary Coutant <ccoutant@google.com>
  13751. * archive.cc (Archive::total_archives, Archive::total_members)
  13752. (Archive::total_members_loaded): New variables.
  13753. (Archive::setup): Add parameter. Add option to preread
  13754. archive symbols.
  13755. (Archive::read_armap): Add counter.
  13756. (Archive::get_file_and_offset): New function.
  13757. (Archive::get_elf_object_for_member): New function.
  13758. (Archive::read_all_symbols): New function.
  13759. (Archive::read_symbols): New function.
  13760. (Archive::add_symbols): Add counters.
  13761. (Archive::include_all_members): Use armap to find members if it's
  13762. already built.
  13763. (Archive::include_member): Skip reading symbols if already read.
  13764. Factored code into Archive::get_file_and_offset and
  13765. Archive::get_elf_object_for_member. Changed call to
  13766. Mapfile::report_include_archive_member.
  13767. (Archive::print_stats): New function.
  13768. * archive.h: Declare Object and Read_symbols_data classes.
  13769. (Archive::Archive): Add initializers for new members.
  13770. (Archive::setup): Add parameter.
  13771. (Archive::print_stats): New function.
  13772. (Archive::total_archives, Archive::total_members)
  13773. (Archive::total_members_loaded): New variables.
  13774. (Archive::get_file_and_offset): New function.
  13775. (Archive::get_elf_object_for_member): New function.
  13776. (Archive::read_all_symbols): New function.
  13777. (Archive::read_symbols): New function.
  13778. (Archive::Archive_member): New class.
  13779. (Archive::members_): New member.
  13780. (Archive::num_members_): New member.
  13781. * main.cc: Include archive.h.
  13782. (main): Call Archive::print_stats.
  13783. * mapfile.cc (Mapfile::report_include_archive_member): Delete
  13784. archive parameter; member_name is now the fully-decorated name.
  13785. * mapfile.h (Mapfile::report_include_archive_member): Likewise.
  13786. * options.h: (General_options): Add --preread-archive-symbols option.
  13787. * readsyms.cc (Read_symbols::do_read_symbols): Change call to
  13788. Archive::setup.
  13789. 2008-08-04 Ian Lance Taylor <iant@google.com>
  13790. * symtab.h (Symbol::use_plt_offset): New function.
  13791. * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
  13792. * powerpc.cc (Relocate::relocate): Likewise.
  13793. * sparc.cc (Relocate::relocate): Likewise.
  13794. * x86_64.cc (Relocate::relocate): Likewise.
  13795. * testsuite/weak_plt.sh: New test.
  13796. * testsuite/weak_plt_main.cc: New test.
  13797. * testsuite/weak_plt_shared.cc: New test.
  13798. * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
  13799. (check_PROGRAMS): Add weak_plt.
  13800. (check_DATA): Add weak_plt_shared.so.
  13801. (weak_plt_main_pic.o, weak_plt): New targets.
  13802. (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
  13803. * testsuite/Makefile.in: Rebuild.
  13804. * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
  13805. gcctestdir/ld.
  13806. (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
  13807. * testsuite/Makefile.in: Rebuild.
  13808. 2008-08-04 Alan Modra <amodra@bigpond.net.au>
  13809. * Makefile.am (POTFILES.in): Set LC_ALL=C.
  13810. * Makefile.in: Regenerate.
  13811. * po/POTFILES.in: Regenerate.
  13812. 2008-07-29 Ian Lance Taylor <iant@google.com>
  13813. * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
  13814. symbols before other symbols.
  13815. * testsuite/script_test_2.cc (test_addr): Declare.
  13816. (test_addr_alias): Declare.
  13817. (main): Check that test_addr and test_addr_alias have the right
  13818. values.
  13819. * testsuite/script_test_2.t: Define test_addr_alias and
  13820. test_addr.
  13821. 2008-07-24 Ian Lance Taylor <iant@google.com>
  13822. PR 5990
  13823. * descriptors.cc: New file.
  13824. * descriptors.h: New file.
  13825. * gold-threads.h (class Hold_optional_lock): New class.
  13826. * fileread.cc: Include "descriptors.h".
  13827. (File_read::~File_read): Release descriptor rather than closing
  13828. it.
  13829. (File_read::open) [file]: Call open_descriptor rather than open.
  13830. Set is_descriptor_opened_.
  13831. (File_read::open) [memory]: Assert that descriptor is not open.
  13832. (File_read::reopen_descriptor): New function.
  13833. (File_read::release): Release descriptor.
  13834. (File_read::do_read): Make non-const. Reopen descriptor.
  13835. (File_read::read): Make non-const.
  13836. (File_read::make_view): Reopen descriptor.
  13837. (File_read::do_readv): Likewise.
  13838. * fileread.h (class File_read): Add is_descriptor_opened_ field.
  13839. Update declarations.
  13840. * layout.cc: Include "descriptors.h".
  13841. (Layout::create_build_id): Use open_descriptor rather than open.
  13842. * output.cc: Include "descriptors.h".
  13843. (Output_file::open): Use open_descriptor rather than open.
  13844. * archive.cc (Archive::const_iterator): Change Archive to be
  13845. non-const.
  13846. (Archive::begin, Archive::end): Make non-const.
  13847. (Archive::count_members): Likewise.
  13848. * archive.h (class Archive): Update declarations.
  13849. * object.h (Object::read): Make non-const.
  13850. * Makefile.am (CCFILES): Add descriptors.cc.
  13851. (HFILES): Add descriptors.h.
  13852. * Makefile.in: Rebuild.
  13853. PR 6716
  13854. * gold.h: Always include <clocale>. Add Solaris workarounds
  13855. following code in binutils/sysdep.h.
  13856. PR 6048
  13857. * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
  13858. this->eh_frame_hdr_ is NULL before using it.
  13859. * dynobj.cc (Versions::Versions): Update comment.
  13860. * dynobj.cc (Versions::Versions): If there is an soname, use it as
  13861. the base version name.
  13862. * stringpool.cc (Stringpool_template::add_with_length): Set key to
  13863. array size plus one.
  13864. (Stringpool_template::set_string_offsets): Subtract one from key
  13865. before using it as an array index.
  13866. (Stringpool_template::get_offset_with_length): Likewise.
  13867. (Stringpool_template::write_to_buffer): Likewise.
  13868. * stringpool.h (Stringpool_template::get_offset_from_key):
  13869. Likewise.
  13870. 2008-07-23 Ian Lance Taylor <iant@google.com>
  13871. PR 6658
  13872. * object.h (Merged_symbol_value::value): Do our best to handle a
  13873. negative addend.
  13874. PR 6647
  13875. * script.cc (Version_script_info::get_versions): Don't add empty
  13876. version tag to return value.
  13877. (Version_script_info::get_symbol_version_helper): Change return
  13878. type to bool. Add pversion parameter. Change all callers.
  13879. (script_register_vers_node): Don't require a non-NULL tag.
  13880. * script.h (class Version_script_info): Update declarations.
  13881. (Version_script_info::get_symbol_version): Change return type to
  13882. bool. Add version parameter. Change all callers.
  13883. * symtab.cc (Sized_symbol::add_from_relobj): Rework version
  13884. handling. Handle an empty version from a version script.
  13885. (Symbol_table::define_special_symbol): Likewise.
  13886. * testsuite/ver_test_10.script: New file.
  13887. * testsuite/ver_test_10.sh: New file.
  13888. * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
  13889. (check_DATA): Add ver_test_10.syms.
  13890. (ver_test_10.syms, ver_test_10.so): New target.
  13891. * testsuite/Makefile.in: Rebuild.
  13892. 2008-07-23 Simon Baldwin <simonb@google.com>
  13893. * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
  13894. to zero for undefined symbols from dynamic libraries.
  13895. 2008-07-23 Ian Lance Taylor <iant@google.com>
  13896. * symtab.cc (Symbol_table::resolve): Remove version parameter.
  13897. Change all callers.
  13898. * symtab.h (class Symbol_table): Update declaration.
  13899. * testsuite/ver_test_9.cc: New file.
  13900. * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
  13901. (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
  13902. (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
  13903. (ver_test_9.so, ver_test_9.o): New targets.
  13904. * testsuite/Makefile.in: Rebuild.
  13905. 2008-07-22 Ian Lance Taylor <iant@google.com>
  13906. * options.h (class General_options): Define --check-sections.
  13907. * layout.cc (Layout::set_segment_offsets): Handle
  13908. --check-sections.
  13909. * options.h (class General_options): Define -n/--nmagic and
  13910. -N/--omagic.
  13911. * options.cc (General_options::finalize): For -n/--nmagic or
  13912. -N/--omagic, set -static.
  13913. * layout.cc (Layout::attach_allocated_section_to_segment): If
  13914. -N/--omagic, don't put read-only and read-write sections in
  13915. different segments.
  13916. (Layout::find_first_load_seg): If -N/--omagic, don't insist on
  13917. finding a read-only segment.
  13918. (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
  13919. don't set the minimum segment alignment to the common page size,
  13920. and don't set the file offset to the address modulo the page size.
  13921. * script-sections.cc (Script_sections::create_segments): If
  13922. -n/--omagic, don't put read-only and read-write sections in
  13923. different segments.
  13924. * cref.cc: New file.
  13925. * cref.h: New file.
  13926. * options.h (class General_options): Add --print-symbol-counts.
  13927. * main.cc (main): Issue defined symbol report if requested.
  13928. * archive.cc (Archive::interpret_header): Make into a const member
  13929. function.
  13930. (Archive::add_symbols): Call Input_objects::archive_start and
  13931. archive_stop.
  13932. (Archive::const_iterator): Define new class.
  13933. (Archive::begin, Archive::end): New functions.
  13934. (Archive::include_all_members): Rewrite to use iterator.
  13935. (Archive::count_members): New function.
  13936. * archive.h (class Archive): Update declarations.
  13937. (Archive::filename): New function.
  13938. * object.cc: Include "cref.h".
  13939. (Sized_relobj::Sized_relobj): Initialize defined_count_.
  13940. (Sized_relobj::do_get_global_symbol_counts): New function.
  13941. (Input_objects::add_object): Add object to cross-referencer.
  13942. (Input_objects::archive_start): New function.
  13943. (Input_objects::archive_stop): New function.
  13944. (Input_objects::print_symbol_counts): New function.
  13945. * object.h: Declare Cref and Archive.
  13946. (Object::get_global_symbol_counts): New function.
  13947. (Object::do_get_global_symbol_counts): New pure virtual function.
  13948. (class Sized_relobj): Add defined_count_ field. Update
  13949. declarations.
  13950. (class Input_objects): Add cref_ field. Update constructor.
  13951. Update declarations.
  13952. * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
  13953. defined_count_.
  13954. (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
  13955. symbol counts.
  13956. (Sized_dynobj::do_get_global_symbol_counts): New function.
  13957. * dynobj.h (class Sized_dynobj): Add fields symbols_ and
  13958. defined_count_. Update declarations. Define Symbols typedef.
  13959. * symtab.cc (Symbol_table::add_from_relobj): Add defined
  13960. parameter. Change all callers.
  13961. (Symbol_table::add_from_dynobj): Add sympointers and defined
  13962. parameters. Change all callers.
  13963. * symtab.h (class Symbol_table): Update declarations.
  13964. * Makefile.am (CCFILES): Add cref.cc.
  13965. (HFILES): Add cref.h.
  13966. * Makefile.in: Rebuild.
  13967. 2008-07-22 Simon Baldwin <simonb@google.com>
  13968. * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
  13969. to zero when writing undefined symbols.
  13970. 2008-07-22 Ian Lance Taylor <iant@google.com>
  13971. * output.cc (Output_section::add_input_section): Don't try to
  13972. merge empty merge sections.
  13973. 2008-07-21 Craig Silverstein <csilvers@google.com>
  13974. * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
  13975. Include symbol version in error message.
  13976. 2008-07-20 Chris Demetriou <cgd@google.com>
  13977. * configure.ac (gold_cv_c_random_seed): New configured variable.
  13978. (RANDOM_SEED_CFLAGS): New substituted variable.
  13979. * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
  13980. * configure: Rebuild.
  13981. * Makefile.in: Likewise.
  13982. * testsuite/Makefile.in: Likewise.
  13983. 2008-07-18 Ian Lance Taylor <iant@google.com>
  13984. * symtab.cc (Symbol_table::add_from_object): Rewrite the case
  13985. where we see NAME/NULL and NAME/VERSION as separate symbols.
  13986. * testsuite/ver_test_main.cc (main): Call t4.
  13987. (t4, t4_2a): Define.
  13988. * testsuite/ver_test_2.cc (t4_2): Define.
  13989. * testsuite/ver_test_2.script: Put t4_2a in VER2.
  13990. * testsuite/ver_test_4.cc (t4_2a): Define.
  13991. * testsuite/ver_test_4.script: Put t4_2a in VER2.
  13992. * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
  13993. 2008-07-17 Ian Lance Taylor <iant@google.com>
  13994. * dynobj.cc (Versions::add_def): If we give an error about a
  13995. missing version, go ahead and create the version anyhow.
  13996. 2008-07-10 Ian Lance Taylor <iant@google.com>
  13997. Handle output sections with more than 0x7fffffff bytes.
  13998. * object.h (class Relobj): Change map_to_output_ to
  13999. output_sections_, and just keep a section pointer. Change all
  14000. uses. Move comdat group support to Sized_relobj.
  14001. (Relobj::is_section_specially_mapped): Remove.
  14002. (Relobj::output_section): Remove poff parameter. Change all
  14003. callers.
  14004. (Relobj::output_section_offset): New function.
  14005. (Relobj::set_section_offset): Rewrite.
  14006. (Relobj::map_to_output): Remove.
  14007. (Relobj::output_sections): New function.
  14008. (Relobj::do_output_section_offset): New pure virtual function.
  14009. (Relobj::do_set_section_offset): Likewise.
  14010. (class Sized_relobj): Add section_offsets_ field. Add comdat
  14011. group support from Relobj. Update declarations.
  14012. (Sized_relobj::get_output_section_offset): New function.
  14013. (Sized_relobj::do_output_section_offset): New function.
  14014. (Sized_relobj::do_set_section_offset): New function.
  14015. * object.cc (Relobj::output_section_address): Remove.
  14016. (Sized_relobj::Sized_relobj): Initialize new fields.
  14017. (Sized_relobj::include_section_group): Cast find_kept_object to
  14018. Sized_relobj.
  14019. (Sized_relobj::include_linkonce_section): Likewise.
  14020. (Sized_relobj::do_layout): Use separate arrays for output section
  14021. and output offset.
  14022. (Sized_relobj::do_count_local_symbols): Change map_to_output to
  14023. output_sections.
  14024. (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
  14025. output_sections and section_offsets.
  14026. (Sized_relobj::write_local_symbols): Likewise.
  14027. (map_to_kept_section): Compute output address directly.
  14028. * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
  14029. output_sections and section_offsets.
  14030. (Sized_relobj::write_sections): Likewise.
  14031. (Sized_relobj::relocate_sections): Likewise.
  14032. * symtab.cc (sized_finalize_symbol): Use output_section_offset.
  14033. * output.h (class Output_reloc): Update declarations. Change
  14034. u2_.relobj to Sized_relobj*.
  14035. (class Output_data_reloc): Change add functions to use
  14036. Sized_relobj*.
  14037. * output.cc (Output_reloc::Output_reloc): Change relobj to
  14038. Sized_relobj*.
  14039. (Output_reloc::local_section_offset): Change return type to
  14040. Elf_Addr. Use get_output_section_offset.
  14041. (Output_reloc::get_address): Likewise.
  14042. (Output_section::is_input_address_mapped): Don't call
  14043. is_section_specially_mapped.
  14044. (Output_section::output_offset): Likewise.
  14045. (Output_section::output_address): Likewise.
  14046. (Output_section::starting_output_address): Likewise.
  14047. * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
  14048. parameter to Sized_relobj*.
  14049. (Copy_relocs::need_copy_reloc): Likewise.
  14050. (Copy_relocs::save): Likewise.
  14051. * copy-relocs.h (class Copy_relocs): Update declarations.
  14052. (class Copy_relocs::Copy_reloc_entry): Change constructor to use
  14053. Sized_relobj*. Change relobj_ field to Sized_relobj*.
  14054. * target-reloc.h (relocate_for_relocatable): Change
  14055. offset_in_output_section type to Elf_Addr. Change code that uses
  14056. it as well.
  14057. * layout.cc (Layout::layout): Always set *off.
  14058. * mapfile.cc (Mapfile::print_input_section): Use
  14059. output_section_offset.
  14060. * i386.cc (Target_i386::copy_reloc): Change object parameter to
  14061. Sized_relobj*.
  14062. * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
  14063. * sparc.cc (Target_sparc::copy_reloc): Likewise.
  14064. * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
  14065. 2008-07-03 Ian Lance Taylor <iant@google.com>
  14066. * layout.cc (Layout::include_section): Do not discard unrecognized
  14067. SHT_STRTAB sections.
  14068. 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
  14069. * script.cc (Lex::can_continue_name): Make '?' allowable in
  14070. version-script names.
  14071. * testsuite/version_script.map: Change glob pattern to use '?'
  14072. 2008-06-30 Manish Singh <yosh@gimp.org>
  14073. PR 6585
  14074. * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
  14075. Correct typo.
  14076. 2008-06-30 Ian Lance Taylor <iant@google.com>
  14077. PR 6660
  14078. PR 6682
  14079. * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
  14080. versions]: Don't try to read the value in the contents, since we
  14081. don't use it. Use the template endianness when writing.
  14082. 2008-06-25 Cary Coutant <ccoutant@google.com>
  14083. * fileread.cc (File_read::make_view): Assert on zero-length view.
  14084. * object.cc (Sized_relobj::do_read_symbols): Don't try to read
  14085. symbol table when there are no symbols to read.
  14086. 2008-06-23 Craig Silverstein <csilvers@google.com>
  14087. * version.cc (version_string): Bump to 1.7
  14088. 2008-06-18 Craig Silverstein <csilvers@google.com>
  14089. * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
  14090. constant 0xFFFF to type Valtype.
  14091. (Powerpc_relocate_functions::rel16_ha): Likewise.
  14092. 2008-06-17 Ian Lance Taylor <iant@google.com>
  14093. * output.h (Output_section::Input_section): Initialize p2align_ to
  14094. zero for Output_section_data constructors.
  14095. (Output_section::Input_section::addralign): If not an input
  14096. section, return the alignment of the Output_section_data.
  14097. * testsuite/copy_test.cc: New file.
  14098. * testsuite/copy_test_1.cc: New file.
  14099. * testsuite/copy_test_2.cc: New file.
  14100. * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
  14101. (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
  14102. (copy_test_LDFLAGS, copy_test_LDADD): New variables.
  14103. (copy_test_1_pic.o, copy_test_1.so): New targets.
  14104. (copy_test_2_pic.o, copy_test_2.so): New targets.
  14105. * testsuite/Makefile.in: Rebuild.
  14106. * script-sections.cc (Script_sections::place_orphan): Initialize
  14107. local variable exact.
  14108. 2008-06-13 David Edelsohn <edelsohn@gnu.org>
  14109. * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
  14110. 2008-06-12 David Edelsohn <edelsohn@gnu.org>
  14111. David S. Miller <davem@davemloft.net>
  14112. * powerpc.cc: New file.
  14113. * Makefile.am (TARGETSOURCES): Add powerpc.cc
  14114. (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
  14115. * configure.tgt: Add entries for powerpc-* and powerpc64-*.
  14116. * Makefile.in: Rebuild.
  14117. 2008-06-09 Ian Lance Taylor <iant@google.com>
  14118. * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
  14119. <exception>.
  14120. (throwing, orig_terminate): New static variables.
  14121. (terminate_handler): New static function.
  14122. (t2): Set terminate handler.
  14123. 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
  14124. PR 6584
  14125. * binary.cc (Binary_to_elf::sized_convert): Fix .data
  14126. alignment.
  14127. 2008-05-30 Cary Coutant <ccoutant@google.com>
  14128. * archive.cc (Archive::include_all_members) Correct to step
  14129. over symbol table and extended name table in thin archives.
  14130. 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
  14131. PR 6407
  14132. * target-reloc.h (relocate_for_relocatable): Fix new_offset
  14133. calculation.
  14134. 2008-05-28 Caleb Howe <cshowe@google.com>
  14135. * reduced_debug_output.cc: New file.
  14136. * reduced_debug_output.h: New file.
  14137. * options.h (class General_options): Add --strip-debug-non-line.
  14138. * options.cc (General_options::finalize): Add strip_debug_non_line
  14139. to the strip heirarchy.
  14140. * layout.h (class Layout): Add debug_abbrev_ and debug_info_
  14141. fields.
  14142. * layout.cc: Include "reduced_debug_output.h".
  14143. (Layout::Layout): Initialize new fields.
  14144. (line_only_debug_sections): New static array.
  14145. (is_lines_only_debug_sections): New static inline function.
  14146. (Layout::include_section): Handle --strip-debug-non-line.
  14147. (Layout::make_output_section): If --strip-debug-non-line, build
  14148. new output sections for .debug_abbrev and .debug_info.
  14149. * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
  14150. gold. Warn about possible overflow.
  14151. (read_signed_LEB_128): Likewise.
  14152. * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
  14153. (read_signed_LEB_128): Declare.
  14154. * Makefile.am (CCFILES): Add reduced_debug_output.cc.
  14155. (HFILES): Add reduced_debug_output.h.
  14156. * Makefile.in: Rebuild.
  14157. 2008-05-21 Ian Lance Taylor <iant@google.com>
  14158. * mapfile.cc: New file.
  14159. * mapfile.h: New file.
  14160. * options.h (class General_options): Add -M/--print-map and -Map.
  14161. * options.cc (General_options::finalize): Make -M equivalent to
  14162. -Map -.
  14163. * main.cc: Include <cstdio> and "mapfile.h".
  14164. (main): Open mapfile if requested.
  14165. * gold.cc (class Middle_runner): Add mapfile_ field. Update
  14166. constructor. Change caller.
  14167. (queue_initial_tasks): Add mapfile parameter. Change caller.
  14168. (queue_middle_tasks): Likewise.
  14169. * gold.h (queue_initial_tasks, queue_middle_tasks): Update
  14170. declarations.
  14171. * archive.cc: Include "mapfile.h".
  14172. (Archive::add_symbols): Add mapfile parameter. Change all
  14173. callers. Pass mapfile, symbol, and reason to include_member.
  14174. (Archive::include_all_members): Add mapfile parameter. Change all
  14175. callers.
  14176. (Archive::include_member): Add mapfile, sym, and why parameters.
  14177. Change all callers. Report inclusion to map file.
  14178. * archive.h: Include "fileread.h".
  14179. (class Archive): Update declarations.
  14180. (Archive::file): New const method.
  14181. (class Add_archive_symbols): Add mapfile_ field. Update
  14182. constructor. Change all callers.
  14183. * readsyms.h (class Read_symbols): Likewise.
  14184. (class Finish_group): Likewise.
  14185. (class Read_script): Likewise.
  14186. * common.cc: Include "mapfile.h".
  14187. (Symbol_table::allocate_commons): Add mapfile parameter. Change
  14188. all callers.
  14189. (Symbol_table::do_allocate_commons): Likewise.
  14190. (Symbol_table::do_allocate_commons_list): Likewise. Report common
  14191. symbol allocation to mapfile.
  14192. * common.h (class Allocate_commons_task): Add mapfile_ field.
  14193. Update constructor. Change all callers.
  14194. * symtab.h (class Symbol_table): Update declarations.
  14195. * layout.cc: Include "mapfile.h".
  14196. (Layout_task_runner::run): Print information to mapfile.
  14197. (Layout::create_gold_note): Change Output_data_fixed_space to
  14198. Output_data_zero_fill.
  14199. (Layout::create_build_id): Likewise.
  14200. (Layout::print_to_mapfile): New function.
  14201. * layout.h (class Layout_task_runner): Add mapfile_ field. Update
  14202. constructor. Change caller.
  14203. (class Layout): Declare print_to_mapfile.
  14204. * output.cc (Output_section::Input_section::print_to_mapfile): New
  14205. function.
  14206. (Output_section::add_input_section): If producing a map, always
  14207. add to input_sections_ list.
  14208. (Output_section::do_print_to_mapfile): New function.
  14209. (Output_segment::print_sections_to_mapfile): New function.
  14210. (Output_segment::print_section_list_to_mapfile): New function.
  14211. * output.h: Include "mapfile.h".
  14212. (Output_data::print_to_mapfile): New function.
  14213. (Output_data::do_print_to_mapfile): New virtual function.
  14214. (Output_segment_headers::do_print_to_mapfile): New function.
  14215. (Output_file_header::do_print_to_mapfile): New function.
  14216. (Output_data_const::do_print_to_mapfile): New function.
  14217. (class Output_data_const_buffer): Add map_name_ field. Update
  14218. constructor. Change all callers. Add do_print_to_mapfile
  14219. function.
  14220. (class Output_data_fixed_space): Likewise.
  14221. (class Output_data_space): Likewise.
  14222. (class Output_data_zero_fill): New class.
  14223. (Output_data_strtab::do_print_to_mapfile): New function.
  14224. (Output_data_reloc_base::do_print_to_mapfile): New function.
  14225. (Output_relocatable_relocs::do_print_to_mapfile): New function.
  14226. (Output_data_group::do_print_to_mapfile): New function.
  14227. (Output_data_got::do_print_to_mapfile): New function.
  14228. (Output_data_dynamic::do_print_to_mapfile): New function.
  14229. (Output_symtab_xindex::do_print_to_mapfile): New function.
  14230. (class Output_section): Declare do_print_to_mapflie. Declare
  14231. print_to_mapfile in Input_section.
  14232. (class Output_segment): Declare new functions.
  14233. * object.h (Sized_relobj::symbol_count): New function.
  14234. * script-sections.cc
  14235. (Output_section_element_dot_assignment::set_section_addresses):
  14236. Change Output_data_fixed_space to Output_data_zero_fill.
  14237. (Output_data_expression::do_print_to_mapfile): New function.
  14238. * script.cc (read_input_script): Add mapfile parameter. Change
  14239. all callers.
  14240. * script.h (read_input_script): Update declaration.
  14241. * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
  14242. (Eh_frame::do_print_to_mapfile): New function.
  14243. * merge.h (Output_merge_data::do_print_to_mapfile): New function.
  14244. (Output_merge_string::do_print_to_mapfile): New function.
  14245. * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
  14246. function.
  14247. * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
  14248. function.
  14249. * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
  14250. function.
  14251. * Makefile.am (CCFILES): Add mapfile.cc.
  14252. (HFILES): Add mapfile.h.
  14253. * Makefile.in: Rebuild.
  14254. 2008-05-19 Ian Lance Taylor <iant@google.com>
  14255. * options.h (class General_options): Add -z relro.
  14256. * layout.cc (Layout::Layout): Initialize relro_segment_.
  14257. (Layout::add_output_section_data): Return the output section.
  14258. (Layout::make_output_section): Rcognize relro sections and mark
  14259. them appropriately.
  14260. (Layout::attach_allocated_section_to_segment): Put relro sections
  14261. in a PT_GNU_RELRO segment.
  14262. (Layout::create_initial_dynamic_sections): Mark the .dynamic
  14263. section as relro.
  14264. (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
  14265. PT_TLS segments.
  14266. (Layout::linkonce_mapping): Map d.rel.ro.local to
  14267. .data.rel.ro.local.
  14268. (Layout::output_section_name): Us .data.rel.ro.local for any
  14269. section which begins with that.
  14270. * layout.h (class Layout): Update add_output_section_data
  14271. declaration. Add relro_segment_ field.
  14272. * output.cc (Output_section::Output_section): Initialize is_relro_
  14273. and is_relro_local_ fields.
  14274. (Output_segment::add_output_section): Group relro sections.
  14275. (Output_segment::is_first_section_relro): New function.
  14276. (Output_segment::maximum_alignment): If there is a relro section,
  14277. align the segment to the common page size.
  14278. (Output_segment::set_section_addresses): Track whether we are
  14279. looking at relro sections. If the last section is a relro
  14280. section, align to the common page size.
  14281. (Output_segment::set_section_list_addresses): Add in_relro
  14282. parameter. Change all callers. Align to the page size when
  14283. moving from relro to non-relro section.
  14284. (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
  14285. segment.
  14286. * output.h (class Output_section): Add is_relro_ and
  14287. is_relro_local_ fields.
  14288. (Output_section::is_relro): New function.
  14289. (Output_section::set_is_relro): New function.
  14290. (Output_section::is_relro_local): New function.
  14291. (Output_section::set_is_relro_local): New function.
  14292. (class Output_segment): Update declarations.
  14293. * i386.cc (Target_i386::got_section): Mark .got section as relro.
  14294. * sparc.cc (Target_sparc::got_section): Likewise.
  14295. * x86_64.cc (Target_x86_64::got_section): Likewise.
  14296. * testsuite/relro_test_main.cc: New file.
  14297. * testsuite/relro_test.cc: New file.
  14298. * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
  14299. (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
  14300. (relro_test_LDFLAGS, relro_test_LDADD): New variables.
  14301. (relro_test.so, relro_test_pic.o): New targets.
  14302. * testsuite/Makefile.in: Rebuild.
  14303. 2008-05-16 Ian Lance Taylor <iant@google.com>
  14304. * output.cc (Output_segment::add_output_section): Remove front
  14305. parameter.
  14306. * output.h (class Output_segment): Remove
  14307. add_initial_output_section and overloaded add_output_section.
  14308. Update declaration of remaining add_output_section.
  14309. * layout.cc (Layout::create_interp): Call add_output_section
  14310. rather than add_initial_output_section.
  14311. (Layout::finish_dynamic_section): Likewise.
  14312. * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
  14313. for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
  14314. know the dynamic type.
  14315. * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
  14316. field. Initialize it in constructor.
  14317. (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
  14318. block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
  14319. Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
  14320. reloc.
  14321. * output.cc (Output_reloc::get_address): Change return type to
  14322. Elf_Addr.
  14323. * output.h (class Output_reloc): Update get_address declaration.
  14324. * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
  14325. for section addresses.
  14326. 2008-05-09 Ian Lance Taylor <iant@google.com>
  14327. PR 6493
  14328. * gold.cc (gold_nomem): Use return value of write.
  14329. 2008-05-08 Ian Lance Taylor <iant@google.com>
  14330. * symtab.c (Symbol::init_base_output_data): Add version
  14331. parameter. Change all callers.
  14332. (Symbol::init_base_output_segment): Likewise.
  14333. (Symbol::init_base_constant): Likewise.
  14334. (Symbol::init_base_undefined): Likewise.
  14335. (Sized_symbol::init_output_data): Likewise.
  14336. (Sized_symbol::init_output_segment): Likewise.
  14337. (Sized_symbol::init_constant): Likewise.
  14338. (Sized_symbol::init_undefined): Likewise.
  14339. (Symbol_table::do_define_in_output_data): If the new symbol has a
  14340. version, mark it as the default.
  14341. (Symbol_table::do_define_in_output_segment): Likewise.
  14342. (Symbol_table::do_define_as_constant): Likewise.
  14343. * symtab.h (class Symbol): Update declarations.
  14344. (class Sized_symbol): Likewise.
  14345. * resolve.cc (Symbol::override_version): New function.
  14346. (Symbol::override_base): Call override_version.
  14347. (Symbol::override_base_with_special): Likewise.
  14348. * testsuite/ver_script_8.script: New file.
  14349. * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
  14350. (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
  14351. (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
  14352. (ver_test_8_1.so, ver_test_8_2.so): New targets.
  14353. 2008-05-06 Ian Lance Taylor <iant@google.com>
  14354. PR 6049
  14355. * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
  14356. functions.
  14357. (class General_options): Remove existing --undefined, and add
  14358. --no-undefined instead. Add new --undefined as synonym for -u.
  14359. * archive.cc (Archive::add_symbols): Check whether symbol was
  14360. named with -u.
  14361. * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
  14362. * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
  14363. all uses. Add IS_UNDEFINED. Update declarations to split
  14364. different versions of init_base. Declare init_base_undefined.
  14365. (Symbol::is_defined): Handle IS_UNDEFINED.
  14366. (Symbol::is_undefined): Likewise.
  14367. (Symbol::is_weak_undefined): Call is_undefined.
  14368. (Symbol::is_absolute): Handle IS_CONSTANT.
  14369. (class Sized_symbol): Update declarations to split different
  14370. versions of init. Declare init_undefined.
  14371. (class Symbol_table): Declare new functions.
  14372. * symtab.cc (Symbol::init_base_object): Rename from init_base.
  14373. Change all callers.
  14374. (Symbol::init_base_output_data): Likewise.
  14375. (Symbol::init_base_output_segment): Likewise.
  14376. (Symbol::init_base_constant): Likewise.
  14377. (Symbol::init_base_undefined): New function.
  14378. (Sized_symbol::init_object): Rename from init. Change all
  14379. callers.
  14380. (Sized_symbol::init_output_data): Likewise.
  14381. (Sized_symbol::init_output_segment): Likewise.
  14382. (Sized_symbol::init_constant): Likewise.
  14383. (Sized_symbol::init_undefined): New function.
  14384. (Symbol_table::add_undefined_symbols_from_command_line): New
  14385. function.
  14386. (Symbol_table::do_add_undefined_symbols_from_command_line): New
  14387. function.
  14388. (Symbol::final_value_is_known): Handle IS_UNDEFINED.
  14389. (Symbol::output_section): Likewise.
  14390. (Symbol::set_output_section): Likewise.
  14391. (Symbol_table::sized_finalize_symbol): Likewise.
  14392. (Symbol_table::sized_write_globals): Likewise.
  14393. * resolve.cc (Symbol_table::should_override): Likewise.
  14394. (Symbol::override_base_with_special): Likewise.
  14395. * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
  14396. symbol, change it to have default visibility.
  14397. * testsuite/protected_1.cc: New file.
  14398. * testsuite/protected_2.cc: New file.
  14399. * testsuite/protected_3.cc: New file.
  14400. * testsuite/protected_main_1.cc: New file.
  14401. * testsuite/protected_main_2.cc: New file.
  14402. * testsuite/protected_main_3.cc: New file.
  14403. * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
  14404. (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
  14405. (protected_1_LDFLAGS, protected_1_LDADD): Define.
  14406. (protected_1.so): New target.
  14407. (protected_1_pic.o, protected_2_pic.o): New targets.
  14408. (protected_3_pic.o): New target.
  14409. (check_PROGRAMS): Add protected_2.
  14410. (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
  14411. (protected_2_LDFLAGS, protected_2_LDADD): Define.
  14412. * testsuite/Makefile.in: Rebuild.
  14413. * options.h (DEFINE_var): Add set_user_set_##varname__.
  14414. (DEFINE_bool_alias): New macro.
  14415. (class General_options): Define -Bstatic using DEFINE_bool_alias
  14416. rather than DEFINE_special. Add --undefined as an alias for -z
  14417. defs.
  14418. * options.cc (General_options::parse_Bstatic): Remove.
  14419. * options.h (class General_options): Add --fatal-warnings.
  14420. * main.cc (main): Implement --fatal-warnings.
  14421. * errors.h (Errors::warning_count): New function.
  14422. * options.h (class General_options): Add -Bsymbolic-functions.
  14423. * symtab.h (Symbol::is_preemptible): Check for
  14424. -Bsymbolic-functions.
  14425. 2008-05-05 Ian Lance Taylor <iant@google.com>
  14426. * options.h (DEFINE_bool): For DASH_Z, create the negative option
  14427. as noVARNAME rather than no-VARNAME.
  14428. (class General_options): Add option -z combreloc.
  14429. * output.h (class Output_reloc) [SHT_REL]: Declare compare and
  14430. get_address.
  14431. (Output_reloc::sort_before) [SHT_REL]: New function.
  14432. (Output_reloc::sort_before) [SHT_RELA]: New function.
  14433. (class Output_data_reloc_base): Add sort_relocs_ field. Define
  14434. Sort_relocs_comparison.
  14435. (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
  14436. parameter. Change all callers.
  14437. (Output_data_reloc::Output_data_reloc) [both versions]: Add
  14438. sort_relocs parameter. Change all callers.
  14439. * output.cc (Output_reloc::get_address): New function, broken out
  14440. of write_rel.
  14441. (Output_reloc::write_rel): Call it.
  14442. (Output_reloc::compare): New function.
  14443. (Output_data_reloc_base::do_write): Optionally sort relocs.
  14444. * configure.ac: If targ_extra_obj is set, link it in.
  14445. * configure.tgt: Initialize all variables.
  14446. (x86_64*): Set targ_extra_obj and targ_extra_size.
  14447. * configure: Rebuild.
  14448. * object.cc (Sized_relobj::include_section_group): Adjust section
  14449. indexes read from group data. Build vector to pass to
  14450. layout_group.
  14451. * layout.cc (Layout::layout_group): Add flags and shndxes
  14452. parameters. Remove contents parameter. Change caller. Update
  14453. explicit instantiations.
  14454. * layout.h (class Layout): Update layout_group declaration.
  14455. * output.cc (Output_data_group::Output_data_group): Add flags and
  14456. input_shndxes parameters. Remove contents parameter. Change
  14457. caller.
  14458. (Output_data_group::do_write): Change input_sections_ to
  14459. input_shndxes_.
  14460. * output.h (class Output_data_group): Update constructor
  14461. declaration. Rename input_sections_ to input_shndxes_.
  14462. * testsuite/many_sections_test.cc: Add template.
  14463. 2008-04-30 Cary Coutant <ccoutant@google.com>
  14464. * target-reloc.h (relocate_section): Fix dead-pointer bug.
  14465. * layout.cc (Layout::include_section): Refactored check for debug
  14466. info section.
  14467. (Layout::add_comdat): Add new parameters. Change type
  14468. of signature parameter. Add object and shndx to signatures table.
  14469. (Layout::find_kept_object): New function.
  14470. * layout.h: Include <cstring>.
  14471. (Layout::is_debug_info_section): New function.
  14472. (Layout::add_comdat): Add new parameters.
  14473. (Layout::find_kept_object): New function.
  14474. (Layout::Kept_section): New struct.
  14475. (Layout::Signatures): Change type of map range.
  14476. * object.cc (Relobj::output_section_address): New function.
  14477. (Sized_relobj::include_section_group): Add new parameters. Change
  14478. calls to Layout::add_comdat. Change to build table of kept comdat
  14479. groups and table mapping discarded sections to kept sections.
  14480. (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
  14481. (Sized_relobj::do_layout): Change calls to include_section_group and
  14482. include_linkonce_section.
  14483. (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
  14484. value to zero when section is discarded.
  14485. (Sized_relobj::map_to_kept_section): New function.
  14486. * object.h (Relobj::output_section_address): New function.
  14487. (Relobj::Comdat_group): New type.
  14488. (Relobj::find_comdat_group): New function.
  14489. (Relobj::Comdat_group_table): New type.
  14490. (Relobj::Kept_comdat_section): New type.
  14491. (Relobj::Kept_comdat_section_table): New type.
  14492. (Relobj::add_comdat_group): New function.
  14493. (Relobj::set_kept_comdat_section): New function.
  14494. (Relobj::get_kept_comdat_section): New function.
  14495. (Relobj::comdat_groups_): New field.
  14496. (Relobj::kept_comdat_sections_): New field.
  14497. (Symbol_value::input_value): Update comment.
  14498. (Sized_relobj::map_to_kept_section) New function.
  14499. (Sized_relobj::include_linkonce_section): Add new parameter.
  14500. * target-reloc.h (Comdat_behavior): New type.
  14501. (get_comdat_behavior): New function.
  14502. (relocate_section): Add code to map a discarded section to the
  14503. corresponding kept section when applying a relocation.
  14504. 2008-04-30 Craig Silverstein <csilvers@google.com>
  14505. * dwarf_reader.cc (next_generation_count): New static var.
  14506. (Addr2line_cache_entry): New struct.
  14507. (addr2line_cache): New static var.
  14508. (Dwarf_line_info::one_addr2line): Added caching.
  14509. (Dwarf_line_info::clear_addr2line_cache): New function.
  14510. * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
  14511. cache-size parameter.
  14512. (Dwarf_line_info::one_addr2line_cache): New function.
  14513. * symtab.cc (Symbol_table::detect_odr_violations): Pass
  14514. new cache-size argument to one_addr2line(), and clear cache.
  14515. 2008-04-28 Cary Coutant <ccoutant@google.com>
  14516. * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
  14517. R_386_PC8 relocations.
  14518. 2008-04-23 Ian Lance Taylor <iant@google.com>
  14519. * object.cc (Sized_relobj::include_section_group): Check for
  14520. invalid section group.
  14521. * object.cc (make_elf_object): Correct test for 64-bit ELF file
  14522. header size.
  14523. * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
  14524. than read for file header.
  14525. * archive.cc (Archive::include_member): Likewise.
  14526. 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
  14527. * aclocal.m4: Regenerate.
  14528. * configure: Regenerate.
  14529. 2008-04-19 Ian Lance Taylor <iant@google.com>
  14530. * version.cc (version_string): Bump to 1.6.
  14531. * testsuite/Makefile.am (many_sections_r_test): New target.
  14532. (many_sections_r_test_SOURCES): Remove.
  14533. (many_sections_r_test_DEPENDENCIES): Remove.
  14534. (many_sections_r_test_LDFLAGS): Remove.
  14535. (many_sections_r_test_LDADD): Remove.
  14536. * object.cc (Sized_relobj::do_add_symbols): Always pass
  14537. local_symbol_count_ to add_from_relobj.
  14538. * testsuite/Makefile.am (many_sections_check.h): Only check one in
  14539. every thousand variables.
  14540. * testsuite/Makefile.in: Rebuild.
  14541. * object.cc (Xindex::initialize_symtab_xindex): New function.
  14542. (Xindex::read_symtab_xindex): New function.
  14543. (Xindex::sym_xindex_to_shndx): New function.
  14544. (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
  14545. available.
  14546. (Sized_relobj::do_initialize_xindex): New function.
  14547. (Sized_relobj::do_read_symbols): Adjust section links.
  14548. (Sized_relobj::symbol_section_and_value): Add is_ordinary
  14549. parameter. Change all callers.
  14550. (Sized_relobj::include_section_group): Adjust section links and
  14551. symbol section indexes.
  14552. (Sized_relobj::do_layout): Adjust section links.
  14553. (Sized_relobj::do_count_local_symbols): Adjust section links and
  14554. symbol section indexes.
  14555. (Sized_relobj::do_finalize_local_symbols): Distinguish between
  14556. ordinary and special symbols.
  14557. (Sized_relobj::write_local_symbols): Add symtab_xindex and
  14558. dynsym_xindex parameters. Change all callers. Adjust section
  14559. links. Use SHN_XINDEX when needed.
  14560. (Sized_relobj::get_symbol_location_info): Adjust section links.
  14561. Don't get fooled by special symbols.
  14562. * object.h (class Xindex): Define.
  14563. (class Object): Add xindex_ parameter. Declare virtual functoin
  14564. do_initialize_xindex.
  14565. (Object::adjust_sym_shndx): New function.
  14566. (Object::set_xindex): New protected function.
  14567. (class Symbol_value): Add is_ordinary_shndx_ field.
  14568. (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
  14569. (Symbol_value::value): Assert ordinary section.
  14570. (Symbol_value::initialize_input_to_output_map): Likewise.
  14571. (Symbol_value::set_input_shndx): Add is_ordinary parameter.
  14572. Change all callers.
  14573. (Symbol_value::input_shndx): Add is_ordinary parameter. Change
  14574. all callers.
  14575. (class Sized_relobj): Update declarations.
  14576. (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
  14577. parameter. Change all callers.
  14578. (Sized_relobj::adjust_shndx): New function.
  14579. * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
  14580. field.
  14581. (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
  14582. parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
  14583. for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
  14584. (Sized_dynobj::read_dynsym_section): Adjust section links.
  14585. (Sized_dynobj::read_dynamic): Likewise.
  14586. (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
  14587. section links.
  14588. (Sized_dynobj::do_initialize_xindex): New function.
  14589. * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
  14590. do_initialize_xindex.
  14591. (Sized_dynobj::adjust_shndx): New function.
  14592. * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
  14593. dynsym_xindex_ fields.
  14594. (Layout::finalize): Add a call to set_section_indexes before
  14595. creating the symtab sections.
  14596. (Layout::set_section_indexes): Don't do anything if the section
  14597. already has a section index.
  14598. (Layout::create_symtab_sections): Add shnum parameter. Change
  14599. caller. Create .symtab_shndx section if needed.
  14600. (Layout::create_shdrs): Add shstrtab_section parameter. Change
  14601. caller.
  14602. (Layout::allocated_output_section_count): New function.
  14603. (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
  14604. needed.
  14605. * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
  14606. fields. Update declarations.
  14607. (Layout::symtab_xindex): New function.
  14608. (Layout::dynsym_xindex): New function.
  14609. (class Write_symbols_task): Add layout_ field.
  14610. (Write_symbols_task::Write_symbols_task): Add layout parameter.
  14611. Change caller.
  14612. * output.cc (Output_section_headers::Output_section_headers): Add
  14613. shstrtab_section parameter. Change all callers.
  14614. (Output_section_headers::do_sized_write): Store overflow values
  14615. for section count and section string table section index in
  14616. section header zero.
  14617. (Output_file_header::do_sized_write): Check for overflow of
  14618. section count and section string table section index.
  14619. (Output_symtab_xindex::do_write): New function.
  14620. (Output_symtab_xindex::endian_do_write): New function.
  14621. * output.h (class Output_section_headers): Add shstrtab_section_.
  14622. Update declarations.
  14623. (class Output_symtab_xindex): Define.
  14624. (Output_section::has_out_shndx): New function.
  14625. * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
  14626. field.
  14627. (Symbol::init_base): Add st_shndx and is_ordinary parameters.
  14628. Change all callers.
  14629. (Sized_symbol::init): Likewise.
  14630. (Symbol::output_section): Check for ordinary symbol.
  14631. (Symbol_table::add_from_object): Remove orig_sym parameter. Add
  14632. st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
  14633. callers.
  14634. (Symbol_table::add_from_relobj): Add symndx_offset parameter.
  14635. Change all callers. Simplify handling of symbols from sections
  14636. not included in the link.
  14637. (Symbol_table::add_from_dynobj): Handle ordinary symbol
  14638. distinction.
  14639. (Weak_alias_sorter::operator()): Assert that symbols are
  14640. ordinary.
  14641. (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
  14642. distinction.
  14643. (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
  14644. parameters. Change all callers.
  14645. (Symbol_table::sized_write_globals): Likewise. Handle ordinary
  14646. symbol distinction. Use SHN_XINDEX when needed.
  14647. (Symbol_table::write_section_symbol): Add symtab_xindex
  14648. parameter. Change all callers.
  14649. (Symbol_table::sized_write_section_symbol): Likewise. Use
  14650. SHN_XINDEX when needed.
  14651. * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
  14652. declarations.
  14653. (Symbol::shndx): Add is_ordinary parameter. Change all callers.
  14654. (Symbol::is_defined): Check is_ordinary.
  14655. (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
  14656. (Symbol::is_absolute, Symbol::is_common): Likewise.
  14657. (class Sized_symbol): Update declarations.
  14658. (class Symbol_table): Update declarations.
  14659. * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
  14660. parameters. Change all callers.
  14661. (Sized_symbol::override): Likewise.
  14662. (Symbol_table::override): Likewise.
  14663. (symbol_to_bits): Add is_ordinary parameter. Change all callers.
  14664. (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
  14665. is_ordinary, and orig_st_shndx parameters. Change all callers.
  14666. * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
  14667. to be in an ordinary section.
  14668. * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
  14669. object and is_ordinary parameters. Change all callers.
  14670. (Sized_dwarf_line_info::read_relocs): Add object parameter.
  14671. Change all callers. Don't add undefined or non-ordinary symbols
  14672. to reloc_map_.
  14673. (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
  14674. Change all callers.
  14675. * dwarf_reader.h (class Sized_dwarf_line_info): Update
  14676. declarations.
  14677. * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
  14678. * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
  14679. (Sized_relobj::relocate_sections): Likewise.
  14680. * target-reloc.h (scan_relocs): Adjust section symbol index.
  14681. (scan_relocatable_relocs): Likewise.
  14682. * i386.cc (Scan::local): Check for ordinary symbols.
  14683. * sparc.cc (Scan::local): Likewise.
  14684. * x86_64.cc (Scan::local): Likewise.
  14685. * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
  14686. to symbol_section_and_value.
  14687. * testsuite/many_sections_test.cc: New file.
  14688. * testsuite/Makefile.am (BUILT_SOURCES): Define.
  14689. (check_PROGRAMS): Add many_sections_test.
  14690. (many_sections_test_SOURCES): Define.
  14691. (many_sections_test_DEPENDENCIES): Define.
  14692. (many_sections_test_LDFLAGS): Define.
  14693. (BUILT_SOURCES): Add many_sections_define.h.
  14694. (many_sections_define.h): New target.
  14695. (BUILT_SOURCES): Add many_sections_check.h.
  14696. (many_sections_check.h): New target.
  14697. (check_PROGRAMS): Add many_sections_r_test.
  14698. (many_sections_r_test_SOURCES): Define.
  14699. (many_sections_r_test_DEPENDENCIES): Define.
  14700. (many_sections_r_test_LDFLAGS): Define.
  14701. (many_sections_r_test_LDADD): Define.
  14702. (many_sections_r_test.o): New target.
  14703. * testsuite/Makefile.in: Rebuild.
  14704. 2008-04-17 Cary Coutant <ccoutant@google.com>
  14705. * errors.cc (Errors::info): New function.
  14706. (gold_info): New function.
  14707. * errors.h (Errors::info): New function.
  14708. * gold.h (gold_info): New function.
  14709. * object.cc (Input_objects::add_object): Print trace output.
  14710. * options.cc (options::parse_set): New function.
  14711. (General_options::parse_wrap): Deleted.
  14712. (General_options::General_options): Deleted initializer.
  14713. * options.h (options::String_set): New typedef.
  14714. (options::parse_set): New function.
  14715. (DEFINE_set): New macro.
  14716. (General_options::wrap): Changed to use DEFINE_set. Changed
  14717. callers of any_wrap_symbols and is_wrap_symbol.
  14718. (General_options::trace, General_options::trace_symbol):
  14719. New options.
  14720. (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
  14721. (General_options::wrap_symbols_): Deleted.
  14722. * symtab.cc (Symbol_table::add_from_object): Print trace output.
  14723. 2008-04-17 David S. Miller <davem@davemloft.net>
  14724. * options.cc (General_options::parse_V): New function.
  14725. * options.h: Add entries for -V and -Qy.
  14726. 2008-04-17 Ian Lance Taylor <iant@google.com>
  14727. * common.cc (Symbol_table::allocate_commons): Remove options
  14728. parameter. Change caller.
  14729. (Symbol_table::do_allocate_commons): Remove options parameter.
  14730. Change caller. Just call do_allocate_commons_list twice.
  14731. (Symbol_table::do_allocate_commons_list): New function, broken out
  14732. of do_allocate_commons.
  14733. * common.h (class Allocate_commons_task): Remove options_ field.
  14734. Update constructor.
  14735. * symtab.cc (Symbol_table::Symbol_table): Initialize
  14736. tls_commons_.
  14737. (Symbol_table::add_from_object): Put TLS common symbols on
  14738. tls_commons_ list.
  14739. (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
  14740. which are IN_OUTPUT_DATA.
  14741. * symtab.h (class Symbol_table): Add tls_commons_ field. Update
  14742. allocate_commons and do_allocate_commons declarations. Declare
  14743. do_allocate_commons_list.
  14744. * gold.cc (queue_middle_tasks): Update creation of
  14745. Allocate_commons_task to not pass options.
  14746. * testsuite/Makefile.am (INCLUDES): Add -I.. .
  14747. (TLS_TEST_C_FLAGS): New variable.
  14748. (tls_test_c_pic.o): New target.
  14749. (tls_test_shared.so): Link in tls_test_c_pic.o.
  14750. (tls_test_c_pic_ie.o): New target.
  14751. (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
  14752. (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
  14753. (tls_test_c.o): New target.
  14754. (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
  14755. (tls_pic_test_LDADD): Likewise.
  14756. (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
  14757. (tls_shared_gd_to_ie_test_LDADD): Likewise.
  14758. (tls_test_c_gnu2.o): New target.
  14759. (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
  14760. tls_test_c_gnu2.o.
  14761. (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
  14762. (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
  14763. (tls_test_shared_nonpic.so): Link in tls_test_c.o.
  14764. * testsuite/tls_test.cc: Include "config.h".
  14765. (t_last): Call t11_last.
  14766. * testsuite/tls_test.h (t11, t11_last): Declare.
  14767. * testsuite/tls_test_c.c: New file.
  14768. * testsuite/tls_test_main.cc (thread_routine): Call t11.
  14769. * configure.ac: Check for OpenMP support.
  14770. * configure, config.in, Makefile.in: Rebuild.
  14771. * testsuite/Makefile.in: Rebuild.
  14772. 2008-04-16 Cary Coutant <ccoutant@google.com>
  14773. * i386.cc (Target_i386::define_tls_base_symbol): New function.
  14774. (Target_i386::tls_base_symbol_defined_): New field.
  14775. (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
  14776. (Target_i386::Scan::global): Likewise.
  14777. * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
  14778. * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
  14779. (Target_x86_64::tls_base_symbol_defined_): New field.
  14780. (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
  14781. (Target_x86_64::Scan::global): Likewise.
  14782. 2008-04-16 Cary Coutant <ccoutant@google.com>
  14783. * symtab.h (Symbol::is_strong_undefined): Removed unused function.
  14784. (Symbol::needs_plt_entry): Allow weak undefined symbols.
  14785. (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
  14786. building shared libraries.
  14787. * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
  14788. (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
  14789. (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
  14790. * testsuite/Makefile.in: Rebuild.
  14791. * testsuite/weak_undef.h: New file.
  14792. * testsuite/weak_undef_file1.cc: Add extra test cases.
  14793. * testsuite/weak_undef_file2.cc: Likewise.
  14794. * testsuite/weak_undef_test.cc: Likewise.
  14795. 2008-04-16 David S. Miller <davem@davemloft.net>
  14796. * sparc.cc (Target_sparc::Scan): Change from struct to class.
  14797. Add issued_non_pic_error_ field. Declare check_non_pic.
  14798. (Target_sparc::Scan::check_non_pic): New function.
  14799. (Target_sparc::Scan::local): Call check_non_pic as appropriate.
  14800. (Target_sparc::Scan::global): Likewise.
  14801. * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
  14802. * configure: Rebuild.
  14803. * options.h (DEFINE_enable): New macro.
  14804. (new_dtags): New enable option.
  14805. (initfirst, interpose, loadfltr, nodefaultlib,
  14806. nodelete, nodlopen, nodump): New -z options.
  14807. * layout.cc (Layout:finish_dynamic_section): If new
  14808. dtags enabled, emit DT_RUNPATH. Also, emit a
  14809. DT_FLAGS_1 containing any specified -z flags.
  14810. 2008-04-16 Ian Lance Taylor <iant@google.com>
  14811. * copy-relocs.cc: New file.
  14812. * copy-relocs.h: New file.
  14813. * reloc.cc: Remove Copy_relocs code.
  14814. * reloc.h: Likewise.
  14815. * reloc-types.h (struct Reloc_types) [both versions]: Add
  14816. get_reloc_addend_noerror.
  14817. * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
  14818. variants of add_global which take an addend which must be zero.
  14819. * i386.cc: Include "copy-relocs.h".
  14820. (class Target_i386): Change type of copy_relocs_ to variable,
  14821. update initializer.
  14822. (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
  14823. Change all callers.
  14824. (Target_i386::do_finalize_sections): Change handling of
  14825. copy_relocs_.
  14826. * sparc.cc: Include "copy-relocs.h".
  14827. (class Target_sparc): Change type of copy_relocs_ to variable,
  14828. update initializer.
  14829. (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
  14830. Change all callers.
  14831. (Target_sparc::do_finalize_sections): Change handling of
  14832. copy_relocs_.
  14833. * x86_64.cc: Include "copy-relocs.h".
  14834. (class Target_x86_64): Change type of copy_relocs_ to variable,
  14835. update initializer.
  14836. (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
  14837. class. Change all callers.
  14838. (Target_x86_64::do_finalize_sections): Change handling of
  14839. copy_relocs_.
  14840. * Makefile.am (CCFILES): Add copy-relocs.cc.
  14841. (HFILES): Add copy-relocs.h.
  14842. * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
  14843. * testsuite/script_test_4.sh: Permit leading zeroes.
  14844. 2008-04-15 Ian Lance Taylor <iant@google.com>
  14845. * script-sections.cc (Script_sections::create_segments): Use
  14846. header_size_adjustment even when there is enough room for the
  14847. headers.
  14848. * testsuite/script_test_4.sh: New file.
  14849. * testsuite/script_test_4.t: New file.
  14850. * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
  14851. (check_DATA): Add script_test_4.stdout.
  14852. (MOSTLYCLEANFILES): Likewise.
  14853. (script_test_4): New target.
  14854. (script_test_4.stdout): New target.
  14855. * testsuite/Makefile.in: Rebuild.
  14856. * sparc.cc: Add definitions for Output_data_plt_sparc class
  14857. constants.
  14858. 2008-04-14 David S. Miller <davem@davemloft.net>
  14859. * sparc.cc: New file.
  14860. * Makefile.am (TARGETSOURCES): Add sparc.cc
  14861. (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
  14862. * configure.tgt: Document targ_extra_size and
  14863. targ_extra_big_endian. Add entries for sparc-* and
  14864. sparc64-*.
  14865. * configure.ac: Handle targ_extra_size and
  14866. targ_extra_big_endian.
  14867. * Makefile.in: Rebuild.
  14868. * configure: Likewise.
  14869. * po/POTFILES.in: Likewise.
  14870. * po/gold.pot: Likewise.
  14871. 2008-04-14 Ian Lance Taylor <iant@google.com>
  14872. * layout.cc (Layout::Layout): Initialize sections_are_attached_.
  14873. (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
  14874. in the name/type/flags to section mapping. Don't call
  14875. allocate_output_section.
  14876. (Layout::choose_output_section): Change parameter from adjust_name
  14877. to is_input_section. Don't permit input sections after sections
  14878. are attached to segments. Don't call allocate_output_section.
  14879. (Layout::layout_eh_frame): Call update_flags_for_input_section,
  14880. not write_enable_output_section.
  14881. (Layout::make_output_section): Don't push to
  14882. unattached_section_list_ nor call attach_to_segment. Call
  14883. attach_section_to_segment if sections are attached.
  14884. (Layout::attach_sections_to_segments): New function.
  14885. (Layout::attach_section_to_segment): New function.
  14886. (Layout::attach_allocated_section_to_segment): Rename from
  14887. attach_to_segment. Remove flags parameter.
  14888. (Layout::allocate_output_section): Remove function.
  14889. (Layout::write_enable_output_section): Remove function.
  14890. * layout.h (class Layout): Update for above changes. Add new
  14891. field sections_are_attached_.
  14892. * output.h (Output_section::update_flags_for_input_section): New
  14893. function.
  14894. * output.cc (Output_section::add_input_section): Call
  14895. update_flags_for_input_section.
  14896. * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
  14897. 2008-04-11 Cary Coutant <ccoutant@google.com>
  14898. * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
  14899. thought unnecessary.
  14900. * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
  14901. 2008-04-11 Ian Lance Taylor <iant@google.com>
  14902. * output.h (class Output_section_data): Remove inline definition
  14903. of set_addralign.
  14904. * output.cc (Output_section_data::set_addralign): New function.
  14905. 2008-04-11 Cary Coutant <ccoutant@google.com>
  14906. Add support for TLS descriptors for i386 and x86_64.
  14907. * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
  14908. (Target_i386::Relocate::tls_desc_gd_to_le): New function.
  14909. (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
  14910. GOT_TYPE_TLS_DESC.
  14911. (Target_i386::got_mod_index_entry): Remove unnecessary code.
  14912. (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
  14913. R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
  14914. relocations.
  14915. (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
  14916. Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
  14917. Fix problem with initial-exec relocations.
  14918. (Target_i386::Relocate::relocate_tls): Likewise.
  14919. (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
  14920. relaxation.
  14921. * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
  14922. support for section-plus-offset dynamic table entries.
  14923. * output.h (Output_data_dynamic::add_section_plus_offset): New function.
  14924. (Output_data_dynamic::Dynamic_entry): Add support for
  14925. section-plus-offset dynamic table entries.
  14926. (Output_data_dynamic::Classification): Likewise.
  14927. (Output_data_dynamic::classification_): Renamed offset_.
  14928. * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
  14929. (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
  14930. (Target_x86_64::make_plt_section): New function.
  14931. (Target_x86_64::reserve_tlsdesc_entries): New function.
  14932. (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
  14933. (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
  14934. (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
  14935. (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
  14936. (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
  14937. (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
  14938. (Output_data_plt_x86_64::set_final_data_size): Move out of line;
  14939. add extra PLT entry for TLS descriptors.
  14940. (Output_data_plt_x86_64::got_): New field.
  14941. (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
  14942. (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
  14943. fields.
  14944. (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
  14945. descriptors.
  14946. (Target_x86_64::make_plt_entry): Factor out make_plt_section.
  14947. (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
  14948. (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
  14949. R_386_TLS_DESC_CALL relocations.
  14950. (Target_x86_64::Scan::global): Likewise.
  14951. (Target_x86_64::do_finalize_sections): Add dynamic table entries
  14952. for TLS descriptors.
  14953. (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
  14954. Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
  14955. (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
  14956. GD-to-IE relaxation.
  14957. * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
  14958. and TLS_DESCRIPTORS.
  14959. * Makefile.in: Rebuild.
  14960. * configure: Rebuild.
  14961. * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
  14962. (tls_test_shared2.so): New target.
  14963. (tls_shared_gd_to_ie_test_SOURCES): New variable.
  14964. (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
  14965. (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
  14966. (tls_shared_gd_to_ie_test_LDADD): New variable.
  14967. (tls_shared_gnu2_gd_to_ie_test): New target.
  14968. (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
  14969. New targets.
  14970. (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
  14971. (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
  14972. (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
  14973. (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
  14974. (tls_shared_gnu2_test): New target.
  14975. (tls_test_gnu2_shared.so): New target.
  14976. (tls_shared_gnu2_test_SOURCES): New variable.
  14977. (tls_shared_gnu2_test_DEPENDENCIES): New variable.
  14978. (tls_shared_gnu2_test_LDFLAGS): New variable.
  14979. (tls_shared_gnu2_test_LDADD): New variable.
  14980. * testsuite/Makefile.in: Rebuild.
  14981. * testsuite/Makefile.
  14982. 2008-04-11 Ian Lance Taylor <iant@google.com>
  14983. * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
  14984. justsyms.t.
  14985. * testsuite/Makefile.in: Rebuild.
  14986. * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
  14987. long.
  14988. * testsuite/script_test_2.cc (main): Adjust test.
  14989. 2008-04-11 David S. Miller <davem@davemloft.net>
  14990. Ian Lance Taylor <iant@google.com>
  14991. * options.h (General_options): Add entries for '-Y' and
  14992. '-relax'.
  14993. * options.cc (General_options:finalize): If -Y was used, add those
  14994. entries to the library path instead of the default "/lib" and
  14995. "/usr/lib".
  14996. 2008-04-11 David S. Miller <davem@davemloft.net>
  14997. * testsuite/justsyms.t: Start at 0x100.
  14998. * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
  14999. * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
  15000. long.
  15001. * testsuite/script_test_2.cc: Adjust string and section length
  15002. checks.
  15003. 2008-04-09 Ian Lance Taylor <iant@google.com>
  15004. PR gold/5996
  15005. * script-sections.cc (Sections_element::allocate_to_segment): Add
  15006. orphan parameter.
  15007. (Output_section_definition::allocate_to_segment): Likewise.
  15008. (Orphan_output_section::allocate_to_segment): Likewise.
  15009. (Script_sections::attach_sections_using_phdrs_clause): Don't
  15010. propagate non-PT_LOAD segments to orphan sections.
  15011. * testsuite/Makefile.am (script_test_3.stdout): Generate using
  15012. readelf rather than objdump.
  15013. * testsuite/script_test_3.sh: Adjust accordingly. Test that
  15014. .interp section and PT_INTERP segment are the same size.
  15015. * testsuite/Makefile.in: Rebuild.
  15016. * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
  15017. aliases for symbols defined in the same object.
  15018. * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
  15019. (weak_alias_test_SOURCES): New variable.
  15020. (weak_alias_test_DEPENDENCIES): New variable.
  15021. (weak_alias_test_LDFLAGS): New variable.
  15022. (weak_alias_test_LDADD): New variable.
  15023. (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
  15024. (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
  15025. (weak_alias_test_3.o): New target.
  15026. (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
  15027. * testsuite/weak_alias_test_main.cc: New file.
  15028. * testsuite/weak_alias_test_1.cc: New file.
  15029. * testsuite/weak_alias_test_2.cc: New file.
  15030. * testsuite/weak_alias_test_3.cc: New file.
  15031. 2008-04-08 Ian Lance Taylor <iant@google.com>
  15032. * options.h (class General_options): Add --noinhibit-exec option.
  15033. * main.cc (main): Check --noinhibit-exec.
  15034. * options.h (class General_options): Define --wrap as a special
  15035. option. Add wrap_symbols_ field.
  15036. (General_options::any_wrap_symbols): New function.
  15037. (General_options::is_wrap_symbol): New function.
  15038. * options.cc (General_options::parse_wrap): New function.
  15039. (General_options::General_options): Initialize wrap_symbols_.
  15040. * symtab.cc (Symbol_table::wrap_symbol): New function.
  15041. (Symbol_table::add_from_object): Handle --wrap.
  15042. * symtab.h (class Symbol_table): Declare wrap_symbol.
  15043. * target.h (Target::wrap_char): New function.
  15044. (Target::Target_info): Add wrap_char field.
  15045. * i386.cc (Target_i386::i386_info): Initialize wrap_char.
  15046. * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
  15047. * testsuite/testfile.cc (Target_test::test_target_info):
  15048. Likewise.
  15049. * errors.cc (Errors::undefined_symbol): Mention symbol version if
  15050. there is one.
  15051. * layout.h (class Layout): Add added_eh_frame_data_ field.
  15052. * layout.cc (Layout::Layout): Initialize new field.
  15053. (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
  15054. output section until we find a section we merged successfully.
  15055. * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
  15056. that the size be non-zero.
  15057. * merge.cc (Object_merge_map::get_output_offset): Remove inline
  15058. qualifier.
  15059. 2008-04-08 Craig Silverstein <csilvers@google.com>
  15060. * configure.ac: Export new conditional variable HAVE_ZLIB.
  15061. * testsuite/Makefile.am (flagstest_o_specialfile): Condition
  15062. on HAVE_ZLIB.
  15063. (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
  15064. * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
  15065. 2008-04-07 Ian Lance Taylor <iant@google.com>
  15066. * version.cc (version_string): Set to "1.5".
  15067. * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
  15068. Add issued_non_pic_error_ field. Declare check_non_pic.
  15069. (Target_x86_64::Scan::check_non_pic): New function.
  15070. (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
  15071. (Target_x86_64::Scan::global): Likewise.
  15072. * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
  15073. addend parameter. Change caller. Handle merge sections.
  15074. (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
  15075. Address to Addend. Don't add in the result of
  15076. local_section_offset, pass down the addend and use the returned
  15077. value.
  15078. * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
  15079. Update declarations of local_section_offset and symbol_value.
  15080. * testsuite/two_file_test_1.cc (t18): New function.
  15081. * testsuite/two_file_test_2.cc (f18): New function.
  15082. * testsuite/two_file_test_main.cc (main): Call t18.
  15083. * testsuite/two_file_test.h (t18, f18): Declare.
  15084. * configure.ac: Don't test for objdump, c++filt, or readelf.
  15085. * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
  15086. conditionals.
  15087. (TEST_READELF): New variable.
  15088. (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
  15089. (check_PROGRAMS): Add two_file_strip_test.
  15090. (two_file_strip_test): New target.
  15091. (check_PROGRAMS): Add two_file_same_shared_strip_test.
  15092. (two_file_same_shared_strip_test_SOURCES): New variable.
  15093. (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
  15094. (two_file_same_shared_strip_test_LDFLAGS): New variable.
  15095. (two_file_same_shared_strip_test_LDADD): New variable.
  15096. (two_file_shared_strip.so): New target.
  15097. (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
  15098. (ver_test_5.syms, ver_test_7.syms): Likewise.
  15099. (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
  15100. (strip_test_3.stdout): Use TEST_OBJDUMP.
  15101. * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
  15102. 2008-04-04 Cary Coutant <ccoutant@google.com>
  15103. * symtab.h (Symbol::is_weak_undefined): New function.
  15104. (Symbol::is_strong_undefined): New function.
  15105. (Symbol::is_absolute): New function.
  15106. (Symbol::needs_plt_entry): Exclude weak undefined symbols.
  15107. (Symbol::needs_dynamic_reloc): Exclude weak undefined and
  15108. absolute symbols.
  15109. * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
  15110. (weak_undef_test): New target.
  15111. * testsuite/Makefile.in: Rebuild.
  15112. * testsuite/weak_undef_file1.cc: New file.
  15113. * testsuite/weak_undef_file2.cc: New file.
  15114. * testsuite/weak_undef_test.cc: New file.
  15115. 2008-04-03 Craig Silverstein <csilvers@google.com>
  15116. * compressed_output.h (class Output_compressed_section): Use
  15117. unsigned buffer.
  15118. * compressed_output.cc (zlib_compress): Use unsigned buffers,
  15119. add zlib header.
  15120. (zlib_compressed_suffix): Removed.
  15121. (Output_compressed_section::set_final_data_size): Use unsigned
  15122. buffers.
  15123. * testsuite/Makefile.am (flagstest_compress_debug_sections):
  15124. Fix linker invocation.
  15125. (flagstest_o_specialfile_and_compress_debug_sections):
  15126. Likewise.
  15127. * testsuite/Makefile.in: Regenerated.
  15128. 2008-04-02 David S. Miller <davem@davemloft.net>
  15129. * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
  15130. Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
  15131. 2008-04-02 Craig Silverstein <csilvers@google.com>
  15132. * TODO: New file.
  15133. 2008-04-02 Ian Lance Taylor <iant@google.com>
  15134. * fileread.cc (File_read::find_view): Add byteshift and vshifted
  15135. parameters. Update for new key type to views_. Change all
  15136. callers.
  15137. (File_read::read): Adjust for byteshift in returned view.
  15138. (File_read::add_view): New function, broken out of
  15139. find_and_make_view.
  15140. (File_read::make_view): New function, broken out of
  15141. find_and_make_view.
  15142. (File_read::find_or_make_view): Add offset and aligned
  15143. parameters. Rewrite accordingly. Change all callers.
  15144. (File_read::get_view): Add offset and aligned parameters. Adjust
  15145. for byteshift in return value.
  15146. (File_read::get_lasting_view): Likewise.
  15147. * fileread.h (class File_read): Update declarations.
  15148. (class File_read::View): Add byteshift_ field. Add byteshift to
  15149. constructor. Add byteshift method.
  15150. * archive.h (Archive::clear_uncached_views): New function.
  15151. (Archive::get_view): Add aligned parameter. Change all callers.
  15152. * object.h (Object::get_view): Add aligned parameter. Change all
  15153. callers.
  15154. (Object::get_lasting_view): Likewise.
  15155. * fileread.cc (File_read::release): Don't call clear_views if
  15156. there are multiple objects.
  15157. * fileread.h (File_read::clear_uncached_views): New function.
  15158. * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
  15159. on the archive.
  15160. 2008-03-31 Cary Coutant <ccoutant@google.com>
  15161. Add thin archive support.
  15162. * archive.cc (Archive::armagt): New const.
  15163. (Archive::setup): Remove task parameter and calls to unlock.
  15164. (Archive::unlock_nested_archives): New function.
  15165. (Archive::read_header): Add nested_off parameter. Change
  15166. all callers.
  15167. (Archive::interpret_header): Likewise.
  15168. (Archive::include_all_members): Change to handle thin
  15169. archives.
  15170. (Archive::include_member): Likewise.
  15171. * archive.h (Archive::Archive): Add new parameters and
  15172. initializers.
  15173. (Archive::armagt): New const.
  15174. (Archive::setup): Remove task parameter.
  15175. (Archive::unlock_nested_archives): New function.
  15176. (Archive::read_header): Add nested_off parameter.
  15177. (Archive::interpret_header): Likewise.
  15178. (Archive::Nested_archive_table): New typedef.
  15179. (Archive::is_thin_archive_): New field.
  15180. (Archive::nested_archives_): New field.
  15181. (Archive::options_): New field.
  15182. (Archive::dirpath_): New field.
  15183. (Archive::task_): New field.
  15184. * readsyms.cc (Read_symbols::do_read_symbols): Add check
  15185. for thin archives. Pass additional parameters to
  15186. Archive::Archive. Unlock the archive file after calling
  15187. Archive::setup.
  15188. 2008-03-29 Ian Lance Taylor <iant@google.com>
  15189. * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
  15190. version symbol to be local.
  15191. * testsuite/ver_test_4.sh: New file.
  15192. * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
  15193. (check_DATA): Add ver_test_4.syms.
  15194. (ver_test_4.syms): New target.
  15195. * testsuite/Makefile.in: Rebuild.
  15196. * output.cc
  15197. (Output_section::Input_section_sort_entry::has_priority): New
  15198. function.
  15199. (Output_section::Input_section_sort_entry::match_file_name): New
  15200. function.
  15201. (Output_section::Input_section_sort_entry::match_section_name):
  15202. Remove.
  15203. (Output_section::Input_section_sort_entry::match_section_name_prefix):
  15204. Remove.
  15205. (Output_section::Input_section_sort_entry::match_section_file):
  15206. Remove.
  15207. (Output_section::Input_section_sort_compare::operator()): Rewrite
  15208. using new Input_section_sort_entry functions. Sort crtbegin and
  15209. crtend first. Sort sections with no priority before sections with
  15210. a priority.
  15211. * testsuite/initpri1.c (d3): Check j != 4.
  15212. (cd5): New constructor/destructor function.
  15213. (main): Check j != 2.
  15214. * symtab.cc (Symbol_table::add_from_object): If we don't use the
  15215. new symbol when resolving, don't call set_is_default.
  15216. * testsuite/ver_test_7.cc: New file.
  15217. * testsuite/ver_test_7.sh: New file.
  15218. * testsuite/Makefile.am (ver_test_7.so): New target.
  15219. (ver_test_7.o): New target.
  15220. (check_SCRIPTS): Add ver_test_7.sh.
  15221. (check_DATA): Add ver_test_7.syms.
  15222. (ver_test_7.syms): New target.
  15223. 2008-03-28 Ian Lance Taylor <iant@google.com>
  15224. * layout.cc (Layout::layout): If we see an input section with a
  15225. name that needs sorting, set the must_sort flag for the output
  15226. section.
  15227. (Layout::make_output_section): If the name of the output section
  15228. indicates that it might require sorting, set the may_sort flag.
  15229. * output.h (Output_section::may_sort_attached_input_sections): New
  15230. function.
  15231. (Output_section::set_may_sort_attached_input_sections): New
  15232. function.
  15233. (Output_section::must_sort_attached_input_sections): New
  15234. function.
  15235. (Output_section::set_must_sort_attached_input_sections): New
  15236. function.
  15237. (class Output_section): Declare Input_section_sort_entry. Define
  15238. Input_section_sort_compare. Declare
  15239. sort_attached_input_sections. Add new fields:
  15240. may_sort_attached_input_sections_,
  15241. must_sort_attached_input_sections_,
  15242. attached_input_sections_are_sorted_.
  15243. * output.cc (Output_section::Output_section): Initialize new
  15244. fields.
  15245. (Output_section::add_input_section): Add an entry to
  15246. input_sections_ if may_sort or must_sort are true.
  15247. (Output_section::set_final_data_size): Call
  15248. sort_attached_input_sections if necessary.
  15249. (Output_section::Input_section_sort_entry): Define new class.
  15250. (Output_section::Input_section_sort_compare::operator()): New
  15251. function.
  15252. (Output_section::sort_attached_input_sections): New function.
  15253. * configure.ac: Check whether the compiler supports constructor
  15254. priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
  15255. * testsuite/initpri1.c: New file.
  15256. * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
  15257. CONSTRUCTOR_PRIORITY.
  15258. (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
  15259. (initpri1_LDFLAGS): New variable.
  15260. * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
  15261. 2008-03-27 Ian Lance Taylor <iant@google.com>
  15262. * common.cc (Sort_commons::operator): Correct sorting algorithm.
  15263. * testsuite/common_test_1.c: New file.
  15264. * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
  15265. (common_test_1_SOURCES): New variable.
  15266. (common_test_1_DEPENDENCIES): New variable.
  15267. (common_test_1_LDFLAGS): New variable.
  15268. * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
  15269. and commons_ correctly when NAME/VERSION does not override
  15270. NAME/NULL.
  15271. * testsuite/ver_test_6.c: New file.
  15272. * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
  15273. (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
  15274. (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
  15275. 2008-03-26 Ian Lance Taylor <iant@google.com>
  15276. * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
  15277. of an undefined symbol from a version script.
  15278. * testsuite/Makefile.am (ver_test_5.so): New target.
  15279. (ver_test_5.o): New target.
  15280. (check_SCRIPTS): Add ver_test_5.sh.
  15281. (check_DATA): Add ver_test_5.syms.
  15282. (ver_test_5.syms): New target.
  15283. * testsuite/ver_test_5.cc: New file.
  15284. * testsuite/ver_test_5.script: New file.
  15285. * testsuite/ver_test_5.sh: New file.
  15286. * Makefile.in, testsuite/Makefile.in: Rebuild.
  15287. PR gold/5986
  15288. Fix problems building gold with gcc 4.3.0.
  15289. * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
  15290. (gold_error_at_location, gold_warning_at_location): Use it.
  15291. * configure.ac: Check whether we can compile and use a template
  15292. function with a printf attribute.
  15293. * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
  15294. when jumping over bytes.
  15295. * object.cc: Instantiate Object::read_section_data.
  15296. * debug.h: Include <cstring>
  15297. * dwarf_reader.cc: Include <algorithm>
  15298. * main.cc: Include <cstring>.
  15299. * options.cc: Include <cstring>.
  15300. * output.cc: Include <cstring>.
  15301. * script.cc: Include <cstring>.
  15302. * script.h: Include <string>.
  15303. * symtab.cc: Include <cstring> and <algorithm>.
  15304. * target-select.cc: Include <cstring>.
  15305. * version.cc: Include <string>.
  15306. * testsuite/testmain.cc: Include <cstdlib>.
  15307. * configure, config.in: Rebuild.
  15308. 2008-03-25 Ian Lance Taylor <iant@google.com>
  15309. * options.cc: Include "../bfd/bfdver.h".
  15310. (options::help): Print bug reporting address.
  15311. * version.cc (print_version): Adjust output for current value of
  15312. BFD_VERSION_STRING.
  15313. * NEWS: New file.
  15314. * options.cc (options::help): Print list of supported targets.
  15315. * target-select.h: Include <vector>.
  15316. (class Target_selector): Make machine_, size_, and is_big_endian_
  15317. fields const. Add bfd_name_ and instantiated_target_ fields.
  15318. (Target_selector::Target_selector): Add bfd_name parameter.
  15319. (Target_selector::recognize): Make non-virtual, call
  15320. do_recognize.
  15321. (Target_selector::recognize_by_name): Make non-virtual, call
  15322. do_recognize_by_name.
  15323. (Target_selector::supported_names): New function.
  15324. (Target_selector::bfd_name): New function.
  15325. (Target_selector::do_instantiate_target): New pure virtual
  15326. function.
  15327. (Target_selector::do_recognize): New virtual function.
  15328. (Target_selector::do_recognize_by_name): New virtual function.
  15329. (Target_selector::instantiate_target): New private function.
  15330. (supported_target_names): Declare.
  15331. * target-select.cc (Target_selector::Target_selector): Update for
  15332. new parameter and fields.
  15333. (select_target_by_name): Check that the name matches before
  15334. calling recognize_by_name.
  15335. (supported_target_names): New function.
  15336. * i386.cc (class Target_selector_i386): Update Target_selector
  15337. constructor call. Remove recognize and recognize_by_name. Add
  15338. do_instantiate_target.
  15339. * x86_64.cc (class Target_selector_x86_64): Likewise.
  15340. * testsuite/testfile.cc (class Target_selector_test): Update for
  15341. changes to Target_selector.
  15342. * README: Rewrite, with some notes on unsupported features.
  15343. 2008-03-24 Cary Coutant <ccoutant@google.com>
  15344. * i386.cc (Target_i386::Got_type): New enum declaration.
  15345. (Target_i386::Scan::local): Updated callers of Output_data_got
  15346. member functions.
  15347. (Target_i386::Scan::global): Likewise.
  15348. (Target_i386::Relocate::relocate): Likewise.
  15349. (Target_i386::Relocate::relocate_tls): Likewise.
  15350. * object.h (Got_offset_list): New class.
  15351. (Sized_relobj::local_has_got_offset): Added got_type parameter.
  15352. (Sized_relobj::local_got_offset): Likewise.
  15353. (Sized_relobj::set_local_got_offset): Likewise.
  15354. (Sized_relobj::local_has_tls_got_offset): Removed.
  15355. (Sized_relobj::local_tls_got_offset): Removed.
  15356. (Sized_relobj::set_local_tls_got_offset): Removed.
  15357. (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
  15358. * output.cc (Output_data_got::add_global): Added got_type parameter.
  15359. (Output_data_got::add_global_with_rel): Likewise.
  15360. (Output_data_got::add_global_with_rela): Likewise.
  15361. (Output_data_got::add_global_pair_with_rel): New function.
  15362. (Output_data_got::add_global_pair_with_rela): New function.
  15363. (Output_data_got::add_local): Added got_type parameter.
  15364. (Output_data_got::add_local_with_rel): Likewise.
  15365. (Output_data_got::add_local_with_rela): Likewise.
  15366. (Output_data_got::add_local_pair_with_rel): New function.
  15367. (Output_data_got::add_local_pair_with_rela): New function.
  15368. (Output_data_got::add_global_tls): Removed.
  15369. (Output_data_got::add_global_tls_with_rel): Removed.
  15370. (Output_data_got::add_global_tls_with_rela): Removed.
  15371. (Output_data_got::add_local_tls): Removed.
  15372. (Output_data_got::add_local_tls_with_rel): Removed.
  15373. (Output_data_got::add_local_tls_with_rela): Removed.
  15374. * output.h (Output_data_got::add_global): Added got_type parameter.
  15375. (Output_data_got::add_global_with_rel): Likewise.
  15376. (Output_data_got::add_global_with_rela): Likewise.
  15377. (Output_data_got::add_global_pair_with_rel): New function.
  15378. (Output_data_got::add_global_pair_with_rela): New function.
  15379. (Output_data_got::add_local): Added got_type parameter.
  15380. (Output_data_got::add_local_with_rel): Likewise.
  15381. (Output_data_got::add_local_with_rela): Likewise.
  15382. (Output_data_got::add_local_pair_with_rel): New function.
  15383. (Output_data_got::add_local_pair_with_rela): New function.
  15384. (Output_data_got::add_global_tls): Removed.
  15385. (Output_data_got::add_global_tls_with_rel): Removed.
  15386. (Output_data_got::add_global_tls_with_rela): Removed.
  15387. (Output_data_got::add_local_tls): Removed.
  15388. (Output_data_got::add_local_tls_with_rel): Removed.
  15389. (Output_data_got::add_local_tls_with_rela): Removed.
  15390. * resolve.cc (Symbol::override_base_with_special): Removed
  15391. reference to has_got_offset_ field.
  15392. * symtab.cc (Symbol::init_fields): Replaced initialization
  15393. of got_offset_ with got_offsets_. Removed initialization
  15394. of has_got_offset_
  15395. * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
  15396. (Symbol::got_offset): Likewise.
  15397. (Symbol::set_got_offset): Likewise.
  15398. (Symbol::has_tls_got_offset): Removed.
  15399. (Symbol::tls_got_offset): Removed.
  15400. (Symbol::set_tls_got_offset): Removed.
  15401. (Symbol::got_offset_): Removed.
  15402. (Symbol::tls_mod_got_offset_): Removed.
  15403. (Symbol::tls_pair_got_offset_): Removed.
  15404. (Symbol::got_offsets_): New field.
  15405. (Symbol::has_got_offset): Removed.
  15406. (Symbol::has_tls_mod_got_offset): Removed.
  15407. (Symbol::has_tls_pair_got_offset): Removed.
  15408. * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
  15409. (Target_x86_64::Scan::local): Updated callers of Output_data_got
  15410. member functions.
  15411. (Target_x86_64::Scan::global): Likewise.
  15412. (Target_x86_64::Relocate::relocate): Likewise.
  15413. (Target_x86_64::Relocate::relocate_tls): Likewise.
  15414. 2008-03-25 Ben Elliston <bje@au.ibm.com>
  15415. * yyscript.y: Fix spelling error in comment.
  15416. 2008-03-24 Ian Lance Taylor <iant@google.com>
  15417. * options.h (class General_options): Define build_id option.
  15418. * layout.h (class Layout): Declare write_build_id, create_note,
  15419. create_build_id. Add build_id_note_ member.
  15420. * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
  15421. "libiberty.h", "md5.h", "sha1.h".
  15422. (Layout::Layout): Initialize eh_frame_data_,
  15423. eh_frame_hdr_section_, and build_id_note_.
  15424. (Layout::finalize): Call create_build_id.
  15425. (Layout::create_note): New function, broken out of
  15426. Layout::create_gold_note.
  15427. (Layout::create_gold_note): Call create_note.
  15428. (Layout::create_build_id): New function.
  15429. (Layout::write_build_id): New function.
  15430. (Close_task_runner::run): Call write_build_id.
  15431. * x86_64.cc: Correct license to GPLv3.
  15432. 2008-03-23 Ian Lance Taylor <iant@google.com>
  15433. * options.cc: Include "demangle.h".
  15434. (parse_optional_string): New function.
  15435. (parse_long_option): Handle takes_optional_argument.
  15436. (parse_short_option): Update dash_z initializer. Handle
  15437. takes_optional_argument.
  15438. (General_options::General_options): Initialize do_demangle_.
  15439. (General_options::finalize): Set do_demangle_. Handle demangling
  15440. style.
  15441. * options.h (parse_optional_string): Declare.
  15442. (struct One_option): Add optional_arg field. Update constructor.
  15443. Update call constructor calls. Add takes_optional_argument
  15444. function.
  15445. (DEFINE_var): Add optional_arg__ parameter. Change all callers.
  15446. (DEFINE_optional_string): Define.
  15447. (General_options::demangle): Change from DEFINE_bool to
  15448. DEFINE_optional_string.
  15449. (General_options::no_demangle): New function.
  15450. (General_options::do_demangle): New function.
  15451. (General_options::set_do_demangle): New function.
  15452. (General_options::execstack_status_): Move definition to end of
  15453. class definition.
  15454. (General_options::static_): Likewise.
  15455. (General_options::do_demangle_): New field.
  15456. * object.cc (big_endian>::get_symbol_location_info): Call
  15457. Options::do_demangle, not Options::demangle.
  15458. * symtab.cc (demangle): Likewise.
  15459. 2008-03-22 Ian Lance Taylor <iant@google.com>
  15460. * gold.h: Include <cstddef> and <sys/types.h>
  15461. * options.h: Include <cstring>.
  15462. 2008-03-21 Ian Lance Taylor <iant@google.com>
  15463. * Added source code to GNU binutils.
  15464. Copyright (C) 2008-2015 Free Software Foundation, Inc.
  15465. Copying and distribution of this file, with or without modification,
  15466. are permitted in any medium without royalty provided the copyright
  15467. notice and this notice are preserved.
  15468. Local Variables:
  15469. mode: change-log
  15470. left-margin: 8
  15471. fill-column: 74
  15472. version-control: never
  15473. End: