ChangeLog 726 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815
  1. 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
  2. * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
  3. x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
  4. (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
  5. x86_64_mov_to_lea1.o.
  6. * testsuite/Makefile.in: Regenerated.
  7. 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
  8. PR gold/19119
  9. * options.h (General_options): Remove "obsolete" from -m.
  10. * parameters.cc (set_parameters_target): Check if input target
  11. is compatible with output emulation set by "-m emulation".
  12. 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
  13. PR gold/19118
  14. * i386.cc (Target_iamcu): New class.
  15. (Target_selector_iamcu): Likewise.
  16. (Target_iamcu::iamcu_info): New variable.
  17. (target_selector_iamcu): Likewise.
  18. 2015-10-07 Andreas Schwab <schwab@suse.de>
  19. * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
  20. 2015-10-06 Cary Coutant <ccoutant@gmail.com>
  21. PR gold/18855
  22. * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
  23. parameter.
  24. (Sparc_relocate_functions::gdop_lox10): Likewise.
  25. (Target_sparc::Relocate::relocate): Use addend when computing
  26. symbol value for R_SPARC_GOTDATA_OP*.
  27. 2015-09-07 Cary Coutant <ccoutant@gmail.com>
  28. PR gold/18930
  29. PR gold/18886
  30. * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
  31. * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
  32. 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
  33. PR gold/18886
  34. * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
  35. shared libraries into normal FUNC symbols.
  36. * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
  37. symbols aren't from shared libraries.
  38. 2015-09-02 Alan Modra <amodra@gmail.com>
  39. PR 18878
  40. * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
  41. (Target_powerpc::Branch_info::make_stub): Determine whether long
  42. branch stub is for save/restore function.
  43. (Branch_stub_ent): Add save_res_, and extra parm to constructor.
  44. (Stub_table): Add need_save_res_.
  45. (Stub_table:clear_stubs): Clear need_save_res_.
  46. (Stub_table:set_address_and_size): Add save/restore section size.
  47. (Stub_table::add_long_branch_entry): Add save_res param. Set
  48. need_save_res_, but don't add space for save/restore stubs.
  49. (Stub_table::find_long_branch_entry): Return offset to local copy
  50. of save/restore func.
  51. (Stub_table::do_write): Don't output save/restore stubs. Instead
  52. copy the save/restore functions.
  53. (Output_data_save_res:contents): New accessor.
  54. (Target_powerpc::define_save_restore_funcs): Set savres_section_.
  55. 2015-08-25 Cary Coutant <ccoutant@gmail.com>
  56. PR gold/18847
  57. * script-sections.cc (Memory_region::set_address): New method.
  58. (Script_sections::find_memory_region): Add explicit_only parameter.
  59. (Output_section_definition::set_section_addresses): Handle case where
  60. script specifies both address and vma region.
  61. * script-sections.h (Script_sections::find_memory_region): Add
  62. explicit_only parameter.
  63. 2015-08-25 Cary Coutant <ccoutant@gmail.com>
  64. PR gold/18859
  65. * object.cc (Input_objects::add_object): Store objects in a map,
  66. indexed by soname; update as-needed flag when necessary.
  67. * object.h (Object::clear_as_needed): New method.
  68. (Input_objects::so_names_): Change from set to map.
  69. 2015-08-25 Cary Coutant <ccoutant@gmail.com>
  70. PR gold/14746
  71. * expression.cc (Expression::Expression_eval_info): Add
  72. is_valid_pointer field.
  73. (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
  74. Adjust all callers.
  75. (Addr_expression::value_from_output_section): Check whether address
  76. is valid.
  77. * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
  78. if evaluation failed due to address that is not yet valid.
  79. * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
  80. parameter.
  81. 2015-08-25 Cary Coutant <ccoutant@gmail.com>
  82. PR gold/18866
  83. PR gold/18703
  84. * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
  85. 2015-08-20 Alan Modra <amodra@gmail.com>
  86. PR gold/18846
  87. * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
  88. Subtract os->address() from addend.
  89. * powerpc.cc (relocate_relocs): Likewise.
  90. 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
  91. * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
  92. lazy_stub_normal_1, lazy_stub_normal_1_n64,
  93. lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
  94. lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
  95. lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
  96. lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
  97. of 'addu/daddu'.
  98. 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
  99. * configure: Regenerated.
  100. 2015-07-26 Doug Kwan <dougkwan@google.com>
  101. * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
  102. disassembler output format.
  103. 2015-07-23 Ian Coolidge <icoolidge@google.com>
  104. Plumb --pic-veneer option for gold.
  105. * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
  106. generation.
  107. * options.h (General_options): Add --pic-veneer option.
  108. 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
  109. PR gold/18663
  110. * testsuite/Makefile.am (script_test_1_SOURCES): Set to
  111. script_test_1a.cc script_test_1b.cc.
  112. (script_test_11_r.o): Replace script_test_11.o with
  113. script_test_11a.o script_test_11b.o.
  114. (script_test_11.o): Removed.
  115. (script_test_11a.o): New.
  116. (script_test_11b.o): Likewise.
  117. * testsuite/Makefile.in: Regenerated.
  118. * testsuite/script_test_1.h: New file.
  119. * testsuite/script_test_1b.cc: Likewise.
  120. * testsuite/script_test_11.h: Likewise.
  121. * testsuite/script_test_11b.c: Likewise.
  122. * testsuite/script_test_1.cc: Renamed to ...
  123. * testsuite/script_test_1a.cc: This.
  124. Include "script_test_1.h".
  125. (main): Call check_int and check_ptr.
  126. * testsuite/script_test_11.c: Renamed to ...
  127. * testsuite/script_test_11a.c: This.
  128. Include "script_test_11.h".
  129. (main): Call ptr_equal.
  130. 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
  131. PR gold/18628
  132. * testsuite/ifuncdep2.c (global): Change protected to hidden.
  133. * testsuite/ifuncmod1.c (global): Likewise.
  134. * testsuite/ifuncmod5.c (global): Likewise.
  135. 2015-07-22 Alan Modra <amodra@gmail.com>
  136. * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
  137. 2015-07-21 Cary Coutant <ccoutant@gmail.com>
  138. PR gold/18548
  139. * symtab.cc (Symbol_table::do_define_in_output_data): Check for
  140. forced local symbol even when oldsym != NULL.
  141. (Symbol_table::do_define_in_output_segment): Likewise.
  142. (Symbol_table::do_define_as_constant): Likewise.
  143. 2015-07-21 Cary Coutant <ccoutant@gmail.com>
  144. PR gold/18698
  145. * archive.cc (Library_base::should_include_member): Don't use entry
  146. point for relocatable links, or if target is not yet valid.
  147. * parameters.cc (Parameters::entry): Check target_valid().
  148. 2015-07-20 Han Shen <shenhan@google.com>
  149. Optimize erratum 843419 fix.
  150. * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
  151. (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
  152. (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
  153. (E843419_stub): New sub-class of Erratum_stub.
  154. (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
  155. (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
  156. (AArch64_relobj::create_erratum_stub): Add 1 argument.
  157. (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
  158. 2015-07-20 Han Shen <shenhan@google.com>
  159. Fix arm elf header flags wrt hardfp bit.
  160. * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
  161. 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
  162. PR gold/18689
  163. * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
  164. from input group section for relocatable link.
  165. * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
  166. (check_DATA): Add pr18689.stdout.
  167. (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
  168. (pr18689.stdout): New rule.
  169. (pr18689a.o): Likewise.
  170. (pr18689b.o): Likewise.
  171. (pr18689.o): Likewise.
  172. * testsuite/pr18689.c: New file.
  173. * testsuite/pr18689.sh: Likewise.
  174. * testsuite/Makefile.in: Regenerated.
  175. 2015-07-20 Yiran Wang <yiran@google.com>
  176. Cary Coutant <ccoutant@gmail.com>
  177. PR gold/15574
  178. * resolve.cc (Symbol_table): Remove warning about references
  179. from shared objects to hidden symbols.
  180. * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
  181. * testsuite/Makefile.in: Regenerate.
  182. * testsuite/hidden_test.sh: Check dynamic symbol table; update
  183. expected error messages.
  184. 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
  185. * compressed_output.cc (Output_compressed_section::set_final_data_size):
  186. Make --compress-debug-sections=zlib the same as
  187. --compress-debug-sections=zlib-gabi.
  188. * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
  189. Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
  190. ".zdebug_".
  191. * testsuite/Makefile.in: Regenerated.
  192. 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
  193. PR gold/18322
  194. * compressed_output.cc (zlib_compress): Add argument for
  195. compression header size. Set header size to compression header
  196. size if it isn't 0. Don't write out the zlib header here.
  197. (Output_compressed_section::set_final_data_size): Support
  198. zlib-gnu and zlib-gabi compressions. Pass compression header
  199. size to zlib_compress and write out compression header. Set
  200. the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
  201. clear the SHF_COMPRESSED bit
  202. * options.h (compress_debug_sections): Add zlib-gnu and
  203. zlib-gabi.
  204. * output.h (Output_section::set_flags): New.
  205. * testsuite/Makefile.am (check_PROGRAMS): Add
  206. flagstest_compress_debug_sections_none,
  207. flagstest_compress_debug_sections_gnu and
  208. flagstest_compress_debug_sections_gabi.
  209. (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
  210. flagstest_compress_debug_sections.stdout,
  211. flagstest_compress_debug_sections.cmp,
  212. flagstest_compress_debug_sections.check,
  213. flagstest_compress_debug_sections_gnu.stdout,
  214. flagstest_compress_debug_sections_gnu.cmp,
  215. flagstest_compress_debug_sections_gnu.check,
  216. flagstest_compress_debug_sections_gabi.stdout,
  217. flagstest_compress_debug_sections_gabi.cmp and
  218. flagstest_compress_debug_sections_gabi.check.
  219. (flagstest_compress_debug_sections_none): New.
  220. (flagstest_compress_debug_sections_none.stdout): Likewise.
  221. (flagstest_compress_debug_sections.stdout): Likewise.
  222. (flagstest_compress_debug_sections.check): Likewise.
  223. (flagstest_compress_debug_sections.cmp): Likewise.
  224. (flagstest_compress_debug_sections_gnu): Likewise.
  225. (flagstest_compress_debug_sections_gnu.stdout): Likewise.
  226. (flagstest_compress_debug_sections_gnu.check): Likewise.
  227. (flagstest_compress_debug_sections_gnu.cmp): Likewise.
  228. (flagstest_compress_debug_sections_gabi): Likewise.
  229. (flagstest_compress_debug_sections_gabi.stdout): Likewise.
  230. (flagstest_compress_debug_sections_gnu.check): Likewise.
  231. (flagstest_compress_debug_sections_gnu.cmp): Likewise.
  232. * testsuite/Makefile.in: Regenerated.
  233. 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
  234. PR gold/18321
  235. * compressed_output.h (decompress_input_section): Add arguments
  236. for ELF class, big endian and sh_flags.
  237. * compressed_output.cc (decompress_input_section): Likewise.
  238. Support the SHF_COMPRESSED section.
  239. * dynobj.h (Dynobj): Add elfsize and is_big_endian member
  240. functions.
  241. * plugin.h (Pluginobj): Likewise.
  242. * layout.cc (Layout::get_output_section_flags): Also clear the
  243. SHF_COMPRESSED bit.
  244. * object.h (Compressed_section_info): Add flag to store sh_flags.
  245. (Object): Add pure virtual elfsize and is_big_endian member
  246. functions.
  247. * object.cc (need_decompressed_section): Don't skip the ".zdebug"
  248. prefix here.
  249. (build_compressed_section_map): Check SHF_COMPRESSED for
  250. uncompressed size. Store sh_flags in Compressed_section_info.
  251. Pass size, big_endian and sh_flags to decompress_input_section.
  252. Skip the ".debug"/".zdebug" prefix when passing section name to
  253. need_decompressed_section.
  254. (Sized_relobj_file<size, big_endian>::do_find_special_section):
  255. Don't check ".zdebug_*" sections.
  256. (Object::decompressed_section_contents): Pass ELF class, big
  257. endian and sh_flags to decompress_input_section.
  258. * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
  259. Likewise.
  260. * testsuite/Makefile.am (check_DATA): Add
  261. debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
  262. (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
  263. gdb_index_test_2_gabi.stdout.
  264. (debug_msg_cdebug_gabi.o): New.
  265. (odr_violation1_cdebug_gabi.o): Likewise.
  266. (odr_violation2_cdebug_gabi.o): Likewise.
  267. (debug_msg_cdebug_gabi.err): Likewise.
  268. (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
  269. (gdb_index_test_cdebug_gabi.o): Likewise.
  270. (gdb_index_test_2_gabi): Likewise.
  271. (gdb_index_test_2_gabi.stdout): Likewise.
  272. * testsuite/gdb_index_test_2_gabi.sh: New file.
  273. * testsuite/Makefile.in: Regenerated.
  274. 2015-07-09 Han Shen <shenhan@google.com>
  275. Use "gold_info" instead of "gold_warning" for erratum fix.
  276. * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
  277. 'gold_info'.
  278. (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
  279. 2015-07-09 Han Shen <shenhan@google.com>
  280. Drop missing symbol warning for arm/aarch64.
  281. * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
  282. * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
  283. symbol warning.
  284. 2015-07-07 Han Shen <shenhan@google.com>
  285. Make gold aarch64 accept long form of mapping symbols.
  286. * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
  287. of mapping symbols.
  288. 2015-06-29 Doug Kwan <dougkwan@google.com>
  289. * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
  290. at address expected by test.
  291. * testsuite/arm_cortex_a8_b.s: Ditto.
  292. * testsuite/arm_cortex_a8_b_cond.s: Ditto.
  293. * testsuite/arm_cortex_a8_bl.s: Ditto.
  294. * testsuite/arm_cortex_a8_blx.s: Ditto.
  295. * testsuite/arm_cortex_a8_local.s: Ditto.
  296. * testsuite/arm_fix_v4bx.s: Ditto.
  297. * testsuite/arm_unaligned_reloc.s: Ditto.
  298. * testsuite/thumb_bl_out_of_range.s: Ditto.
  299. * testsuite/thumb_bl_out_of_range_local.s: Ditto.
  300. * testsuite/thumb_blx_out_of_range.s: Ditto.
  301. 2015-06-29 Han Shen <shenhan@google.com>
  302. Patch for erratum 843419 internal error.
  303. * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
  304. (Erratum_stub::update_erratum_insn): New method.
  305. (Stub_table::relocate_stubs): Modified to place relocated insn.
  306. (AArch64_relobj::fix_errata): Modified gold_assert.
  307. 2015-06-12 Han Shen <shenhan@google.com>
  308. Fix erratum 835769.
  309. * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
  310. defintion outside class definition.
  311. (AArch64_insn_utilities::AARCH64_ZR): New static constant.
  312. (AArch64_insn_utilities::aarch64_op31): New member.
  313. (AArch64_insn_utilities::aarch64_ra): New member.
  314. (AArch64_insn_utilities::aarch64_mac): New member.
  315. (AArch64_insn_utilities::aarch64_mlxl): New member.
  316. (ST_E_835769): New global enum member.
  317. (Stub_table::relocate_stubs): Add 835769 handler.
  318. (Stub_template_repertoire::Stub_template_repertoire): Install new
  319. stub type.
  320. (AArch64_relobj::scan_errata): This func is renamed from
  321. scan_erratum_843419.
  322. (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
  323. (AArch64_relobj::do_relocate_sections): Add 835769 handler.
  324. (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
  325. (Target_aarch64::scan_erratum_835769_span): New method.
  326. (Target_aarch64::create_erratum_stub): New method.
  327. (Target_aarch64::is_erratum_835769_sequence): New method.
  328. (Target_aarch64::scan_erratum_843419_sequence): Move part of the
  329. code into create_erratum_stub.
  330. * options.h (fix_cortex_a53_835769): New option.
  331. 2015-06-11 Cary Coutant <ccoutant@gmail.com>
  332. * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
  333. outside class body.
  334. (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
  335. 2015-06-11 Cary Coutant <ccoutant@gmail.com>
  336. PR gold/17731
  337. * layout.cc (corresponding_uncompressed_section_name): New function.
  338. (Layout::choose_output_section): Call it.
  339. * layout.h (corresponding_uncompressed_section_name): New function.
  340. * script-sections.cc (Input_section_info::set_section_name): Check
  341. for compressed debug section (.zdebug style).
  342. 2015-06-11 Jing Yu <jingyu@google.com>
  343. * testsuite/Makefile.am: Add -O0 for script_test_12 test.
  344. * testsuite/Makefile.in: Regenerate.
  345. 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
  346. * gold.h (is_cident): Correct typo.
  347. 2015-06-10 Han Shen <shenhan@google.com>
  348. Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
  349. Now fixing for 843419 is fully functional.
  350. The first part of the erratum fix CL is here -
  351. https://sourceware.org/ml/binutils/2015-04/msg00229.html
  352. * aarch64.cc(global enum): New constants representing stub types.
  353. (Stub_template): New POD struct.
  354. (Stub_template_repertoire): New class.
  355. (Stub_base): New class.
  356. (Erratum_stub): New class.
  357. (Reloc_stub): Refactored to be a subclass of Stub_base.
  358. (Reloc_stub::Stub_type): Removed.
  359. (Reloc_stub::offset): Moved to Stub_base.
  360. (Reloc_stub::set_offset): Moved to Stub_base.
  361. (Reloc_stub::destination_address): Moved to Stub_base.
  362. (Reloc_stub::set_destination_address): Moved to Stub_base.
  363. (Reloc_stub::reset_destination_address): Moved to Stub_base.
  364. (Reloc_stub::stub_type): Renamed and moved to Stub_base.
  365. (Reloc_stub::stub_size): Renamed and moved to Stub_base.
  366. (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
  367. (Reloc_stub::write): Moved to Stub_base.
  368. (Reloc_stub::invalid_offset): Moved to Stub_base.
  369. (Reloc_stub::invalid_address): Moved to Stub_base.
  370. (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
  371. (Reloc_stub::stub_insns_): Moved to Stub_base.
  372. (Reloc_stub::offset_): Moved to Stub_base.
  373. (Reloc_stub::destination_address_): Moved to Stub_base.
  374. (Stub_table::The_aarch64_relobj): New typedef.
  375. (Stub_table::The_erratum_stub): New typedef.
  376. (Stub_table::The_erratum_stub_less): New typedef.
  377. (Stub_table::The_erratum_stub_set): New typedef.
  378. (Stub_table::The_erratum_stub_set_iter): New typedef.
  379. (Stub_table::empty): Added emptiness testing for erratum stubs.
  380. (Stub_table::add_erratum_stub): New method to add an erratum stub.
  381. (Stub_table::find_erratum_stub): New method.
  382. (Stub_table::find_erratum_stubs_for_input_section): New method.
  383. (Stub_table::erratum_stub_address): New method.
  384. (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
  385. (Stub_table::do_addralign): Modified to handle erratum stubs.
  386. (Stub_table::erratum_stubs_): New member.
  387. (Stub_table::erratum_stub_size_): New member.
  388. (Stub_table::relocate_stubs): Modified to handle erratum stubs.
  389. (Stub_table::do_write): Modified to handle erratum stubs.
  390. (AArch64_relobj::The_erratum_stub): New typedef.
  391. (AArch64_relobj::Erratum_stub_set_iter): New typedef.
  392. (AArch64_relobj::fix_errata): New method.
  393. (Target_aarch64::The_reloc_stub_type): Removed.
  394. (Target_aarch64::The_erratum_stub): New typede.
  395. (AArch64_relocate_functions::construct_b): New method.
  396. 2015-06-08 Nick Clifton <nickc@redhat.com>
  397. * po/fr.po: New French Translation.
  398. 2015-06-07 Cary Coutant <ccoutant@gmail.com>
  399. PR gold/18288
  400. * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
  401. callers. Don't use STT_COMMON to check for common symbols.
  402. (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
  403. symbol that's not in a common section.
  404. * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
  405. common symbols.
  406. 2015-06-04 Cary Coutant <ccoutant@gmail.com>
  407. PR gold/18200
  408. * Makefile.am (diststuff): Add target.
  409. * Makefile.in: Regenerate.
  410. 2015-06-04 Cary Coutant <ccoutant@gmail.com>
  411. PR gold/17498
  412. * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
  413. temporary locals in merge sections.
  414. * options.cc (General_options::parse_discard_all): New method.
  415. (General_options::parse_discard_locals): New method.
  416. (General_options::parse_discard_none): New method.
  417. (General_options::General_options): Initialize discard_locals_.
  418. * options.h (--discard-all): Convert to special option.
  419. (--discard-locals): Likewise.
  420. (--discard-none): New option.
  421. (General_options::discard_all): New method.
  422. (General_options::discard_locals): New method.
  423. (General_options::discard_sec_merge): New method.
  424. (General_options::Discard_locals): New enum.
  425. (General_options::discard_locals_): New data member.
  426. 2015-06-03 Cary Coutant <cary@google.com>
  427. * script-sections.cc (Script_sections::Script_sections): Initialize
  428. segments_created_.
  429. (Script_sections::create_note_and_tls_segments): Set flag when
  430. segments are created.
  431. (Script_sections::expected_segment_count): Count PT_INTERP.
  432. (Script_sections::attach_sections_using_phdrs_clause): Set flag when
  433. segments are created.
  434. * script-sections.h (Script_sections::segments_created_): New data
  435. member.
  436. 2015-06-03 Cary Coutant <ccoutant@gmail.com>
  437. PR gold/15370
  438. * script-sections.cc
  439. (Output_section_element_input::set_section_addresses): When there
  440. are several patterns with no sort spec, put all sections in the same
  441. bin.
  442. * testsuite/Makefile.am (script_test_12): New testcase.
  443. (script_test_12i): New testcase.
  444. * testsuite/Makefile.in: Regenerate.
  445. * testsuite/script_test_12.t: New test linker script.
  446. * testsuite/script_test_12i.t: New test linker script.
  447. * testsuite/script_test_12a.c: New test source file.
  448. * testsuite/script_test_12b.c: New test source file.
  449. 2015-06-02 Cary Coutant <ccoutant@gmail.com>
  450. * nacl.h (Sniff_file): Switch parameters to get_view to get an
  451. aligned view.
  452. 2015-06-03 Cary Coutant <ccoutant@gmail.com>
  453. PR gold/17819
  454. * gold.cc (queue_final_tasks): When --build-id=tree, queue a
  455. separate task to schedule the build id computation.
  456. * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
  457. add Output_file and offset.
  458. (Hash_task::run): Get and release the input views.
  459. (Hash_task::is_runnable): Always return NULL (always runnable).
  460. (Layout::queue_build_id_tasks): Remove.
  461. (Layout::write_build_id): Add array_of_hashes and size_of_hashes
  462. parameters; use them instead of class members.
  463. (Build_id_task_runner::run): New function.
  464. (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
  465. to write_build_id.
  466. * layout.h (Layout::queue_build_id_tasks): Remove.
  467. (Layout::write_build_id): Add array_of_hashes and size_of_hashes
  468. parameters.
  469. (Layout::array_of_hashes_): Remove.
  470. (Layout::size_of_array_of_hashes_): Remove.
  471. (Layout::input_view_): Remove.
  472. (Build_id_task_runner): New class.
  473. (Close_task_runner::Close_task_runner): Add array_of_hashes and
  474. size_of_hashes parameters.
  475. (Close_task_runner::array_of_hashes_): New data member.
  476. (Close_task_runner::size_of_hashes_): New data member.
  477. * testsuite/Makefile.am
  478. (flagstest_compress_debug_sections_and_build_id_tree): New test.
  479. * testsuite/Makefile.in: Regenerate.
  480. 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  481. * merge.cc (get_input_merge_map): Update for data structure change.
  482. (get_or_make_input_merge_map): Update for data structure change.
  483. * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
  484. a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
  485. 2015-05-16 Alan Modra <amodra@gmail.com>
  486. * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
  487. * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
  488. (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
  489. (lis_0): Rename from lis_0_0.
  490. 2015-04-29 Cary Coutant <cary@google.com>
  491. Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  492. * gc.h (Garbage_collection::is_section_garbage): Change Object*
  493. to Relobj*.
  494. (Garbage_collection::add_reference): Likewise.
  495. (Garbage_collection::gc_process_relocs): Likewise. Don't push
  496. object/shndx pair onto *secvec for dynamic objects. Don't follow
  497. relocations pointing to dynamic objects for GC.
  498. * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
  499. (Icf::unfold_section): Likewise.
  500. (Icf::is_section_folded): Likewise.
  501. (Icf::get_folded_section): Likewise.
  502. * icf.h: (Icf::get_folded_section): Likewise.
  503. (Icf::unfold_section): Likewise.
  504. (Icf::is_section_folded): Likewise.
  505. (Icf::section_has_function_pointers): Likewise.
  506. (Icf::set_section_has_function_pointers): Likewise.
  507. * object.h (Section_id): Likewise.
  508. (Const_section_id): Likewise.
  509. * output.cc (Output_section::update_section_layout): Likewise.
  510. * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
  511. Likewise.
  512. * plugin.cc (update_section_order): Likewise.
  513. (unique_segment_for_sections): Likewise.
  514. * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
  515. (Target_powerpc::do_gc_add_reference): Likewise.
  516. (Target_powerpc::gc_process_relocs): Likewise.
  517. (Target_powerpc::do_gc_add_reference): Likewise.
  518. * symtab.cc (Symbol_table::is_section_folded): Likewise.
  519. (Symbol_table::gc_mark_symbol): Likewise.
  520. * symtab.h: (Symbol_table::is_section_folded): Likewise.
  521. * target.h: (Sized_target::gc_add_reference): Likewise.
  522. (Sized_target::do_gc_add_reference): Likewise.
  523. 2015-04-29 Nick Clifton <nickc@redhat.com>
  524. * po/fi.po: Updated Finnish translation.
  525. 2015-04-28 Alan Modra <amodra@gmail.com>
  526. * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
  527. than unsigned int for find_global_entry result temp. Compare
  528. against invalid_address.
  529. (Target_powerpc::do_plt_address_for_global): Likewise.
  530. (Target_powerpc::Relocate::relocate): Likewise. Don't assert
  531. on plt call stub existence for debug info. Do assert for plt
  532. and global entry stub existence if an alloc section.
  533. 2015-04-28 Alan Modra <amodra@gmail.com>
  534. * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
  535. on missing global entry stub due to bogus debug info.
  536. 2015-04-27 Han Shen <shenhan@google.com>
  537. * options.h (--fix-cortex-a53-843419): Rename option.
  538. * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
  539. option.
  540. (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
  541. 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  542. PR gold/18327
  543. * output.cc (Output_section::is_input_address_mapped): Assume a missing
  544. entry is mapped.
  545. * testsuite/Makefile.am: Add the eh_test test.
  546. * testsuite/Makefile.in: Regenerate.
  547. * testsuite/eh_test_a.cc: New test.
  548. * testsuite/eh_test_b.cc: New test.
  549. 2015-04-23 Sriraman Tallam <tmsriram@google.com>
  550. * options.h (--weak-unresolved-symbols): New option.
  551. * symtab.cc (Symbol_table::sized_write_globals): Change symbol
  552. binding to weak with new option.
  553. * symtab.h (is_weak_undefined): Check for new option.
  554. (is_strong_undefined): Check for new option.
  555. * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
  556. * testsuite/Makefile.in: Regenerate.
  557. * testsuite/weak_unresolved_symbols_test.cc: New file.
  558. 2015-04-20 Ian Coolidge <icoolidge@google.com>
  559. * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
  560. GNU_UNIQUE.
  561. 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  562. * gc.cc (Garbage_collection::do_transitive_closure): Use back and
  563. push_back.
  564. * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
  565. * object.cc (Sized_relobj_file::do_layout): Use push_back.
  566. * powerpc.cc (process_gc_mark): Use push_back.
  567. (Target_powerpc::do_gc_mark_symbol): Use push_back.
  568. * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
  569. 2015-04-16 Han Shen <shenhan@google.com>
  570. * aarch64.cc (AArch64_insn_utilities): New utility class.
  571. (AArch64_relobj::Mapping_symbol_position): New struct.
  572. (AArch64_relobj::Mapping_symbol_info): New typedef.
  573. (AArch64_relobj::do_count_local_symbols): New function overriding
  574. parent's implementation.
  575. (AArch64_relobj::mapping_symbol_info_): New member
  576. (AArch64_relobj::scan_erratum_843419): New method.
  577. (Target_aarch64::scan_erratum_843419_span): New method.
  578. (Target_aarch64::is_erratum_843419_sequence): New method.
  579. * options.h (fix_cortex_a53): New option.
  580. 2015-04-09 Cary Coutant <ccoutant@google.com>
  581. * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
  582. in a PIE link.
  583. * testsuite/Makefile.am (tls_pie_test.sh): New test.
  584. * testsuite/Makefile.in: Regenerate.
  585. * testsuite/tls_pie_test.sh: New.
  586. 2015-04-09 Cary Coutant <ccoutant@google.com>
  587. * debug.h (DEBUG_LOCATION): New.
  588. (DEBUG_ALL): Include DEBUG_LOCATION.
  589. (debug_string_to_enum): Add DEBUG_LOCATION.
  590. * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
  591. output to print correct context.
  592. (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
  593. up to 4 more locations at the beginning of the function.
  594. * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
  595. result before sorting list of line numbers.
  596. * testsuite/debug_msg.sh: Allow range of line numbers for
  597. canonical results on optimized code.
  598. 2015-04-07 HC Yen <hc.yen@mediatek.com>
  599. Add AArch32 support for gold linker.
  600. gold/
  601. * arm.cc: Add V8 arch combine table.
  602. 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  603. * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
  604. 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  605. * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
  606. to find by using the return value of insert.
  607. 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  608. * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
  609. constructor call.
  610. 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
  611. PR gold/17641
  612. * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
  613. (Target_x86_64::Scan::local): Don't create GOT entry, when we
  614. can convert mov to lea.
  615. (Target_x86_64::Scan::global): Ditto.
  616. (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
  617. %reg to lea foo(%rip), %reg if possible.
  618. * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
  619. * testsuite/x86_64_mov_to_lea1.s: New.
  620. * testsuite/x86_64_mov_to_lea2.s: Ditto.
  621. * testsuite/x86_64_mov_to_lea3.s: Ditto.
  622. * testsuite/x86_64_mov_to_lea4.s: Ditto.
  623. * testsuite/x86_64_mov_to_lea.sh: Ditto.
  624. 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
  625. * configure: Regenerated.
  626. 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
  627. PR gold/17640
  628. * i386.cc (Target_i386::can_convert_mov_to_lea): New.
  629. (Target_i386::Scan::local): Don't create GOT entry, when we
  630. can convert GOT to GOTOFF.
  631. (Target_i386::Scan::global): Ditto.
  632. (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
  633. lea foo@GOTOFF(%reg), %reg if possible.
  634. * testsuite/Makefile.am (i386_mov_to_lea): New test.
  635. * testsuite/i386_mov_to_lea1.s: New.
  636. * testsuite/i386_mov_to_lea2.s: Ditto.
  637. * testsuite/i386_mov_to_lea3.s: Ditto.
  638. * testsuite/i386_mov_to_lea4.s: Ditto.
  639. * testsuite/i386_mov_to_lea5.s: Ditto.
  640. * testsuite/i386_mov_to_lea.sh: Ditto.
  641. 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
  642. * Makefile.am (ZLIB): New.
  643. (ZLIBINC): Likewise.
  644. (AM_CFLAGS): Add $(ZLIBINC).
  645. (AM_CXXFLAGS): Likewise.
  646. (ldadd_varldadd_var): Add $(ZLIB).
  647. (incremental_dump_LDADD): Likewise.
  648. (dwp_LDADD): Likewise.
  649. * compressed_output.cc: Don't check HAVE_ZLIB_H to include
  650. <zlib.h>.
  651. (zlib_compress): Don't check HAVE_ZLIB_H.
  652. (zlib_decompress): Likewise.
  653. * options.h (compress_debug_sections): Likewise.
  654. * configure.ac (AM_CONDITIONAL): Removed.
  655. * testsuite/Makefile.am (ZLIB): New.
  656. (LDADD): Add $(ZLIB).
  657. Don't check HAVE_ZLIB.
  658. * Makefile.in: Regenerated.
  659. * config.in: Likewise.
  660. * configure: Likewise.
  661. * testsuite/Makefile.in: Likewise.
  662. 2015-03-30 Jing Yu <jingyu@google.com>
  663. * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
  664. TLSLD_ADD_DTPREL_LO12_NC.
  665. * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
  666. _TLS_MODULE_BASE_ point to the start of tls segment.
  667. (Target_aarch64::optimize_tls_reloc): Add cases for
  668. R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
  669. R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
  670. (Target_aarch64::Scan::local): Likewise.
  671. (Target_aarch64::Scan::global): Likewise.
  672. (Target_aarch64::Relocate::relocate): Likewise.
  673. (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
  674. subtracting tls segment size from symbol value for TLSLD_*_DTPREL
  675. relocations.
  676. 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  677. * merge.cc (Object_merge_map::add_mapping): call
  678. Object_merge_map::Input_merge_map::add_mapping.
  679. (Object_merge_map::Input_merge_map::add_mapping): New.
  680. (Output_merge_data::do_add_input_section): Call
  681. get_or_make_input_merge_map before a loop.
  682. (Output_merge_string<Char_type>::finalize_merged_data): Call
  683. get_or_make_input_merge_map before a loop.
  684. * merge.h (Object_merge_map): Make Input_merge_map public.
  685. * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
  686. (Relobj::get_or_create_merge_map): New.
  687. * object.h (Relobj::get_or_create_merge_map): New.
  688. 2015-03-24 Alan Modra <amodra@gmail.com>
  689. PR 18147
  690. * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
  691. relocation errors for branches to strong undefined symbols.
  692. 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  693. * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
  694. (Object_merge_map::is_merge_section_for): Remove.
  695. (Object_merge_map::find_merge_section): New.
  696. * merge.h (Object_merge_map::is_merge_section_for): Remove.
  697. (Object_merge_map::find_merge_section): New.
  698. (Object_merge_map::get_input_merge_map): Add a const version.
  699. * object.cc (Relobj::is_merge_section_for): Remove.
  700. (Relobj::find_merge_section): New.
  701. * object.h (Relobj::is_merge_section_for): Remove.
  702. (Relobj::find_merge_section): New.
  703. * output.cc
  704. (Output_section::Input_section::is_merge_section_for): Remove.
  705. (Output_section::add_merge_input_section): Don't call
  706. add_merge_input_section.
  707. (Output_section::find_merge_section): Return const. Use
  708. object->find_merge_section.
  709. (Output_section::build_lookup_maps): Don't build a map for
  710. merge sections.
  711. (Output_section::is_input_address_mapped): Return false if
  712. section is not found.
  713. (Output_section::find_starting_output_address): Use
  714. find_merge_section instead of is_merge_section_for.
  715. (Output_section::add_script_input_section): Don't build a map for
  716. merge sections.
  717. * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
  718. (Output_section_lookup_maps::find_merge_section): Remove.
  719. (Output_section_lookup_maps::add_merge_input_section) Remove.
  720. (Output_section::find_merge_section): Return const.
  721. 2015-03-22 Cary Coutant <cary@google.com>
  722. PR gold/18106
  723. * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
  724. non-SIB form of lea, with nop after the call.
  725. 2015-03-21 Cary Coutant <cary@google.com>
  726. PR gold/14217
  727. * output.cc (Output_segment::is_first_section_relro): Don't ignore
  728. .tdata section.
  729. (Output_segment::set_section_addresses): Don't align size of relro
  730. segment for .tbss.
  731. 2015-03-21 Cary Coutant <cary@google.com>
  732. PR gold/18010
  733. * stringpool.cc (Stringpool_template): Don't optimize if section
  734. alignment is greater than sizeof(char).
  735. 2015-03-21 Cary Coutant <cary@google.com>
  736. PR gold/18048
  737. * script-c.h (script_include_directive): Add first_token parameter.
  738. * script.cc (script_include_directive): Add first_token parameter, and
  739. pass it to read_script_file.
  740. * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
  741. (PARSING_MEMORY_DEF): New tokens.
  742. (top): Add new productions for INCLUDE files.
  743. (file_cmd): Replace file_or_sections_cmd with copy of its productions.
  744. Pass PARSING_LINKER_SCRIPT to script_include_directive.
  745. (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
  746. (section_cmd): Pass PARSING_SECTION_CMDS.
  747. (file_or_sections_cmd): Remove.
  748. (memory_def): Pass PARSING_MEMORY_DEF.
  749. * testsuite/Makefile.am (memory_test_2): New test.
  750. * testsuite/Makefile.in: Regenerate.
  751. * testsuite/memory_test_inc.t: New script file.
  752. * testsuite/memory_test_inc_1.t.src: New script file.
  753. * testsuite/memory_test_inc_2.t.src: New script file.
  754. * testsuite/memory_test_inc_3.t.src: New script file.
  755. 2015-03-21 Cary Coutant <cary@google.com>
  756. * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
  757. (Sized_relobj_dwo::setup): Build compressed section map.
  758. (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
  759. * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
  760. section map.
  761. * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
  762. compressed_sections_ field.
  763. (build_compressed_section_map): Take Object instead of
  764. Sized_relobj_file parameter; add decompress_if_needed parameter.
  765. (Sized_relobj_file::do_find_special_sections): Store compressed
  766. section map in parent Object.
  767. (Sized_relobj_file::do_decompressed_section_contents): Move
  768. implementation to Object::decompressed_section_contents.
  769. (Sized_relobj_file::do_discard_decompressed_sections): Move
  770. implementation to Object::discard_decompressed_sections.
  771. * object.h (build_compressed_section_map): Declare.
  772. (Object::Object): Add compressed_sections_ field.
  773. (Object::section_is_compressed): Move implementation here.
  774. (Object::decompressed_section_contents): De-virtualize.
  775. (Object::discard_decompressed_sections): De-virtualize.
  776. (Object::do_section_is_compressed): Delete.
  777. (Object::do_decompressed_section_contents): Delete.
  778. (Object::set_compressed_sections): New method.
  779. (Object::compressed_sections): New method.
  780. (Object::compressed_sections_): New data member.
  781. (Compressed_section_info, Compressed_section_map): Move to top of file.
  782. (Sized_relobj_file::do_section_is_compressed): Delete.
  783. (Sized_relobj_file::do_decompressed_section_contents): Delete.
  784. (Sized_relobj_file::do_discard_decompressed_sections): Delete.
  785. (Sized_relobj_file::compressed_sections_): Move to Object class.
  786. 2015-03-21 Cary Coutant <ccoutant@google.com>
  787. PR gold/18152
  788. * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
  789. deferred objects.
  790. 2015-03-11 Cary Coutant <ccoutant@google.com>
  791. * options.cc (General_options::finalize): Don't allow -z relro
  792. with incremental linking.
  793. * testsuite/Makefile.am (incremental_test): Add -z norelro.
  794. (incremental_test_2): Likewise.
  795. (incremental_test_3): Likewise.
  796. (incremental_test_4): Likewise.
  797. (incremental_test_5): Likewise.
  798. (incremental_test_6): Likewise.
  799. (incremental_copy_test): Likewise.
  800. (incremental_common_test_1): Likewise.
  801. (incremental_comdat_test_1): Likewise.
  802. * testsuite/Makefile.in: Regenerate.
  803. 2015-03-09 Cary Coutant <ccoutant@google.com>
  804. PR gold/14675
  805. * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
  806. return enum indicating whether .eh_frame section is empty, optimizable,
  807. unrecognized, or an end marker. Adjust explicit instantiations.
  808. * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
  809. (Eh_frame::add_ehframe_input_section): Change return type.
  810. * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
  811. * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
  812. to the .eh_frame output section until we see the end marker.
  813. (Layout::finalize_eh_frame_section): New.
  814. * layout.h: (Layout::finalize_eh_frame_section): New.
  815. 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
  816. * output.cc (Relobj::initialize_input_to_output_map<size>):
  817. Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
  818. 2015-03-04 Cary Coutant <ccoutant@google.com>
  819. * parameters.cc (Parameters::set_target_once): Call
  820. Target::select_as_default_target just once from here...
  821. (set_parameters_target): ...instead of from here.
  822. 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  823. * ehframe.cc (Cie::set_output_offset): Pass in and use a
  824. Output_section_data instead of a Merge_map.
  825. (Eh_frame::Eh_frame): Don't initialize merge_map_.
  826. (Eh_frame::read_cie): Use add_merge_mapping instead of
  827. Merge_map::add_mapping.
  828. (Eh_frame::read_fde): Ditto.
  829. (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
  830. (Eh_frame::do_output_offset): Use merge_output_offset istead of
  831. merge_map_->get_output_offset.
  832. (Eh_frame::do_is_merge_section_for): Delete.
  833. * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
  834. instead of a Merge_map.
  835. (Cie::set_output_offset): Pass in a Output_section_data instead of a
  836. Merge_map.
  837. (Eh_frame::do_is_merge_section_for): Delete.
  838. (Eh_frame::merge_map_): Delete.
  839. * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
  840. and use a Output_section_data instead of a Merge_map.
  841. (Object_merge_map::add_mapping): Ditto.
  842. (Object_merge_map::get_output_offset): Remove the merge_map argument.
  843. (Object_merge_map::is_merge_section_for): Pass in and use a
  844. Output_section_data instead of a Merge_map.
  845. (Merge_map): Delete.
  846. (Output_merge_base::do_output_offset): Use merge_output_offset instead
  847. of merge_map_.get_output_offset.
  848. (Output_merge_base::do_is_merge_section_for): Delete.
  849. (Output_merge_data::do_add_input_section): Use
  850. object->add_merge_mapping instead of add_mapping.
  851. (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
  852. * merge.h (Merge_map): Delete forward declaration.
  853. (Object_merge_map::add_mapping): Pass in and use a Output_section_data
  854. instead of a Merge_map.
  855. (Object_merge_map::get_output_offset): Remove the merge_map argument.
  856. (Object_merge_map::is_merge_section_for): Pass in and use a
  857. Output_section_data instead of a Merge_map.
  858. (Input_merge_map::Object_merge_map::merge_map): Replace with
  859. output_data.
  860. (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
  861. Output_section_data instead of a Merge_map.
  862. (Merge_map): Delete.
  863. (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
  864. (Output_merge_base::do_is_merge_section_for): Delete.
  865. (Output_merge_base::add_mapping): Delete.
  866. (Output_merge_base::merge_map_): Delete.
  867. * object.cc (Relobj::initialize_input_to_output_map): New.
  868. (Relobj::initialize_input_to_output_map): New.
  869. (Relobj::merge_output_offset): New.
  870. (Relobj::is_merge_section_for): New.
  871. (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
  872. bits.
  873. * object.h (Relobj::merge_map): Delete.
  874. (initialize_input_to_output_map): New.
  875. (set_merge_map): Delete.
  876. (add_merge_mapping): New.
  877. (merge_output_offset): New.
  878. (is_merge_section_for): New.
  879. * output.cc (Output_section::Input_section::is_merge_section_for):
  880. Use object->is_merge_section_for.
  881. * output.h (Output_section_data::is_merge_section_for): Delete.
  882. (Output_section_data::do_is_merge_section_for): Delete.
  883. * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
  884. Use object->initialize_input_to_output_map.
  885. (Merged_symbol_value<size>::value_from_output_section): Use
  886. object->merge_output_offset.
  887. 2015-03-02 Peter Collingbourne <pcc@google.com>
  888. Cary Coutant <ccoutant@google.com>
  889. * output.cc (Output_section::add_merge_input_section): Do not
  890. attempt to merge sections with an entsize of 0.
  891. 2015-03-02 Khem Raj <raj.khem@gmail.com>
  892. * attributes.h (class Output_attributes_section_data ): Add
  893. do_print_to_mapfile function.
  894. 2015-02-24 Alan Modra <amodra@gmail.com>
  895. PR 18010
  896. * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
  897. complain if value is not a multiple of four.
  898. (Target_powerpc::Relocate::relocate): Correct handling of
  899. R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
  900. 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
  901. * configure.ac (default_size): Set to 32 for x32.
  902. * configure: Regenerated.
  903. 2015-02-18 Alan Modra <amodra@gmail.com>
  904. PR 17954
  905. * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
  906. visibility.
  907. 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  908. * gc.h (Garbage_collection::add_reference): Don't use find.
  909. 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  910. * object.cc (write_local_symbols): avoid std::vector copy.
  911. 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  912. * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
  913. 2015-02-09 Mark Wielaard <mjw@redhat.com>
  914. * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
  915. DW_LANG_Fortran03 and DW_LANG_Fortran08.
  916. 2015-02-16 Cary Coutant <ccoutant@google.com>
  917. PR gold/13577
  918. PR gold/16992
  919. * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
  920. DF_SYMBOLIC if --dynamic-list option is used.
  921. * options.cc (General_options::finalize): --dynamic-list is not
  922. mutually exclusive with -Bsymbolic.
  923. * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
  924. listed in --dynamic-list.
  925. * testsuite/Makefile.am (dynamic_list_lib2.so): Add
  926. -Bsymbolic-functions.
  927. * testsuite/Makefile.in: Regenerate.
  928. 2015-02-16 Cary Coutant <ccoutant@google.com>
  929. PR gold/17971
  930. * incremental.cc: Remove redundant include of "output.h".
  931. 2015-02-12 Jing Yu <jingyu@google.com>
  932. * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
  933. TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
  934. New relocation.
  935. * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
  936. TLSLE_MOVW_* relocations.
  937. (Target_aarch64::Scan::global): Likewise.
  938. (Target_aarch64::Relocate::relocate): Likewise.
  939. (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
  940. for new TLSLE_MOVW_* relocations.
  941. 2015-02-11 Will Newton <will.newton@linaro.org>
  942. PR gold/13321
  943. * arm.cc (Target_arm::make_plt_section): Create an ARM
  944. state mapping symbol at the start of the PLT.
  945. 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
  946. * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
  947. Replace two_file_shared_2.so with two_file_shared_1.so.
  948. * testsuite/Makefile.in: Regenerated.
  949. 2015-02-09 Alan Modra <amodra@gmail.com>
  950. * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
  951. plugin_test_thin.a and defsym_test.
  952. * testsuite/Makefile.in: Regenerate.
  953. 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  954. * merge.cc (do_add_input_section): Combine loop epilogue into main loop
  955. body.
  956. 2015-02-04 Peter Collingbourne <pcc@google.com>
  957. * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
  958. forwarding symbols when computing symbol resolution info for plugins.
  959. * plugin.h (Plugin_manager::symtab): New method.
  960. (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
  961. 2015-02-03 Cary Coutant <ccoutant@google.com>
  962. Peter Collingbourne <pcc@google.com>
  963. PR gold/15660
  964. * archive.cc (Thin_archive_object_unlocker): New class.
  965. (Archive::include_member): Unlock external members of thin archives.
  966. * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
  967. (plugin_test_2): Likewise.
  968. (plugin_test_3): Likewise.
  969. (plugin_test_4): Likewise.
  970. (plugin_test_5): Likewise.
  971. (plugin_test_6): Likewise.
  972. (plugin_test_7): Likewise.
  973. (plugin_test_8): Likewise.
  974. (plugin_test_9): Likewise.
  975. (plugin_test_10): Likewise.
  976. (plugin_test_11): New test case.
  977. * testsuite/Makefile.in: Regenerate.
  978. * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
  979. file to decide whether to claim file.
  980. (all_symbols_read_hook): Likewise.
  981. * testsuite/plugin_test_1.sh: Adjust expected output.
  982. * testsuite/plugin_test_2.sh: Likewise.
  983. * testsuite/plugin_test_3.sh: Likewise.
  984. * testsuite/plugin_test_6.sh: Likewise.
  985. * testsuite/plugin_test_tls.sh: Likewise.
  986. * testsuite/plugin_test_11.sh: New testcase.
  987. 2015-02-03 Cary Coutant <ccoutant@google.com>
  988. * descriptors.cc (Descriptors::open): Set artificially-low limit for
  989. file descriptors when debugging enabled. Add debug output.
  990. (Descriptors::release): Add debug output.
  991. (Descriptors::close_some_descriptor): Likewise.
  992. (Descriptors::close_all): Likewise.
  993. * fileread.cc (File_read::lock): Likewise.
  994. (File_read::unlock): Likewise.
  995. 2015-02-02 Cary Coutant <ccoutant@google.com>
  996. * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
  997. executable output file.
  998. 2015-01-22 Han Shen <shenhan@google.com>
  999. * arm.cc (Target_arm::Target_arm): Add initialization for new members.
  1000. (Target_arm::do_plt_address_for_global): New method.
  1001. (Target_arm::do_plt_address_for_local): New method.
  1002. (Target_arm::rel_irelative_section): New method.
  1003. (Target_arm::make_data_plt): Add more parameters for plt ctor.
  1004. (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
  1005. (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
  1006. (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
  1007. (Target_arm::Scan::check_non_pic): Add ifunc support.
  1008. (Target_arm::Scan::local): Add ifunc support.
  1009. (Target_arm::Scan::global): Add ifunc support.
  1010. (Target_arm::make_plt_section): New method.
  1011. (Target_arm::make_plt_entry): Change to call to make_plt_section.
  1012. (Target_arm::make_local_ifunc_plt_entry): New method.
  1013. (Target_arm::got_irelative_): New member.
  1014. (Target_arm::rel_irelative_): New member.
  1015. (Target_arm::got_section): Add creation for got_irelative_.
  1016. (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
  1017. (Target_arm::Relocate::relocate): Properly set local ifunc address.
  1018. (Target_arm::do_dynsym_value): Properly set global ifunc address.
  1019. (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
  1020. (Output_data_plt_arm::IRelative_data): New type.
  1021. (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
  1022. (Output_data_plt_arm::add_entry): Add more parameters.
  1023. (Output_data_plt_arm::add_relocation): New method.
  1024. (Output_data_plt_arm::add_local_ifunc_entry): New method.
  1025. (Output_data_plt_arm::rel_irelative): New method.
  1026. (Output_data_plt_arm::entry_count): Modified.
  1027. (Output_data_plt_arm::address_for_global): New method.
  1028. (Output_data_plt_arm::address_for_local): New method.
  1029. gold/
  1030. (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
  1031. (Output_data_plt_arm::insert_irelative_data): New method.
  1032. (Output_data_plt_arm::irelative_rel_): New member.
  1033. (Output_data_plt_arm::got_): New member.
  1034. (Output_data_plt_arm::got_irelative_): New member.
  1035. (Output_data_plt_arm::irelative_count_): New member.
  1036. (Output_data_plt_arm::IRelative_data_vec): New typedef.
  1037. (Output_data_plt_arm::irelative_data_vec_): New member.
  1038. (Output_data_plt_arm::do_write): Write out irelative entries.
  1039. (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
  1040. more parameters to ctor.
  1041. (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
  1042. more parameters to ctor.
  1043. * output.h (Output_data_reloc::add_local_relative): New method.
  1044. * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
  1045. 2015-01-29 Alan Modra <amodra@gmail.com>
  1046. * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
  1047. and GOT_TLSGD to LE optimization.
  1048. 2015-01-28 Cary Coutant <ccoutant@google.com>
  1049. * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
  1050. for undef TLS symbols.
  1051. (Target_x86_64::Relocate::relocate_tls): Likewise.
  1052. (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
  1053. 2015-01-25 Cary Coutant <ccoutant@google.com>
  1054. * output.cc (Output_segment::set_section_addresses): Fix calculation
  1055. of size of relro segment.
  1056. 2015-01-22 Alan Modra <amodra@gmail.com>
  1057. * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
  1058. condition for need of ifunc plt entry.
  1059. (Target_powerpc::Scan::global <got relocs>): Likewise.
  1060. 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1061. * mips.cc (reloc_high): Add r_sym.
  1062. (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
  1063. reloc_high constructor.
  1064. (Mips_relocate_functions::relgot16_local): Likewise.
  1065. (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
  1066. r_type to decide whether LO16 matches HI16.
  1067. (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
  1068. rello16 and relgot16_local.
  1069. 2015-01-09 Cary Coutant <ccoutant@google.com>
  1070. * layout.cc (Layout::set_segment_offsets): Don't align start of segment
  1071. unless alignment is larger than page size.
  1072. 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
  1073. Cary Coutant <ccoutant@google.com>
  1074. PR gold/17729
  1075. * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
  1076. (DEFAULT_TARGET_X32): Set for x32.
  1077. * x86_64.cc (cmp_insn_32): New.
  1078. (lea_r10_insn_32): Likewise.
  1079. (lea_r11_insn_32): Likewise.
  1080. (cmp_insn_64): Likewise.
  1081. (lea_r10_insn_64): Likewise.
  1082. (lea_r11_insn_64): Likewise.
  1083. (Target_x86_64<size>::do_calls_non_split): Handle x32.
  1084. * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
  1085. (check_DATA): Add split_x32 files.
  1086. (split_x32_[1234n].o): New targets.
  1087. (split_x32_[124]): New targets.
  1088. (split_x32_[1234r].stdout): New targets.
  1089. * testsuite/split_x32.sh: New file.
  1090. * testsuite/split_x32_1.s: Likewise.
  1091. * testsuite/split_x32_2.s: Likewise.
  1092. * testsuite/split_x32_3.s: Likewise.
  1093. * testsuite/split_x32_4.s: Likewise.
  1094. * testsuite/split_x32_n.s: Likewise.
  1095. * configure: Regenerated.
  1096. * testsuite/Makefile.in: Likewise.
  1097. 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
  1098. PR gold/17809
  1099. * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
  1100. x32.
  1101. 2015-01-02 Alan Modra <amodra@gmail.com>
  1102. * version.cc (print_version): Just print current year.
  1103. * dwp.cc (print_version): Likewise.
  1104. 2015-01-01 Alan Modra <amodra@gmail.com>
  1105. Update year range in copyright notice of all files.
  1106. 2014-12-25 Alan Modra <amodra@gmail.com>
  1107. * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
  1108. new enums.
  1109. (Target_arm::merge_object_attributes, ): Likewise.
  1110. 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
  1111. * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
  1112. as hard float only when Tag_ABI_VFP_args is 1, using new enum value
  1113. AEABI_VFP_args_vfp to check that.
  1114. (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
  1115. value and replace hardcoded values by enum values.
  1116. 2014-12-22 Cary Coutant <ccoutant@google.com>
  1117. * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
  1118. 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
  1119. PR gold/14608
  1120. * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
  1121. to "return i * i * 3;".
  1122. 2014-12-16 Cary Coutant <ccoutant@google.com>
  1123. * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
  1124. (Mapfile::print_output_data): Use current_data_size() to avoid
  1125. assert for sections requiring postprocessing; if address is not valid,
  1126. print 0.
  1127. (Mapfile::print_output_section): Use current_data_size(); print note
  1128. that addresses and sizes are before compression.
  1129. 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
  1130. * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
  1131. Cast current_group_size to unsigned long when reporting error.
  1132. 2014-12-10 Jing Yu <jingyu@google.com>
  1133. * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
  1134. (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
  1135. Update error message.
  1136. (Target_aarch64::do_relax): Use absolute value of option
  1137. stub_group_size. Replace local variable with class member
  1138. stub_group_size_.
  1139. 2014-12-04 Alan Modra <amodra@gmail.com>
  1140. * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
  1141. addend of PLTREL24 reloc when not generating a plt stub. Make
  1142. max_branch_offset an "Address".
  1143. (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
  1144. (Target_powerpc::Relocate::relocate): Likewise.
  1145. 2014-12-04 Alan Modra <amodra@gmail.com>
  1146. PR 17670
  1147. * symtab.cc (Symbol::set_undefined): Remove assertion.
  1148. * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
  1149. on symbols defined in discarded sections, instead return false.
  1150. Rearrange params, update all callers.
  1151. (Target_powerpc::Branch_info::make_stub): Don't make stubs for
  1152. branches to syms in discarded sections.
  1153. (Global_symbol_visitor_opd::operator()): Set discarded opd syms
  1154. undefined and flag as discarded.
  1155. (Target_powerpc::Relocate::relocate): Localize variable.
  1156. 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
  1157. PR gold/17675
  1158. * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
  1159. * testsuite/Makefile.in: Regenerated.
  1160. 2014-12-03 Alan Modra <amodra@gmail.com>
  1161. PR 17566
  1162. * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
  1163. when adding dynamic relocations against section symbols.
  1164. 2014-12-01 Dimitry Ivanov <dimitry@google.com>
  1165. * layout.cc (Layout::finish_dynamic_section): When '-z global'
  1166. is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
  1167. * options.h (General_options): New -z option (global).
  1168. 2014-12-01 Cary Coutant <ccoutant@google.com>
  1169. PR gold/17578
  1170. * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
  1171. is given.
  1172. (Layout::create_executable_stack_info): Warn when -z noexecstack is
  1173. given but some inputs require executable stack.
  1174. 2014-11-26 Cary Coutant <ccoutant@google.com>
  1175. * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
  1176. .debug_str_offsets; strip .debug_gnu_pubnames and
  1177. .debug_gnu_pubtypes.
  1178. (lines_only_debug_sections): Strip all four new sections.
  1179. 2014-11-26 Jing Yu <jingyu@google.com>
  1180. * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
  1181. register to be x0 when to relax TLSDESC_LD64_LO12.
  1182. 2014-11-26 Alan Modra <amodra@gmail.com>
  1183. * powerpc.cc (struct Stub_table_owner): New.
  1184. (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
  1185. unsigned int vector. Update all references.
  1186. (powerpc_relobj::set_stub_table): Take an unsigned int param
  1187. rather than a Stub_table. Update callers.
  1188. (Powerpc_relobj::clear_stub_table): New function.
  1189. (Target_powerpc): Add relax_failed_, relax_fail_count_ and
  1190. stub_group_size_ vars.
  1191. (Target_powerpc::new_stub_table): Delete.
  1192. (max_branch_delta): New function, extracted from..
  1193. (Target_powerpc::Relocate::relocate): ..here..
  1194. (Target_powerpc::Branch_info::make_stub): ..and here. Return
  1195. status on whether stub created successfully.
  1196. (Stub_control::Stub_control): Add "no_size_errors" param. Move
  1197. default sizing to..
  1198. (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
  1199. reduce on relax failure.
  1200. (Target_powerpc::group_sections): Add "no_size_errors" param.
  1201. Use stub_group_size_. Set up group info in a temp vector,
  1202. before building Stub_table vector. Account for input sections
  1203. possibly already converted to relaxed sections.
  1204. (Stub_table::init): Delete. Merge into..
  1205. (Stub_table::Stub_table): ..here.
  1206. (Stub_table::can_reach_stub): New function.
  1207. (Stub_table::add_plt_call_entry): Add "from" parameter and
  1208. return true iff stub could be reached.
  1209. (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
  1210. param too.
  1211. (Stub_table::clear_stubs): Add "all" param.
  1212. 2014-11-26 Alan Modra <amodra@gmail.com>
  1213. * powerpc.cc (Stub_control::set_output_and_owner): New function.
  1214. (Target_powerpc::group_sections): Use it.
  1215. 2014-11-25 Cary Coutant <ccoutant@google.com>
  1216. * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
  1217. (Binary_to_elf::write_symbol): Add st_size parameter.
  1218. * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
  1219. 2014-11-25 Cary Coutant <ccoutant@google.com>
  1220. PR gold/17639
  1221. * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
  1222. (Sized_relobj_file::do_layout): Handle deferred sections properly
  1223. during GC pass 1. Don't add reloc sections to deferred list twice.
  1224. * object.h (Sized_relobj_file::is_deferred_layout): New function.
  1225. (Sized_relobj_file::is_deferred_layout_): New data member.
  1226. 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
  1227. PR gold/17619
  1228. * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
  1229. Check PC-relative offset overflow in PLT entry.
  1230. 2014-11-21 Alan Modra <amodra@gmail.com>
  1231. * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
  1232. for undefined weaks.
  1233. 2014-11-20 Alan Modra <amodra@gmail.com>
  1234. * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
  1235. from --stub-group-size parameter divided by 1024.
  1236. (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
  1237. template parameter. Update all uses.
  1238. (Target_powerpc::Relocate::relocate): Rename has_plt_value to
  1239. has_stub_value. Set for long branches. Don't report overflow for
  1240. branch to undefined weak symbols. Print info message on
  1241. overflowing branch to stub.
  1242. 2014-11-20 Alan Modra <amodra@gmail.com>
  1243. * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
  1244. 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
  1245. * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
  1246. entry for R_X86_64_GOTPLT64.
  1247. (Target_x86_64<size>::Relocate::relocate): Update comments for
  1248. R_X86_64_GOTPLT64.
  1249. 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
  1250. * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
  1251. * plugin.h: add lock definition
  1252. 2014-10-29 Han Shen <shenhan@google.com>
  1253. Jing Yu <jingyu@google.com>
  1254. * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
  1255. TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
  1256. TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
  1257. Symbol::TLS_REF.
  1258. * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
  1259. method.
  1260. (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
  1261. (Target_aarch64::tls_ld_to_le): New method.
  1262. (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
  1263. for 64bit targets.
  1264. (Output_data_plt_aarch64::irelative_rel_): New data member.
  1265. (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
  1266. (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
  1267. (Output_data_plt_aarch64::add_relocation): New method.
  1268. (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
  1269. offset. Add got_irelative size to got size.
  1270. (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
  1271. type string with the new typename.
  1272. (AArch64_relocate_functions::update_adr): Replace parameter x with
  1273. immed.
  1274. (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
  1275. (AArch64_relocate_functions::reloc_common): New method.
  1276. (AArch64_relocate_funcsions::rela_general): Extract common part out
  1277. into reloc_common method.
  1278. (AArch64_relocate_functions::rela_general): Likewise.
  1279. (AArch64_relocate_functions::pcrela_general): Likewise.
  1280. (AArch64_relocate_functions::adr): New method.
  1281. (AArch64_relocate_functions::adrp): Calculate immed before calling
  1282. update_adr.
  1283. (AArch64_relocate_functions::adrp): Likewise.
  1284. (AArch64_relocate_functions::movnz): Cast x to SignedW type when
  1285. comparing x to 0. Calculate immed from ~x when x < 0.
  1286. (Target_aarch64::optimize_tls_reloc): Add new cases for
  1287. TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
  1288. TLSLD_MOVW_DTPREL_G0_NC.
  1289. (Target_aarch64::possible_function_pointer_reloc): Implement this
  1290. method.
  1291. (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
  1292. comment.
  1293. (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
  1294. symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
  1295. TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
  1296. (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
  1297. symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
  1298. TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
  1299. (Target_aarch64::make_plt_entry): Call add_entry with two more
  1300. parameters.
  1301. (Target_aarch64::make_local_ifunc_plt_entry): New method.
  1302. (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
  1303. ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
  1304. TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
  1305. (Target_aarch64::Relocate::relocate_tls): Add cases for
  1306. TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
  1307. TLSLD_MOVW_DTPREL_G0_NC.
  1308. * testsuite/icf_safe_so_test.cc: Correct test comment.
  1309. * testsuite/icf_safe_test.sh: Add AArch64 arch.
  1310. 2014-10-22 Alan Modra <amodra@gmail.com>
  1311. * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
  1312. thread_starter.
  1313. 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
  1314. * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
  1315. 2014-10-17 Cary Coutant <ccoutant@google.com>
  1316. * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
  1317. Add "typename" keyword.
  1318. 2014-10-15 Han Shen <shenhan@google.com>
  1319. Jing Yu <jingyu@google.com>
  1320. Patch for gold aarch64 backend to support relaxation.
  1321. * aarch64-reloc.def: Change format.
  1322. * aarch64.cc (class Reloc_stub): New class.
  1323. (class Stub_table): New class.
  1324. (class AArch64_relobj): New class.
  1325. (class AArch64_input_section): New class.
  1326. (class AArch64_output_section): New class.
  1327. (Target_aarch64::new_stub_table): New method.
  1328. (Target_aarch64::new_aarch64_input_section): New method.
  1329. (Target_aarch64::find_aarch64_input_section): New method.
  1330. (Target_aarch64::scan_section_for_stubs): New method.
  1331. (Target_aarch64::scan_reloc_section_for_stubs): New method.
  1332. (Target_aarch64::relocate_stub): New method.
  1333. (Target_aarch64::current_target): New method.
  1334. (Target_aarch64::do_make_elf_object): New method.
  1335. (Target_aarch64::do_may_relax): New method.
  1336. (Target_aarch64::do_relax): New method.
  1337. (Target_aarch64::group_sections): New method.
  1338. (Target_aarch64::scan_reloc_for_stub): New method.
  1339. (Target_aarch64::do_make_output_section): New method.
  1340. (Target_aarch64::stub_tables_): New data member.
  1341. (Target_aarch64::aarch64_input_section_map_): New data member.
  1342. (AArch64_relocate_functions::maybe_apply_stub): New method.
  1343. 2014-09-30 Cary Coutant <ccoutant@google.com>
  1344. PR gold/17432
  1345. * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
  1346. 2014-09-30 Kito Cheng <kito@0xlab.org>
  1347. PR gold/13597
  1348. * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
  1349. hash table before sysv-style hash table.
  1350. 2014-09-29 Sriraman Tallam <tmsriram@google.com>
  1351. * options.h (--pic-executable): Add negative to alias to -no-pie.
  1352. 2014-09-26 Cary Coutant <ccoutant@google.com>
  1353. PR gold/16773
  1354. * object.cc (Sized_relobj_file): Compute value of section symbols
  1355. for TLS sections the same as TLS symbols.
  1356. 2014-09-25 Cary Coutant <ccoutant@google.com>
  1357. PR gold/17432
  1358. * resolve.cc (Symbol_table::resolve): Override common placeholder
  1359. symbols, but adjust sizes.
  1360. * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
  1361. symbols to common lists.
  1362. 2014-09-24 Alan Modra <amodra@gmail.com>
  1363. * po/POTFILES.in: Regenerate.
  1364. 2014-09-23 Taiju Tsuiki <tzik@google.com>
  1365. Cary Coutant <ccoutant@google.com>
  1366. PR gold/14860
  1367. * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
  1368. on input_sections_blocker.
  1369. * layout.cc (Write_sections_task::locks): Unblock
  1370. input_sections_blocker_.
  1371. * layout.h (Write_sections_task::Write_sections_task): Add
  1372. input_sections_blocker.
  1373. * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
  1374. to DEPENDENCIES.
  1375. * testsuite/Makefile.in: Regenerate.
  1376. 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  1377. * testsuite/Makefile.am (plugin_test_10): New test.
  1378. * testsuite/Makefile.in: Regenerate
  1379. * testsuite/plugin_common_test_2.c (c1): Align to 8.
  1380. * testsuite/plugin_test_10.sh: New file.
  1381. 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  1382. * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
  1383. * resolve.cc (Symbol_table::resolve): Don't override common symbols
  1384. during the replacement phase.
  1385. 2014-09-17 Han Shen <shenhan@google.com>
  1386. Jing Yu <jingyu@google.com>
  1387. * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
  1388. TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
  1389. * aarch64.cc (Target_aarch64): Add data members
  1390. got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
  1391. tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
  1392. constructor.
  1393. (Target_aarch64::do_reloc_symbol_index): New method.
  1394. (Target_aarch64::do_reloc_addend): New method.
  1395. (Target_aarch64::add_tlsdesc_info): New method.
  1396. (Target_aarch64::do_dynsym_value): New method.
  1397. (Target_aarch64::do_make_data_plt): Add new parameters: got,
  1398. got_irelative. Pass them to Output_data_plt_aarch64_standard.
  1399. (Target_aarch64::make_data_plt): Add new parameters: got,
  1400. got_irelative. Pass them to do_make_data_plt.
  1401. (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
  1402. (Target_aarch64::Relocate:tls_gd_to_le): New method.
  1403. (Target_aarch64::Relocate:tls_ie_to_le): New method.
  1404. (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
  1405. (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
  1406. (Target_aarch64::got_tlsdesc_section): New method.
  1407. (Target_aarch64::make_local_ifunc_plt_entry): New method.
  1408. (Target_aarch64::define_tls_base_symbol): New method.
  1409. (Target_aarch64::reserve_tlsdesc_entries): New method.
  1410. (Target_aarch64::got_mod_index_entry): New method.
  1411. (Target_aarch64::rela_tlsdesc_section): New method.
  1412. (Target_aarch64::rela_irelative_section): New method.
  1413. (Target_aarch64::Tlsdesc_info): New struct.
  1414. (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
  1415. relocations and tlsdesc relocations.
  1416. (Target_aarch64::optimize_tls_reloc): Implement method.
  1417. (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
  1418. got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
  1419. in constructor.
  1420. (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
  1421. (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
  1422. (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
  1423. (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
  1424. (Output_data_plt_aarch64::rela_tlsdesc): New method.
  1425. (Output_data_plt_aarch64::rela_irelative): New method.
  1426. (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
  1427. (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
  1428. (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
  1429. (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
  1430. (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
  1431. (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
  1432. (Output_data_plt_aarch64_standard): New member variables:
  1433. plt_tlsdesc_entry_size, tlsdesc_plt_entry.
  1434. (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
  1435. New parameter: got, got_irelative.
  1436. (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
  1437. (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
  1438. (Output_data_plt_aarch64::do_write): Replace got_address with
  1439. gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
  1440. (AArch64_relocate_functions::update_movnz): New method.
  1441. (AArch64_relocate_functions): Correct format.
  1442. (AArch64_relocate_functions::movnz): New method.
  1443. (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
  1444. before the switch. Add new cases to switch.
  1445. Check ie_to_le relaxation on tlsie relocations. Add code handling
  1446. tlsgd tlsdesc cases.
  1447. (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
  1448. needed. Add new cases to switch. Insert dynamic RELATIVE relocation
  1449. when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
  1450. Call reloc_name_in_error_message to print unsupported reloc.
  1451. (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
  1452. make_data_plt.
  1453. (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
  1454. relocs. Fill in some more dynamic tags.
  1455. (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
  1456. Skip call tls_get_addr when tlsgd is relaxed.
  1457. (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
  1458. handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
  1459. tlsdesc->ie relaxation.
  1460. 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1461. * mips.cc (Target_mips_nacl): New class.
  1462. (Target_selector_mips_nacl): New class.
  1463. (target_selector_mips32): Rename from target_selector_mips32be and use
  1464. Target_selector_mips_nacl instead of Target_selector_mips.
  1465. (target_selector_mips32el): Rename from target_selector_mips32 and use
  1466. Target_selector_mips_nacl instead of Target_selector_mips.
  1467. (target_selector_mips64): Rename from target_selector_mips64be and use
  1468. Target_selector_mips_nacl instead of Target_selector_mips.
  1469. (target_selector_mips64el): Rename from target_selector_mips64 and use
  1470. Target_selector_mips_nacl instead of Target_selector_mips.
  1471. (Target_mips::mips_info): Add const attribute.
  1472. 2014-09-02 Cary Coutant <ccoutant@google.com>
  1473. * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
  1474. * dynobj.h (Sized_dynobj::do_section_name): Likewise.
  1475. * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
  1476. (Sized_incr_dynobj::do_section_name): Likewise.
  1477. * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
  1478. (Sized_incr_dynobj::do_section_name): Likewise.
  1479. * object.h (Object::section_name): Likewise.
  1480. (Object::do_section_name): Likewise.
  1481. (Sized_relobj_file::do_section_name): Likewise.
  1482. * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
  1483. * plugin.h (Sized_pluginobj::do_section_name): Likewise.
  1484. 2014-09-02 Cary Coutant <ccoutant@google.com>
  1485. PR gold/17005
  1486. * ehframe.cc (Fde::write): Add output_offset parameter.
  1487. (Cie::write): Likewise.
  1488. (Eh_frame::set_final_data_size): Account for offset within output
  1489. section.
  1490. (Eh_frame::do_sized_write): Likewise.
  1491. * ehframe.h (Fde::write): Add output_offset parameter.
  1492. (Cie::write): Likewise.
  1493. * output.cc (Output_section::Input_section_sort_entry): Remove
  1494. section_has_name_; add output_section_name parameter. Use
  1495. output section name for non-input sections.
  1496. (Output_section::Input_section_sort_entry::section_has_name): Remove.
  1497. (Output_section::Input_section_sort_entry::section_has_name_): Remove.
  1498. (Output_section::Input_section_sort_compare): Remove logic for
  1499. sections without names.
  1500. (Output_section::Input_section_sort_init_fini_compare): Likewise.
  1501. (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
  1502. Likewise.
  1503. (Output_section::Input_section_sort_section_name_compare): Likewise.
  1504. 2014-08-29 Han Shen <shenhan@google.com>
  1505. Jing Yu <jingyu@google.com>
  1506. * aarch64-reloc-property.cc
  1507. (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
  1508. reference reloc property in the table.
  1509. * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
  1510. 3 other entries.
  1511. * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
  1512. 2 new overloaded methods.
  1513. (Output_data_got_aarch64::do_write): Add code to write out
  1514. static relocs.
  1515. (class Output_data_got_aarch64::Static_reloc): New class to wrap
  1516. static relocs.
  1517. (Output_data_got_aarch64::static_relocs): New vector to
  1518. hold static relocs.
  1519. (Target_aarch64::TCB_SIZE): New const static memeber.
  1520. (Target_aarch64::tcb_size): New method.
  1521. (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
  1522. (Target_aarch64::Relocate::relocate_tls): New method.
  1523. (Target_aarch64::Scan::local): Add code handling new reloc types.
  1524. (Target_aarch64::Scan::global): Add code handling new reloc types.
  1525. 2014-08-13 Sriraman Tallam <tmsriram@google.com>
  1526. * options.h (-no-pie): Add option.
  1527. 2014-08-08 Jing Yu <jingyu@google.com>
  1528. Han Shen <shenhan@google.com>
  1529. * Makefile.am (HFILES): Add aarch64-reloc-property.h.
  1530. (DEFFILES): add aarch64-reloc.def.
  1531. (TARGETSOURCES): Add aarch64-reloc-property.cc.
  1532. (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
  1533. * Makefile.in: Regenerate.
  1534. * aarch64-reloc-property.cc: New file.
  1535. * aarch64-reloc-property.h: New file.
  1536. * aarch64-reloc.def: New file.
  1537. * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
  1538. with tab to make the format consistent.
  1539. (Output_data_got_aarch64::symbol_table_): New method.
  1540. (Target_aarch64::do_plt_address_for_global): New method.
  1541. (Target_aarch64::do_plt_address_for_local): New method.
  1542. (Target_aarch64::do_select_as_default_target): New method.
  1543. (Target_aarch64::do_make_data_plt): New method.
  1544. (Target_aarch64::make_data_plt): New method.
  1545. (Output_data_plt_aarch64::has_irelative_section): New method.
  1546. (Output_data_plt_aarch64::address_for_global): New method.
  1547. (Output_data_plt_aarch64::address_for_local): New method.
  1548. (Output_data_plt_aarch64::irelative_rel_): New parameter.
  1549. (Output_data_plt_aarch64::add_entry): Implement contents.
  1550. (Output_data_plt_aarch64::set_final_data_size): Fix typo.
  1551. (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
  1552. the got_pov entry to plt0.
  1553. (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
  1554. Implement contents.
  1555. (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
  1556. (AArch64_howto): New struct.
  1557. (aarch64_howto[]): New static const array.
  1558. (AArch64_relocate_functions): New class.
  1559. (Target_aarch64::Scan::get_reference_flags): Remove method.
  1560. (Target_aarch64::Scan::local): Implement to support a few relocations.
  1561. (Target_aarch64::Scan::global): Implement to support a few relocations.
  1562. (Target_aarch64::make_plt_section): Implement contents.
  1563. (Target_aarch64::make_plt_entry): Implement contents.
  1564. (Target_aarch64::do_finalize_sections): Implement contents.
  1565. (Target_aarch64::Relocate::relocate): Implement a few relocations.
  1566. (Target_aarch64::relocate_section): Implement contents.
  1567. 2014-08-06 Alan Modra <amodra@gmail.com>
  1568. * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
  1569. 2014-08-06 Alan Modra <amodra@gmail.com>
  1570. PR 13227
  1571. * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
  1572. 2014-07-21 Sriraman Tallam <tmsriram@google.com>
  1573. * object.cc (Relobj::is_section_name_included): Add
  1574. ".rodata.nptl_version" to not garbage collect this section.
  1575. 2014-07-08 Cary Coutant <ccoutant@google.com>
  1576. * expression.cc (struct Expression::Expression_eval_info): Add
  1577. new fields type_pointer, vis_pointer, and nonvis_pointer.
  1578. (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
  1579. nonvis_pointer parameters. Adjust all calls.
  1580. (Symbol_expression::value): Update type, visibility, and nonvis bits
  1581. in caller.
  1582. * script.cc (Symbol_assignment::sized_finalize): Update type,
  1583. visibility, and remaining st_other bits for new symbol.
  1584. * script.h: (Expression::eval_maybe_dot): Add type_pointer,
  1585. vis_pointer, and nonvis_pointer parameters.
  1586. * symtab.h (Symbol::set_type): New method.
  1587. * testsuite/Makefile.am (defsym_test): New test.
  1588. * testsuite/Makefile.in: Regenerate.
  1589. * testsuite/defsym_test.c: New file.
  1590. * testsuite/defsym_test.sh: New file.
  1591. 2014-07-08 Cary Coutant <ccoutant@google.com>
  1592. PR gold/15639
  1593. * dynobj.h (Sized_dynobj::base_read_symbols): New method.
  1594. * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
  1595. (Sized_dynobj::base_read_symbols): ...new method.
  1596. * object.h (Sized_relobj_file::base_read_symbols): New method.
  1597. * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
  1598. (Sized_relobj_file::base_read_symbols): ...new method.
  1599. * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
  1600. * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
  1601. * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
  1602. 2014-07-04 Alan Modra <amodra@gmail.com>
  1603. * po/POTFILES.in: Regenerate.
  1604. 2014-07-02 Jing Yu <jingyu@google.com>
  1605. * aarch64.cc: New file
  1606. * Makefile.am (TARGETSOURCES): Add aarch64.cc
  1607. (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
  1608. * Makefile.in: Regenerate.
  1609. * configure.tgt: Add entries for aarch64*.
  1610. * configure.ac: Likewise.
  1611. * configure: Likewise.
  1612. 2014-06-27 Alan Modra <amodra@gmail.com>
  1613. * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
  1614. 2014-06-24 Cary Coutant <ccoutant@google.com>
  1615. * dwp.cc (Dwo_file::read): Allow files with no .debug_types
  1616. sections.
  1617. (Dwo_file::sized_read_unit_index): Likewise.
  1618. 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1619. * mips.cc: New file.
  1620. * Makefile.am (TARGETSOURCES): Add mips.cc
  1621. (ALL_TARGETOBJS): Add mips.$(OBJEXT)
  1622. * configure.tgt: Add entries for mips*.
  1623. * configure.ac: Likewise.
  1624. * Makefile.in: Regenerate.
  1625. * configure: Likewise.
  1626. 2014-06-09 Cary Coutant <ccoutant@google.com>
  1627. * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
  1628. unit_length is within section bounds.
  1629. 2014-06-09 Cary Coutant <ccoutant@google.com>
  1630. PR gold/16980
  1631. * layout.cc (Layout::print_to_mapfile): Print unattached sections in
  1632. map.
  1633. 2014-06-07 Alan Modra <amodra@gmail.com>
  1634. * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
  1635. 2014-06-06 Cary Coutant <ccoutant@google.com>
  1636. * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
  1637. * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
  1638. (Dwarf_pubnames_table::read_header): Likewise.
  1639. * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
  1640. .debug_gnu_pubtypes.
  1641. 2014-06-05 Joel Brobecker <brobecker@adacore.com>
  1642. * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
  1643. * Makefile.in, configure: Regenerate.
  1644. 2014-06-03 Alan Modra <amodra@gmail.com>
  1645. * powerpc.cc (addis_12_2): Define.
  1646. (Stub_table::do_write): Support fusion on ELFv2 stubs.
  1647. 2014-06-03 Alan Modra <amodra@gmail.com>
  1648. * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
  1649. st_other output.
  1650. 2014-06-02 Alan Modra <amodra@gmail.com>
  1651. * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
  1652. Only ignore relocs on ELFv1.
  1653. (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
  1654. 2014-05-30 Cary Coutant <ccoutant@google.com>
  1655. * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
  1656. * testsuite/Makefile.in: Regenerate.
  1657. * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
  1658. 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
  1659. PR gold/16945
  1660. * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
  1661. for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
  1662. 2014-05-15 Alan Modra <amodra@gmail.com>
  1663. * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
  1664. Compare FDE contents with DW_CFA_nop rather than 0.
  1665. 2014-05-13 Sriraman Tallam <tmsriram@google.com>
  1666. * symtab.h (may_need_copy_reloc): Remove check for position independent
  1667. code.
  1668. * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
  1669. position independence before pc absolute may_need_copy_reloc call.
  1670. Add check for executable output befor pc relative may_need_copy_reloc
  1671. call.
  1672. * i386.cc: Ditto.
  1673. * arm.cc: Ditto.
  1674. * sparc.cc: Ditto.
  1675. * tilegx.cc: Ditto.
  1676. * powerpc.cc: Add check for no position independence before
  1677. may_need_copy_reloc calls.
  1678. * testsuite/pie_copyrelocs_test.cc: New file.
  1679. * testsuite/pie_copyrelocs_shared_test.cc: New file.
  1680. * Makefile.am (pie_copyrelocs_test): New test.
  1681. * Makefile.in: Regenerate.
  1682. 2014-05-08 Martin Liška <mliska@suse.cz>
  1683. * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
  1684. 2014-05-06 Cary Coutant <ccoutant@google.com>
  1685. PR gold/16900
  1686. * i386.cc (Output_data_got_plt_i386): New class.
  1687. (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
  1688. parameter. Change all callers.
  1689. (Output_data_plt_i386::layout_): Remove.
  1690. (Output_data_plt_i386::got_plt_): Change type.
  1691. (Target_i386::got_plt_): Change type. Change all references.
  1692. (Target_i386::got_section): Create instance of new class.
  1693. (Output_data_got_plt_i386::do_write): New function.
  1694. * x86_64.cc (Output_data_got_plt_x86_64): New class.
  1695. (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
  1696. parameter. Change all callers.
  1697. (Output_data_plt_x86_64::layout_): Remove.
  1698. (Output_data_plt_x86_64::got_plt_): Change type.
  1699. (Target_x86_64::got_plt_): Change type. Change all references.
  1700. (Target_x86_64::got_section): Create instance of new class.
  1701. (Output_data_got_plt_x86_64::do_write): New function.
  1702. (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
  1703. (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
  1704. class.
  1705. 2014-05-05 Cary Coutant <ccoutant@google.com>
  1706. * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
  1707. if we have pubnames/pubtypes.
  1708. 2014-05-02 Cary Coutant <ccoutant@google.com>
  1709. * defstd.cc (in_segment): Define __ehdr_start here...
  1710. * layout.cc (Layout::finalize): ...Instead of here. Set the
  1711. output segment when known.
  1712. * resolve.cc (Symbol::override_base_with_special): Remember
  1713. the original binding.
  1714. * symtab.cc (Symbol::set_output_segment): New function.
  1715. (Symbol::set_undefined): New function.
  1716. * symtab.h (Symbol::is_weak_undefined): Check original undef
  1717. binding.
  1718. (Symbol::is_strong_undefined): New function.
  1719. (Symbol::set_output_segment): New function.
  1720. (Symbol::set_undefined): New function.
  1721. * target-reloc.h (is_strong_undefined): Remove.
  1722. (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
  1723. Check for hidden undefs.
  1724. (relocate_section): Call Symbol::is_strong_undefined.
  1725. * testsuite/Makefile.am (ehdr_start_test_1)
  1726. (ehdr_start_test_2, ehdr_start_test_3)
  1727. (ehdr_start_test_4, ehdr_start_test_5): New test cases.
  1728. * testsuite/Makefile.in: Regenerate.
  1729. * testsuite/ehdr_start_def.cc: New source file.
  1730. * testsuite/ehdr_start_test.cc: New source file.
  1731. * testsuite/ehdr_start_test.t: New linker script.
  1732. * testsuite/ehdr_start_test_4.sh: New shell script.
  1733. 2014-04-23 Cary Coutant <ccoutant@google.com>
  1734. PR gold/16870
  1735. * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
  1736. 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1737. * layout.cc (Layout::include_section): Allow a target to decide
  1738. whether to include a section.
  1739. * target.h (Target::should_include_section): New function.
  1740. (Target::do_should_include_section): New function.
  1741. 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1742. * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
  1743. inline into ...
  1744. (Copy_relocs::emit): ... here.
  1745. * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
  1746. (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
  1747. (Copy_reloc_entry::entries_): Change from private to protected.
  1748. 2014-04-02 Sriraman Tallam <tmsriram@google.com>
  1749. * icf.cc (get_section_contents): Replace copies of reloc
  1750. vectors with const references.
  1751. 2014-04-02 Cary Coutant <ccoutant@google.com>
  1752. * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
  1753. (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
  1754. * configure: Regenerate.
  1755. * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
  1756. -fno-use-linker-plugin.
  1757. (LINK1, CXXLINK1): Add it to the link command.
  1758. * testsuite/Makefile.in: Regenerate.
  1759. 2014-03-12 Alan Modra <amodra@gmail.com>
  1760. * Makefile.in: Regenerate.
  1761. 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1762. * symtab.h (Symbol::set_nonvis): New function.
  1763. 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1764. * symtab.cc (Sized_symbol<32>::init_output_data):
  1765. Instantiate the template.
  1766. (Sized_symbol<64>::init_output_data): Likewise.
  1767. 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1768. * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
  1769. adjust dynamic symbol value.
  1770. * target.h (Target::adjust_dyn_symbol): New function.
  1771. (Target::do_adjust_dyn_symbol): New function.
  1772. 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1773. * output.cc (Output_data_dynamic::Dynamic_entry::write):
  1774. Get the value of DYNAMIC_CUSTOM dynamic entry.
  1775. * output.h (Output_data_dynamic::add_custom): New function.
  1776. (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
  1777. dynamic entry.
  1778. (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
  1779. * target.h (Target::dynamic_tag_custom_value): New function.
  1780. (Target::do_dynamic_tag_custom_value): New function.
  1781. 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  1782. * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
  1783. dynsym indexes.
  1784. * target.h (Target::has_custom_set_dynsym_indexes): New function.
  1785. (Target::do_has_custom_set_dynsym_indexes): New function.
  1786. (Target::set_dynsym_indexes): New function.
  1787. (Target::do_set_dynsym_indexes): New function.
  1788. 2014-03-07 Alan Modra <amodra@gmail.com>
  1789. * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
  1790. CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
  1791. (Powerpc_relocate_functions::has_overflow_unsigned): New function.
  1792. (Powerpc_relocate_functions::has_overflow_bitfield,
  1793. overflowed): Use the above.
  1794. (Target_powerpc::Relocate::relocate): Correct overflow checking
  1795. for a number of relocations. Modify overflow test for 16-bit
  1796. fields in instructions to signed/unsigned according to whether
  1797. the field takes a signed or unsigned value.
  1798. 2014-03-05 Alan Modra <amodra@gmail.com>
  1799. Update copyright years.
  1800. 2014-03-05 Alan Modra <amodra@gmail.com>
  1801. * powerpc.cc (Target_powerpc::Scan::local, global): Support
  1802. R_PPC64_ADDR64_LOCAL.
  1803. (Target_powerpc::Relocate::relocate): Likewise.
  1804. 2014-03-03 Alan Modra <amodra@gmail.com>
  1805. * dwp.cc (print_version): Update copyright year to current.
  1806. 2014-02-10 Alan Modra <amodra@gmail.com>
  1807. * po/gold.pot: Regenerate.
  1808. 2014-02-06 Cary Coutant <ccoutant@google.com>
  1809. Fix problem where -u is ignored when a weak undef is seen.
  1810. * archive.cc (Library_base::should_include_member): Reorder
  1811. code to check for -u option if a weak undef has already been seen.
  1812. * testsuite/Makefile.am (weak_undef_test_2): New test case.
  1813. * testsuite/Makefile.in: Regenerate.
  1814. * testsuite/weak_undef_file3.cc: New file.
  1815. * testsuite/weak_undef_file4.cc: New file.
  1816. * testsuite/weak_undef_test_2.cc: New file.
  1817. 2014-02-05 Cary Coutant <ccoutant@google.com>
  1818. Fix issues with gold undefined symbol diagnostics.
  1819. PR binutils/15435
  1820. * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
  1821. check to here.
  1822. * target-reloc.h (is_strong_undefined): New function.
  1823. (relocate_section): Move undef vtable symbol check from here.
  1824. Check for is_strong_undefined.
  1825. 2014-02-05 Cary Coutant <ccoutant@google.com>
  1826. Fix problems with the --dynamic-list option.
  1827. PR gold/13577
  1828. * options.cc (General_options::parse_dynamic_list):
  1829. Set have_dynamic_list_.
  1830. (General_options::General_options): Initialize have_dynamic_list_.
  1831. (General_options::finalize): Turn off -Bsymbolic and
  1832. -Bsymbolic-functions if --dynamic-list provided.
  1833. * options.h (General_options::have_dynamic_list): New function.
  1834. (General_options::have_dynamic_list_): New data member.
  1835. * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
  1836. correctly.
  1837. PR gold/16530
  1838. * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
  1839. in --dynamic-list, mark it.
  1840. * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
  1841. (dynamic_list_2): New test case.
  1842. * testsuite/Makefile.in: Regenerate.
  1843. * testsuite/dynamic_list_2.cc: New file.
  1844. * testsuite/dynamic_list_2.t: New file.
  1845. * testsuite/dynamic_list_lib1.cc: New file.
  1846. * testsuite/dynamic_list_lib2.cc: New file.
  1847. * testsuite/gc_dynamic_list_test.c: New file.
  1848. * testsuite/gc_dynamic_list_test.sh: New file.
  1849. * testsuite/gc_dynamic_list_test.t: New file.
  1850. 2014-01-28 Cary Coutant <ccoutant@google.com>
  1851. Add .gdb_index version 7 support.
  1852. * gold/dwarf_reader.cc: include <utility> (for make_pair).
  1853. (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
  1854. debug sections.
  1855. (Dwarf_ranges_table::read_ranges_table): Likewise.
  1856. (Dwarf_pubnames_table::read_section): Check for GNU-style
  1857. sections, and for compressed debug sections.
  1858. (Dwarf_pubnames_table::read_header): Compute end address of table.
  1859. (Dwarf_pubnames_table::next_name): Return flag_byte. Check
  1860. for end of list by offset, not by offset == 0.
  1861. (Dwarf_info_reader::do_read_string_table): Check for compressed
  1862. debug sections.
  1863. * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
  1864. Initialize new data members.
  1865. (Dwarf_pubnames_table::next_name): return flag_byte.
  1866. (Dwarf_pubnames_table::end_of_table_): New data member.
  1867. (Dwarf_pubnames_table::is_gnu_style_): New data member.
  1868. * gold/gdb-index.cc (gdb_index_version): Update to version 7.
  1869. (Gdb_index_info_reader::read_pubtable): Read flag_byte.
  1870. (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
  1871. read skeleton type unit DIEs.
  1872. (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
  1873. (Gdb_index::do_write): Write flag_byte.
  1874. * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
  1875. (Gdb_index::Cu_vector): Store flags along with cu indexes.
  1876. * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
  1877. * gold/testsuite/gdb_index_test_comm.sh: Likewise.
  1878. 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
  1879. * version.cc (print_version): Update copyright year to 2014.
  1880. 2013-12-19 Dimitry Andric <dimitry@andric.com>
  1881. * stringpool.cc (Stringpool_template::reserve): Add
  1882. HAVE_UNORDERED_MAP case.
  1883. * stringpool.cc (Stringpool_template::print_stats): Likewise.
  1884. 2013-12-18 Cary Coutant <ccoutant@google.com>
  1885. * configure.ac: Check for <unordered_set> and <unordered_map>.
  1886. * config.in: Regenerate.
  1887. * configure: Regenerate.
  1888. * system.h: Use <unordered_set> and <unordered_map> if available.
  1889. 2013-12-10 Roland McGrath <mcgrathr@google.com>
  1890. * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
  1891. with $(INSTALL_PROGRAM_ENV).
  1892. * Makefile.in: Regenerate.
  1893. 2013-11-22 Cary Coutant <ccoutant@google.com>
  1894. * configure.ac: Add check for which library is needed for
  1895. dlopen.
  1896. * configure: Regenerate.
  1897. 2013-11-22 Cary Coutant <ccoutant@google.com>
  1898. * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
  1899. assembler.
  1900. * testsuite/Makefile.in: Regenerate.
  1901. 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
  1902. * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
  1903. Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
  1904. R_X86_64_PC32 and R_X86_64_PLT32, respectively.
  1905. (Target_x86_64<size>::Scan::local): Likewise.
  1906. (Target_x86_64<size>::Scan::global): Likewise.
  1907. (Target_x86_64<size>::Relocate::relocate): Likewise.
  1908. (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
  1909. Likewise.
  1910. (Target_x86_64<size>::Scan::check_non_pic(): Handle
  1911. R_X86_64_PC32_BND.
  1912. * testsuite/Makefile.am (check_PROGRAMS): Add
  1913. exception_x86_64_bnd_test.
  1914. (exception_x86_64_bnd_test_SOURCES): New macro.
  1915. (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
  1916. (exception_x86_64_bnd_test_LDFLAGS): Likewise.
  1917. (exception_x86_64_bnd_test_LDADD): Likewise.
  1918. (exception_x86_64_bnd_1.o): New rule.
  1919. (exception_x86_64_bnd_2.o): Likewise.
  1920. * testsuite/Makefile.in: Regenerated.
  1921. 2013-11-15 Alan Modra <amodra@gmail.com>
  1922. * powerpc.cc (Target_powerpc::glink_section): Provide non-const
  1923. accessor.
  1924. (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
  1925. Only call ppc64_local_entry_offset for 64-bit. Restrict
  1926. symval_for_branch lookup to ELFv1.
  1927. (Stub_table::add_plt_call_entry): Use unsigned int off.
  1928. (Output_data_glink::Address, invalid_address): New.
  1929. (Output_data_glink::add_eh_frame): Move out of line. Add
  1930. support for ELFv2.
  1931. (Output_data_glink::add_global_entry, find_global_entry,
  1932. global_entry_address): New functions.
  1933. (Output_data_glink::global_entry_stubs_, end_branch_table_,
  1934. ge_size): New variables.
  1935. (Output_data_glink::set_final_data_size): Add global entry
  1936. stub sizing.
  1937. (Output_data_glink::do_write): Write global entry stubs.
  1938. (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
  1939. parameter. Return true for ELFv2. Adjust callers.
  1940. (Target_powerpc::Scan::local, global): Restrict opd lookup to
  1941. ELFv1. Similarly for ifunc and dynamic relocation processing
  1942. specific to ELFv1. Recognize that symbols are defined on
  1943. their plt entries for ELFv2.
  1944. (Target_powerpc::symval_for_branch): Assert if called for
  1945. ELFv2 or ppc32.
  1946. (Target_powerpc::Relocate::relocate): Use global entry plt
  1947. stub for symbol value if such exists on ELFv2.
  1948. (Target_powerpc::Relocate::relocate): Don't call
  1949. symval_for_branch when ELFv2. Do adjust for local entry
  1950. offset when ELFv2.
  1951. (Target_powerpc::do_dynsym_value): Set symbols to global entry
  1952. plt stub for ELFv2.
  1953. (Target_powerpc::do_plt_address_for_global): Similarly.
  1954. 2013-11-14 Cary Coutant <ccoutant@google.com>
  1955. Revert patch -- this did not fix the problem, and there is
  1956. no race there.
  1957. 2013-11-14 Cary Coutant <ccoutant@google.com>
  1958. PR gold/14860
  1959. * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
  1960. (Ehframe_hdr::set_final_data_size): Allocate a Lock.
  1961. * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
  1962. updating fde_offsets_.
  1963. (Eh_frame_hdr::lock_): New data member.
  1964. 2013-11-14 Cary Coutant <ccoutant@google.com>
  1965. * dwp.cc (Dwo_file_entry): New type.
  1966. (File_list): Use Dwo_file_entry.
  1967. (Dwo_file::verify): New function.
  1968. (Dwo_file::verify_dwo_list): New function.
  1969. (Dwo_file::sized_verify_dwo_list): New function.
  1970. (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
  1971. list.
  1972. (Dwp_options): New enum type.
  1973. (dwp_options): Add --verify-only.
  1974. (usage): Likewise.
  1975. (main): Likewise.
  1976. * dwp.h (gold_info): Add declaration.
  1977. 2013-11-14 Cary Coutant <ccoutant@google.com>
  1978. PR gold/14860
  1979. * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
  1980. (Ehframe_hdr::set_final_data_size): Allocate a Lock.
  1981. * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
  1982. updating fde_offsets_.
  1983. (Eh_frame_hdr::lock_): New data member.
  1984. 2013-11-06 Cary Coutant <ccoutant@google.com>
  1985. PR gold/15758
  1986. * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
  1987. before reloc sections.
  1988. 2013-11-04 Alan Modra <amodra@gmail.com>
  1989. * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
  1990. (Symbol::needs_dynamic_reloc): Test new flag.
  1991. * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
  1992. (Target_powerpc::Scan::get_reference_flags): Add target param.
  1993. Return FUNC_DESC_ABI for 64-bit ELFv1.
  1994. (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
  1995. call.
  1996. (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
  1997. (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
  1998. 2013-10-31 Cary Coutant <ccoutant@google.com>
  1999. Restore support for dwp v2 DWARF package file format.
  2000. * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
  2001. tu_length parameter. Adjust all callers.
  2002. * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
  2003. * dwp.cc: Include dwarf.h.
  2004. (Section_bounds): New struct type.
  2005. (Unit_set): New struct type.
  2006. (Dwo_file::Dwo_file): Initialize new data member.
  2007. (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
  2008. Combine and rename to...
  2009. (Dwo_file::read_unit_index): ...this.
  2010. (Dwo_file::sized_read_compunit_index)
  2011. (Dwo_file::sized_read_typeunit_index): Combine and rename to...
  2012. (Dwo_file::sized_read_unit_index): ...this.
  2013. (Dwo_file::copy_section): Remove section_name, is_str_offsets
  2014. parameters; add section_id parameter.
  2015. (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
  2016. (Dwo_file::add_unit_set): ...this.
  2017. (Dwo_file::shndx_map_): Remove.
  2018. (Dwo_file::sect_offsets_): New data member.
  2019. (Dwp_output_file::Dwp_output_file): Initialize new data members.
  2020. (Dwp_output_file::add_section): Rename to...
  2021. (Dwp_output_file::add_contribution): ...this.
  2022. (Dwp_output_file::add_cu_set): Combine parameters into a struct.
  2023. (Dwp_output_file::add_tu_set): Likewise.
  2024. (Dwp_output_file::Contribution): New type.
  2025. (Dwp_output_file::Section::contributions): New data member.
  2026. (Dwp_output_file::Cu_or_tu_set): Remove.
  2027. (Dwp_output_file::Section::Section): New ctor.
  2028. (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
  2029. (Dwp_output_file::Dwp_index::Section_table): New type.
  2030. (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
  2031. (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
  2032. parameter.
  2033. (Dwp_output_file::Dwp_index::shndx_pool): Remove.
  2034. (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
  2035. (Dwp_output_file::Dwp_index::section_table): New member function.
  2036. (Dwp_output_file::Dwp_index::section_table_end): New member function.
  2037. (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
  2038. (Dwp_output_file::Dwp_index::section_table_rows): New member function.
  2039. (Dwp_output_file::Dwp_index::section_table_cols): New member function.
  2040. (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
  2041. (Dwp_output_file::Dwp_index::section_table_): New data member.
  2042. (Dwp_output_file::Dwp_index::section_mask_): New data member.
  2043. (Dwp_output_file::add_output_section): New member function.
  2044. (Dwp_output_file::write_new_section): New member function.
  2045. (Dwp_output_file::write_contributions): New member function.
  2046. (Dwp_output_file::section_id_map_): New data member.
  2047. (class Dwo_id_info_reader): Remove.
  2048. (class Unit_reader): New class.
  2049. (get_dwarf_section_name): New function.
  2050. (Dwo_file::read_executable): Adjust initializations of class data.
  2051. (Dwo_file::read): Add support for v2 package file format.
  2052. (Dwo_file::read_unit_index): Likewise.
  2053. (Dwo_file::sized_read_unit_index): Likewise.
  2054. (Dwo_file::copy_section): Likewise.
  2055. (Dwo_file::add_unit_set): Likewise.
  2056. (Dwp_output_file::add_output_section): Likewise.
  2057. (Dwp_output_file::add_contribution): Likewise.
  2058. (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
  2059. for empty slot.
  2060. (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
  2061. file format.
  2062. (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
  2063. slot.
  2064. (Dwp_output_file::initialize): Remove unused function.
  2065. (Dwp_output_file::finalize): Add support for v2 package file format.
  2066. (Dwp_output_file::write_index): Likewise.
  2067. * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
  2068. function prototype.
  2069. 2013-10-31 Cary Coutant <ccoutant@google.com>
  2070. * configure.ac: Fix check for -fmerge-constants.
  2071. * configure.ac: Regenerate.
  2072. 2013-10-30 Roland McGrath <mcgrathr@google.com>
  2073. * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
  2074. Correct 9-byte nop sequence to match what the assembler generates.
  2075. 2013-10-30 Alan Modra <amodra@gmail.com>
  2076. * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
  2077. ppc64_local_entry_offset, ppc64_local_entry_offset,
  2078. do_read_symbols): New functions.
  2079. (Powerpc_relobj::e_flags_, st_other_): New vars.
  2080. (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
  2081. (Powerpc_dynobj::abiversion, set_abiversion): New functions.
  2082. (Powerpc_relobj::e_flags_): New var.
  2083. (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
  2084. and adjust for ELFv2.
  2085. (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
  2086. (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
  2087. (Powerpc_dynobj::do_find_special_sections): Likewise.
  2088. (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
  2089. (Target_powerpc::Branch_info::make_stub): Adjust stub destination
  2090. to ELFv2 local entry.
  2091. (Target_powerpc::do_relax): No thread safe barriers needed for
  2092. ELFv2.
  2093. (Output_data_plt_powerpc::initial_plt_entry_size_,
  2094. plt_entry_size): Delete. Replace all uses with
  2095. first_plt_entry_offset() and plt_entry_size().
  2096. (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
  2097. reserved_size parm. Update callers.
  2098. (Output_data_plt_powerpc::entry_count): Update.
  2099. (Output_data_plt_powerpc::first_plt_entry_offset): Make private
  2100. and use Target_powerpc::first_plt_entry_offset().
  2101. (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
  2102. rename to plt_entry_size.
  2103. (Output_data_plt_powerpc::add_ifunc_entry,
  2104. add_local_ifunc_entry): Adjust reloc for ELFv2.
  2105. (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
  2106. (glink_eh_frame_fde_64v2): New.
  2107. (Stub_table::plt_call_size): Support ELFv2 sizing.
  2108. (Output_data_glink::add_eh_frame): Use the new FDE.
  2109. (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
  2110. (Stub_table::do_write): Write ELFv2 stubs and glink.
  2111. (Target_powerpc::Relocate::relocate): Replaces nop after call
  2112. with ld 2,24(1) and adjust local offset destination for ELFv2.
  2113. 2013-10-30 Alan Modra <amodra@gmail.com>
  2114. * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
  2115. (Target_powerpc::Scan::global, local): Likewise.
  2116. (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
  2117. on all ppc64 @h and @ha relocs.
  2118. 2013-10-14 Alan Modra <amodra@gmail.com>
  2119. * output.h (Output_data_got::add_constant): Tidy.
  2120. (Output_data_got::add_constant_pair): New function.
  2121. * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
  2122. methods used so as to first call reserve_ent().
  2123. 2013-10-11 Roland McGrath <mcgrathr@google.com>
  2124. * powerpc.cc (Output_data_got_powerpc): Remove unused methods
  2125. add_got_entry and add_got_entry_pair.
  2126. * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
  2127. (HAVE_PUBNAMES): Likewise.
  2128. * configure: Regenerate.
  2129. * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
  2130. * testsuite/Makefile.in: Regenerate.
  2131. * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
  2132. Remove const from declaration.
  2133. * target.cc (Sized_target::do_adjust_elf_header): Update definition.
  2134. * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
  2135. * output.h (Output_file_header): Remove const from member target_
  2136. and corresponding constructor argument.
  2137. * output.cc (Output_file_header::Output_file_header): Update prototype.
  2138. (Output_file_header::do_sized_write): Use this->target_ in place
  2139. of parameters()->target().
  2140. * testsuite/undef_symbol.cc (Foo::get_a): New method.
  2141. * configure.ac (MERGE_CONSTANTS_FLAG): New check.
  2142. * configure: Regenerate.
  2143. * Makefile.in: Regenerate.
  2144. * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
  2145. * testsuite/merge_string_literals_2.c: Likewise.
  2146. * testsuite/Makefile.am
  2147. (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
  2148. (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
  2149. literal -fmerge-constants.
  2150. * testsuite/Makefile.in: Regenerate.
  2151. * i386.cc (Target_i386): Remove unused member dynbss_.
  2152. * arm.cc (Target_arm): Likewise.
  2153. * powerpc.cc (Target_powerpc): Likewise.
  2154. * sparc.cc (Target_sparc): Likewise.
  2155. * tilegx.cc (Target_tilegx): Likewise.
  2156. * x86_64.cc (Target_x86_64): Likewise.
  2157. * dwarf_reader.h (Dwarf_info_reader): Remove unused members
  2158. type_signature_, type_offset_.
  2159. * plugin.h (Plugin_hook): Remove unused member layout_.
  2160. * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
  2161. mapfile_.
  2162. (Read_member): Remove unused members input_objects_, symtab_,
  2163. mapfile_, layout_.
  2164. (Check_library): Remove unused member symtab_.
  2165. * archive.h (Lib_group): Remove unused member lib_.
  2166. * archive.cc (Lib_group::Lib_group): Update initializer.
  2167. * incremental.h (Incremental_binary): Remove unused member target_.
  2168. (Incremental_script_entry): Removed unused member script_.
  2169. * layout.h (Write_symbols_task): Remove unused member input_objects_.
  2170. * icf.h (Icf): Remove unused member num_tracked_relocs.
  2171. * gold-threads.h (Once): Conditionalize member was_run_lock_ on
  2172. [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
  2173. its only use.
  2174. * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
  2175. * archive.h: Use struct rather than class for forward declaration
  2176. of Read_symbols_data.
  2177. 2013-10-07 Cary Coutant <ccoutant@google.com>
  2178. PR gold/16010
  2179. * testsuite/Makefile.am (icf_test): Fix dependencies.
  2180. (icf_safe_test): Likewise.
  2181. (icf_safe_so_test): Likewise.
  2182. (large_symbol_alignment): Add empty _LDADD rule.
  2183. * testsuite/Makefile.in: Regenerate.
  2184. 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
  2185. PR gold/15927
  2186. * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
  2187. relocation for R_X86_64_32 on x32.
  2188. 2013-08-27 Roland McGrath <mcgrathr@google.com>
  2189. * output.cc (Output_segment::set_section_addresses): Take new
  2190. Target* argument. If target->isolate_execinstr() and the segment
  2191. is executable and starts at a target->abi_pagesize() boundary,
  2192. pad its end out to a target->abi_pagesize() boundary with code fill.
  2193. * output.h (Output_segment::set_section_addresses): Update decl.
  2194. * layout.h (Layout::check_output_data_for_reset_values): Take new
  2195. argument RELAX_OUTPUTS.
  2196. (Layout): New member relax_output_list_.
  2197. (Layout::add_relax_output): New method.
  2198. * layout.cc (Layout::Layout): Update constructor.
  2199. (Layout::reset_relax_output): New method.
  2200. (Layout::clean_up_after_relaxation): Call it.
  2201. (Layout::prepare_for_relaxation): Update caller.
  2202. (Layout::set_segment_offsets): Update callers of set_section_addresses.
  2203. Call reset_relax_output before re-processing segments for
  2204. isolate_execinstr case.
  2205. (Layout::write_data): Handle relax_output_list_.
  2206. (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
  2207. Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
  2208. 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
  2209. PR binutils/15834
  2210. * object.h: Fix typos.
  2211. 2013-08-16 Roland McGrath <mcgrathr@google.com>
  2212. * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
  2213. * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
  2214. 2013-08-07 Cary Coutant <ccoutant@google.com>
  2215. Revert support for v2 DWP files:
  2216. 2013-03-01 Cary Coutant <ccoutant@google.com>
  2217. Add dwp support for v2 DWARF package file format.
  2218. * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
  2219. tu_length parameter. Adjust all callers.
  2220. * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
  2221. * dwp.cc: Include dwarf.h.
  2222. (Section_bounds): New struct type.
  2223. (Unit_set): New struct type.
  2224. (Dwo_file::Dwo_file): Initialize new data member.
  2225. (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
  2226. Combine and rename to...
  2227. (Dwo_file::read_unit_index): ...this.
  2228. (Dwo_file::sized_read_compunit_index)
  2229. (Dwo_file::sized_read_typeunit_index): Combine and rename to...
  2230. (Dwo_file::sized_read_unit_index): ...this.
  2231. (Dwo_file::copy_section): Remove section_name, is_str_offsets
  2232. parameters; add section_id parameter.
  2233. (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
  2234. (Dwo_file::add_unit_set): ...this.
  2235. (Dwo_file::shndx_map_): Remove.
  2236. (Dwo_file::sect_offsets_): New data member.
  2237. (Dwp_output_file::Dwp_output_file): Initialize new data members.
  2238. (Dwp_output_file::add_section): Rename to...
  2239. (Dwp_output_file::add_contribution): ...this.
  2240. (Dwp_output_file::add_cu_set): Combine parameters into a struct.
  2241. (Dwp_output_file::add_tu_set): Likewise.
  2242. (Dwp_output_file::Contribution): New type.
  2243. (Dwp_output_file::Section::contributions): New data member.
  2244. (Dwp_output_file::Cu_or_tu_set): Remove.
  2245. (Dwp_output_file::Section::Section): New ctor.
  2246. (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
  2247. (Dwp_output_file::Dwp_index::Section_table): New type.
  2248. (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
  2249. (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
  2250. parameter.
  2251. (Dwp_output_file::Dwp_index::shndx_pool): Remove.
  2252. (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
  2253. (Dwp_output_file::Dwp_index::section_table): New member function.
  2254. (Dwp_output_file::Dwp_index::section_table_end): New member function.
  2255. (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
  2256. (Dwp_output_file::Dwp_index::section_table_rows): New member function.
  2257. (Dwp_output_file::Dwp_index::section_table_cols): New member function.
  2258. (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
  2259. (Dwp_output_file::Dwp_index::section_table_): New data member.
  2260. (Dwp_output_file::Dwp_index::section_mask_): New data member.
  2261. (Dwp_output_file::add_output_section): New member function.
  2262. (Dwp_output_file::write_new_section): New member function.
  2263. (Dwp_output_file::write_contributions): New member function.
  2264. (Dwp_output_file::section_id_map_): New data member.
  2265. (class Dwo_id_info_reader): Remove.
  2266. (class Unit_reader): New class.
  2267. (get_dwarf_section_name): New function.
  2268. (Dwo_file::read_executable): Adjust initializations of class data.
  2269. (Dwo_file::read): Add support for v2 package file format.
  2270. (Dwo_file::read_unit_index): Likewise.
  2271. (Dwo_file::sized_read_unit_index): Likewise.
  2272. (Dwo_file::copy_section): Likewise.
  2273. (Dwo_file::add_unit_set): Likewise.
  2274. (Dwp_output_file::add_output_section): Likewise.
  2275. (Dwp_output_file::add_contribution): Likewise.
  2276. (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
  2277. for empty slot.
  2278. (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
  2279. file format.
  2280. (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
  2281. slot.
  2282. (Dwp_output_file::initialize): Remove unused function.
  2283. (Dwp_output_file::finalize): Add support for v2 package file format.
  2284. (Dwp_output_file::write_index): Likewise.
  2285. * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
  2286. function prototype.
  2287. 2013-07-31 Cary Coutant <ccoutant@google.com>
  2288. * object.cc (Sized_relobj::do_output_section_address): New function.
  2289. (Sized_relobj): Instantiate explicitly.
  2290. * object.h (Object::output_section_address): New function.
  2291. (Object::do_output_section_address): New function.
  2292. (Sized_relobj::do_output_section_address): New function.
  2293. * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
  2294. 2013-07-30 Cary Coutant <ccoutant@google.com>
  2295. Sasa Stankovic <Sasa.Stankovic@imgtec.com>
  2296. * parameters.cc (Parameters::entry): Return target-specific entry
  2297. symbol name.
  2298. * target.h (Target::entry_symbol_name): New function.
  2299. (Target_info::entry_symbol_name): New data member.
  2300. * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
  2301. * i386.cc (Target_i386::i386_info): Likewise.
  2302. (Target_i386_nacl::i386_nacl_info): Likewise.
  2303. * sparc.cc (Target_sparc::sparc_info): Likewise.
  2304. * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
  2305. * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
  2306. (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
  2307. * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
  2308. 2013-07-22 Sterling Augustine <saugustine@google.com>
  2309. * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
  2310. Convert parameter shndx to local variable. Add parameters symtab
  2311. and symtab_size. Scan over section names. Find relocation
  2312. section corresponding to current section. Create and initialize
  2313. reloc_mapper_ and reloc_type_.
  2314. (Dwarf_pubnames_table::read_header): Add assertion. Change
  2315. unit_length to off_t. Initialize member unit_length_. Fill in field
  2316. cu_offset_.
  2317. * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
  2318. Initialize new fields unit_length_ and cu_offset_.
  2319. (Dwarf_pubnames_table::read_section): Update prototype.
  2320. (Dwarf_pubnames_table::cu_offset): New member function.
  2321. (Dwarf_pubnames_table::subsection_size): Likewise.
  2322. (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
  2323. New fields.
  2324. (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
  2325. member functions public.
  2326. * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
  2327. Update comment. Rework logic. Move repeated parts to...
  2328. (Gdb_index_info_reader::read_pubtable): ...here. New function.
  2329. (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
  2330. pubtypes_table_, and stmt_list_offset.
  2331. (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
  2332. Gdb_index::find_pubtype_offset,
  2333. Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
  2334. (Gdb_index::pubnames_read): Update prototype and rework logic.
  2335. * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
  2336. Forward declare.
  2337. (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
  2338. Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
  2339. Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
  2340. Gdb_index::map_pubtable_to_dies):
  2341. Declare functions.
  2342. (Gdb_index::pubnames_read): Update declaration.
  2343. (Gdb_index::Pubname_offset_map): New type.
  2344. (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
  2345. Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
  2346. Gdb_index::stmt_list_offset): Declare.
  2347. (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
  2348. Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
  2349. Gdb_index::pubtypes_offset_): Remove.
  2350. 2013-07-19 Roland McGrath <mcgrathr@google.com>
  2351. * options.h (General_options): Add -Trodata-segment option.
  2352. * parameters.cc (Parameters::check_rodata_segment): New function.
  2353. (Parameters::set_target_once): Call it.
  2354. * parameters.h (Parameters): Declare it (private member function).
  2355. * layout.cc (load_seg_unusable_for_headers): New function, broken
  2356. out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
  2357. then validate rodata segment rather than text segment.
  2358. (relaxation_loop_body): Call that.
  2359. (is_text_segment): New function. Don't admit a non-executable
  2360. segment if TARGET->isolate_execinstr().
  2361. (set_segment_offsets): Call it. Honor -Trodata-segment option.
  2362. 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
  2363. PR gold/15070
  2364. * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
  2365. * nacl.h (Sniff_file::View::View): Request aligned view.
  2366. 2013-07-11 Cary Coutant <ccoutant@google.com>
  2367. * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
  2368. correct BRLT entry size.
  2369. 2013-07-03 Alan Modra <amodra@gmail.com>
  2370. * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
  2371. comment.
  2372. 2013-07-01 Cary Coutant <ccoutant@google.com>
  2373. * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
  2374. reloc_type_.
  2375. (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
  2376. (Dwarf_ranges_table::lookup_reloc): New function.
  2377. * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
  2378. reloc_type_.
  2379. (Dwarf_ranges_table::lookup_reloc): New function.
  2380. (Dwarf_ranges_table::reloc_type_): New data member.
  2381. 2013-06-27 Jing Yu <jingyu@google.com>
  2382. PR gold/15662
  2383. * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
  2384. function.
  2385. (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
  2386. (Target_powerpc::do_relax): Call the above.
  2387. 2013-06-27 Cary Coutant <ccoutant@google.com>
  2388. * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
  2389. on garbage collected .opd section.
  2390. 2013-06-27 Alan Modra <amodra@gmail.com>
  2391. * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
  2392. is non-zero.
  2393. (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
  2394. (Target_powerpc::do_function_location): Likewise for loc->shndx.
  2395. 2013-06-14 Cary Coutant <ccoutant@google.com>
  2396. * resolve.cc (Symbol::override_base): Don't override st_type
  2397. from plugin placeholder symbols.
  2398. (Symbol_table::resolve): Likewise.
  2399. (Symbol_table::should_override): Don't complain about TLS mismatch
  2400. if the TO symbol is a plugin placeholder.
  2401. * testsuite/Makefile.am (plugin_test_tls): New test.
  2402. * testsuite/Makefile.in: Regenerate.
  2403. * testsuite/plugin_test_tls.sh: New test script.
  2404. * testsuite/two_file_test_2_tls.cc: New test source.
  2405. * testsuite/two_file_test_tls.cc: New test source.
  2406. 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
  2407. * layout.cc (Layout::set_segment_offsets): Taking care of the case when
  2408. the maximum segment alignment is larger than the page size.
  2409. * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
  2410. correctly aligns the symbols with large alignemnt.
  2411. * testsuite/Makefile.in: Regenerate.
  2412. * testsuite/large_symbol_alignment.cc: New file.
  2413. 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
  2414. Sriraman Tallam <tmsriram@google.com>
  2415. * options.h (sort_section): New option.
  2416. * output.h (Input_section_sort_section_prefix_special_ordering_compare):
  2417. Rename from Input_section_sort_section_name_special_ordering_compare.
  2418. (Input_section_sort_section_name_compare): New struct.
  2419. * output.cc (Output_section::Input_section_sort_section_name_compare::
  2420. operator()): New function.
  2421. (Output_section::sort_attached_input_sections): Use new sort function
  2422. for .text if --sort-section=name is specified.
  2423. * layout.cc (Layout::make_output_section):
  2424. Add sorting by name when --sort-section=name is specified.
  2425. * testsuite/Makefile.am (text_section_grouping): Test option
  2426. --sort-section=name.
  2427. * testsuite/Makefile.in: Regenerate.
  2428. * testsuite/section_sorting_name.cc: New file.
  2429. * testsuite/section_sorting_name.sh: New file.
  2430. 2013-05-21 Cary Coutant <ccoutant@google.com>
  2431. * symtab.h (Symbol::is_cxx_vtable): New function.
  2432. * target-reloc.h (relocate_section): Check for vtable symbol.
  2433. * testsuite/Makefile.am (missing_key_func.sh): New test case.
  2434. * testsuite/Makefile.in: Regenerate.
  2435. * testsuite/missing_key_func.cc: New test source.
  2436. * testsuite/missing_key_func.sh: New test script.
  2437. 2013-05-21 Cary Coutant <ccoutant@google.com>
  2438. * object.cc (Sized_relobj_file::get_symbol_location_info): Set
  2439. type of enclosing symbol.
  2440. (Relocate_info::location): Check symbol type when describing symbol.
  2441. * object.h (Symbol_location_info): Remove unused line_number;
  2442. add enclosing_symbol_type.
  2443. * testsuite/debug_msg.sh: Adjust expected output.
  2444. 2013-05-13 Cary Coutant <ccoutant@google.com>
  2445. * configure.ac: Export DEFAULT_TARGET.
  2446. * configure: Regenerate.
  2447. * Makefile.in: Regenerate.
  2448. * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
  2449. * testsuite/Makefile.in: Regenerate.
  2450. * testsuite/debug_msg.sh: Delete duplicate tests.
  2451. Don't check undef_int error message match for powerpc where the
  2452. source file and line number aren't available.
  2453. 2013-05-10 Roland McGrath <mcgrathr@google.com>
  2454. * options.h (General_options): Add --rosegment-gap option.
  2455. * options.cc (finalize): --rosegment-gap implies --rosegment.
  2456. * layout.cc (set_segment_offsets): Let user option override
  2457. target->rosegment_gap().
  2458. 2013-05-10 Roland McGrath <mcgrathr@google.com>
  2459. * options.h (General_options): Remove leading space from help
  2460. messages for -nostdlib and --rosegment.
  2461. 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
  2462. PR ld/15365
  2463. * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
  2464. 2013-05-03 Alan Modra <amodra@gmail.com>
  2465. * merge.cc (Output_merge_string::do_add_input_section): Correct
  2466. scan for number of strings. Rename vars to avoid shadowing.
  2467. Include missing terminator in input_size_.
  2468. 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
  2469. * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
  2470. Restore empty string handling.
  2471. 2013-05-01 Cary Coutant <ccoutant@google.com>
  2472. * stringpool.cc (Stringpool_template::new_key_offset): Fix
  2473. uninitialized warning.
  2474. 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
  2475. * output.cc (Output_section::add_merge_input_section): Allow
  2476. to merge sections if the alignment is more than character size.
  2477. * merge.h (Output_merge_string::Output_merge_string): Remove
  2478. assert.
  2479. * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
  2480. only not-null strings. Check the alignment of strings.
  2481. * stringpool.h
  2482. (Stringpool_template<Stringpool_char>::Stringpool_template): Add
  2483. alignment as the argument.
  2484. (Stringpool_template<Stringpool_char>::addralign_): New class member.
  2485. * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
  2486. Align non-zero length strings according to the addralign_.
  2487. (Stringpool_template<Stringpool_char>::set_string_offsets):
  2488. Updating offsets according to the given alignment.
  2489. * testsuite/Makefile.am (text_section_grouping): Test if string
  2490. literals are getting merged.
  2491. * testsuite/Makefile.in: Regenerate.
  2492. * testsuite/merge_string_literals_1.c: New file.
  2493. * testsuite/merge_string_literals_2.c: Ditto.
  2494. * testsuite/merge_string_literals.sh: Ditto.
  2495. 2013-04-26 Ian Lance Taylor <iant@google.com>
  2496. * target-reloc.h (relocate_section): If the reloc offset is out of
  2497. range, pass VIEW as NULL to relocate.relocate.
  2498. * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
  2499. * i386.cc (Target_i386::Relocate::relocate): Likewise.
  2500. * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
  2501. * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
  2502. * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
  2503. * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
  2504. 2013-04-26 Geoff Pike <gpike@chromium.org>
  2505. * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
  2506. * layout.cc (Hash_task): New class.
  2507. (Layout::queue_build_id_tasks): New function.
  2508. (Layout::write_build_id): Handle single-thread portion of build ID
  2509. computation. (In some cases, all of it is single-threaded.) Replace
  2510. {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
  2511. functionality in fewer lines of code.
  2512. * layout.h (Layout::queue_build_id_tasks): New function declaration.
  2513. * options.h (General_options): make "--build-id" default to tree
  2514. rather than sha1. Add two new options related to --build-id=tree:
  2515. --build-id-chunk-size-for-treehash and
  2516. --build-id-min-file-size-for-treehash.
  2517. * Makefile.am: add testing of --build-id=tree and related new options
  2518. (these tests will be invoked by "make check").
  2519. * Makefile.in: Regenerate.
  2520. 2013-04-25 Alan Modra <amodra@gmail.com>
  2521. * configure.tgt: Add powerpcle and powerpc64le.
  2522. 2013-04-22 Alan Modra <amodra@gmail.com>
  2523. PR gold/15355
  2524. * layout.cc (Layout::segment_precedes): Allow more than one
  2525. segment with the same type and flags.
  2526. 2013-04-15 Cary Coutant <ccoutant@google.com>
  2527. * layout.cc (Layout::set_relocatable_section_offsets): Don't
  2528. allocate space in file for BSS sections.
  2529. 2013-04-15 Cary Coutant <ccoutant@google.com>
  2530. * script-sections.cc (Orphan_output_section): Reset address
  2531. to zero after each orphaned section for relocatable links.
  2532. 2013-04-15 Cary Coutant <ccoutant@google.com>
  2533. * symtab.cc (Symbol_table::sized_write_globals): Subtract
  2534. section starting address for relocatable link.
  2535. * testsuite/Makefile.am (script_test_11): New test.
  2536. * testsuite/Makefile.in: Regenerate.
  2537. * testsuite/script_test_11.c: New source file.
  2538. * testsuite/script_test_11.t: New linker script.
  2539. 2013-04-13 Alan Modra <amodra@gmail.com>
  2540. * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
  2541. owner when sections are not adjacent and exceed group size.
  2542. (Target_powerpc::group_sections): Handle corner case.
  2543. (Target_powerpc::Branch_info::make_stub): Handle case where
  2544. stub table doesn't exist due to branches in non-exec sections.
  2545. (Target_powerpc::Relocate::relocate): Likewise.
  2546. 2013-04-11 Alan Modra <amodra@gmail.com>
  2547. PR gold/15354
  2548. * powerpc.cc (Target_powerpc::make_brlt_section): Name section
  2549. .branch_lt to match bfd ld. Adjust comments throughout file.
  2550. 2013-04-04 Ian Lance Taylor <iant@google.com>
  2551. GCC PR c++/56840
  2552. * object.cc (do_layout_deferred_sections): Handle .eh_frame
  2553. sections before checking whether they are included in the link.
  2554. 2013-03-29 Sriraman Tallam <tmsriram@google.com>
  2555. * archive.cc (Archive::get_elf_object_for_member): Create the elf
  2556. object before calling the plugin claim_file handler. Pass the elf
  2557. object of the archive to the plugin. Delete the elf object if the
  2558. plugin claims the file.
  2559. 2013-03-21 Alan Modra <amodra@gmail.com>
  2560. * layout.cc (Layout::set_segment_offsets): Accept writable .text
  2561. segment when omagic.
  2562. 2013-03-21 Alan Modra <amodra@gmail.com>
  2563. * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
  2564. comparison warning.
  2565. * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
  2566. uninitialized" warning.
  2567. 2013-03-20 Alan Modra <amodra@gmail.com>
  2568. * symtab.h (Symbol::clear_version): New function.
  2569. * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
  2570. is_needed by weak references. Clear version for symbols defined
  2571. in as-needed objects that are not needed.
  2572. 2013-03-15 Alan Modra <amodra@gmail.com>
  2573. * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
  2574. static and public. Add report_err param. Return false for data refs.
  2575. (Target_powerpc::rela_dyn_section): New overloaded function.
  2576. (Target_powerpc::plt_, iplt_): Elucidate.
  2577. (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
  2578. (Output_data_plt_powerpc::do_write): Don't write .iplt.
  2579. (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
  2580. (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
  2581. calls. Put ifunc dynamic relocs in irela_dyn_section. Only
  2582. push_branch and make_plt_entry for ifunc syms when
  2583. reloc_needs_plt_for_ifunc.
  2584. (Target_powerpc::Relocate::relocate): Don't use plt entry value
  2585. for ifunc unless reloc_needs_plt_for_ifunc.
  2586. 2013-03-15 Alan Modra <amodra@gmail.com>
  2587. * gc.h (gc_process_relocs): Don't look through function descriptors.
  2588. * icf.cc (get_section_contents): Do so here instead.
  2589. 2013-03-13 Alan Modra <amodra@gmail.com>
  2590. * powerpc.cc (is_branch_reloc): Forward declare.
  2591. (Target_powerpc::do_can_check_for_function_pointers): New predicate.
  2592. (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
  2593. false for 64-bit, true for 32-bit non-branch relocs.
  2594. (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
  2595. * testsuite/Makefile.am (icf_test): Use linker map file instead of
  2596. nm output.
  2597. (icf_safe_test): Generate linker map file as well as nm output.
  2598. (icf_safe_so_test): Likewise.
  2599. * testsuite/Makefile.in: Regenerate.
  2600. * testsuite/icf_test.sh: Parse linker map file to determine
  2601. section folding.
  2602. * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
  2603. * testsuite/icf_safe_so_test.sh: Likewise.
  2604. (X86_32_or_ARM_specific_safe_fold): Merge into..
  2605. (arch_specific_safe_fold): ..this.
  2606. (X86_64_specific_safe_fold): Delete unused function.
  2607. 2013-03-12 Alan Modra <amodra@gmail.com>
  2608. * gc.h (gc_process_relocs): Look through function descriptors
  2609. to determine shndx, symvalue and addend used by ICF. Tidy
  2610. variable duplication.
  2611. 2013-03-11 Alan Modra <amodra@gmail.com>
  2612. * gold.cc (queue_middle_tasks): Move detect_odr_violations..
  2613. * layout.cc (Layout_task_runner::run): ..to here.
  2614. * symtab.h (struct Symbol_location): Extract from..
  2615. (class Symbol_table): ..here.
  2616. * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
  2617. * target.h (class Target): Add function_location and
  2618. do_function_location functions.
  2619. (class Sized_target): Add do_function_location.
  2620. * object.h (class Sized_relobj_file): Move find_shdr..
  2621. (class Object): ..to here.
  2622. * object.cc: Likewise. Update to suit. Instantiate.
  2623. (Sized_relobj_file::find_eh_frame): Update find_shdr call.
  2624. * powerpc.cc (class Powerpc_dynobj): New.
  2625. (Target_powerpc::do_function_location): New function.
  2626. (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
  2627. (Powerpc_dynobj::do_read_symbols): New function.
  2628. (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
  2629. 2013-03-08 Ian Lance Taylor <iant@google.com>
  2630. * options.cc (General_options::string_to_object_format): Accept
  2631. "default".
  2632. 2013-03-08 Alan Modra <amodra@gmail.com>
  2633. * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
  2634. pointer to Post_fde.
  2635. (struct Post_fde): Move definition to here..
  2636. * ehframe.cc (struct Post_fde): ..from here.
  2637. (Cie::write): Don't alloc Post_fde.
  2638. (Eh_frame::do_sized_write): Update. Don't free Post_fde.
  2639. 2013-03-07 Alan Modra <amodra@gmail.com>
  2640. * testsuite/discard_locals_relocatable_test.c: Add a powerpc
  2641. relocation referencing .LC0.
  2642. * testsuite/discard_locals_test.sh: Remove FIXMEs.
  2643. 2013-03-07 Alan Modra <amodra@gmail.com>
  2644. * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
  2645. always_inline. Add assembly for powerpc to avoid GOT.
  2646. 2013-03-07 Alan Modra <amodra@gmail.com>
  2647. * testsuite/script_test_10.sh: Don't test .bss section
  2648. header number.
  2649. 2013-03-06 Alan Modra <amodra@gmail.com>
  2650. * powerpc.cc (class Powerpc_relobj): Move some member functions.
  2651. (Target_powerpc::symval_for_branch): Add symtab param. Update
  2652. all callers. Handle folded sections.
  2653. (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
  2654. to Powerpc_relobj.
  2655. (Global_symbol_visitor_opd::operator()): Likewise.
  2656. 2013-03-04 Alan Modra <amodra@gmail.com>
  2657. * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
  2658. * testsuite/Makefile.in: Regenerate.
  2659. 2013-03-01 Cary Coutant <ccoutant@google.com>
  2660. Add dwp support for v2 DWARF package file format.
  2661. * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
  2662. tu_length parameter. Adjust all callers.
  2663. * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
  2664. * dwp.cc: Include dwarf.h.
  2665. (Section_bounds): New struct type.
  2666. (Unit_set): New struct type.
  2667. (Dwo_file::Dwo_file): Initialize new data member.
  2668. (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
  2669. Combine and rename to...
  2670. (Dwo_file::read_unit_index): ...this.
  2671. (Dwo_file::sized_read_compunit_index)
  2672. (Dwo_file::sized_read_typeunit_index): Combine and rename to...
  2673. (Dwo_file::sized_read_unit_index): ...this.
  2674. (Dwo_file::copy_section): Remove section_name, is_str_offsets
  2675. parameters; add section_id parameter.
  2676. (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
  2677. (Dwo_file::add_unit_set): ...this.
  2678. (Dwo_file::shndx_map_): Remove.
  2679. (Dwo_file::sect_offsets_): New data member.
  2680. (Dwp_output_file::Dwp_output_file): Initialize new data members.
  2681. (Dwp_output_file::add_section): Rename to...
  2682. (Dwp_output_file::add_contribution): ...this.
  2683. (Dwp_output_file::add_cu_set): Combine parameters into a struct.
  2684. (Dwp_output_file::add_tu_set): Likewise.
  2685. (Dwp_output_file::Contribution): New type.
  2686. (Dwp_output_file::Section::contributions): New data member.
  2687. (Dwp_output_file::Cu_or_tu_set): Remove.
  2688. (Dwp_output_file::Section::Section): New ctor.
  2689. (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
  2690. (Dwp_output_file::Dwp_index::Section_table): New type.
  2691. (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
  2692. (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
  2693. parameter.
  2694. (Dwp_output_file::Dwp_index::shndx_pool): Remove.
  2695. (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
  2696. (Dwp_output_file::Dwp_index::section_table): New member function.
  2697. (Dwp_output_file::Dwp_index::section_table_end): New member function.
  2698. (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
  2699. (Dwp_output_file::Dwp_index::section_table_rows): New member function.
  2700. (Dwp_output_file::Dwp_index::section_table_cols): New member function.
  2701. (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
  2702. (Dwp_output_file::Dwp_index::section_table_): New data member.
  2703. (Dwp_output_file::Dwp_index::section_mask_): New data member.
  2704. (Dwp_output_file::add_output_section): New member function.
  2705. (Dwp_output_file::write_new_section): New member function.
  2706. (Dwp_output_file::write_contributions): New member function.
  2707. (Dwp_output_file::section_id_map_): New data member.
  2708. (class Dwo_id_info_reader): Remove.
  2709. (class Unit_reader): New class.
  2710. (get_dwarf_section_name): New function.
  2711. (Dwo_file::read_executable): Adjust initializations of class data.
  2712. (Dwo_file::read): Add support for v2 package file format.
  2713. (Dwo_file::read_unit_index): Likewise.
  2714. (Dwo_file::sized_read_unit_index): Likewise.
  2715. (Dwo_file::copy_section): Likewise.
  2716. (Dwo_file::add_unit_set): Likewise.
  2717. (Dwp_output_file::add_output_section): Likewise.
  2718. (Dwp_output_file::add_contribution): Likewise.
  2719. (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
  2720. for empty slot.
  2721. (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
  2722. file format.
  2723. (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
  2724. slot.
  2725. (Dwp_output_file::initialize): Remove unused function.
  2726. (Dwp_output_file::finalize): Add support for v2 package file format.
  2727. (Dwp_output_file::write_index): Likewise.
  2728. * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
  2729. function prototype.
  2730. 2013-03-01 Cary Coutant <ccoutant@google.com>
  2731. * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
  2732. function into class definition in header file.
  2733. (Dwarf_info_reader::warn_corrupt_debug_section): New function.
  2734. * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
  2735. New function.
  2736. (Dwarf_info_reader::check_buffer): Move here from .cc file.
  2737. 2013-02-28 Alan Modra <amodra@gmail.com>
  2738. * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
  2739. * target.cc (Target::do_plt_fde_location): New function.
  2740. * ehframe.h (class FDE): Add post_map field to u_.from_linker,
  2741. accessor function, and constructor param.
  2742. (struct Post_fde, Post_fdes): Declare.
  2743. (Cie::write): Add post_fdes param.
  2744. * ehframe.cc (Fde::write): Use plt_fde_location.
  2745. (struct Post_fde): Define.
  2746. (Cie::write): Stash FDEs added post merge mapping.
  2747. (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
  2748. Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
  2749. (Eh_frame::do_sized_write): Arrange to write post map FDES after
  2750. other FDEs.
  2751. * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
  2752. (Target_powerpc::has_glink): New function.
  2753. (Target_powerpc::do_relax): Add eh_frame info for stubs.
  2754. (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
  2755. glink_eh_frame_fde_32, default_fde): New data.
  2756. (Stub_table::eh_frame_added_): New var.
  2757. (Stub_table::find_long_branch_entry, stub_address, stub_offset):
  2758. Make const.
  2759. (Stub_table::add_eh_frame): New function.
  2760. (Output_data_glink::add_eh_frame): New function.
  2761. (Target_powerpc::make_glink_section): Call add_eh_frame.
  2762. 2013-02-15 Ian Lance Taylor <iant@google.com>
  2763. * options.h (DEFINE_uint64_alias): Define.
  2764. (class General_options): Add -Ttext-segment as an alias for
  2765. -Ttext.
  2766. 2013-02-15 Alan Modra <amodra@gmail.com>
  2767. * powerpc.cc (Stub_table::plt_off): New function, extracted from..
  2768. (Stub_table::do_write): ..here, two places.
  2769. (Stub_table::plt_call_size): Use it here too.
  2770. 2013-02-11 Ian Lance Taylor <iant@google.com>
  2771. * descriptors.cc (Descriptors::close_all): New function.
  2772. * descriptors.h (class Descriptors): Declare close_all.
  2773. (close_all_descriptors): New inline function.
  2774. * plugin.cc: Include "descriptors.h".
  2775. (Plugin_manager::cleanup): Call close_all_descriptors.
  2776. 2013-02-06 Alan Modra <amodra@gmail.com>
  2777. * README: Update coding style link.
  2778. 2013-01-28 Cary Coutant <ccoutant@google.com>
  2779. * dwp.cc (File_list): New typedef.
  2780. (Dwo_name_info_reader): New class.
  2781. (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
  2782. (Dwo_id_info_reader::visit_top_die): Remove unused member function.
  2783. (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
  2784. (Dwo_file::read_executable): New function.
  2785. (Dwo_file::read): Move common setup code to ...
  2786. (Dwo_file::make_object): ... here.
  2787. (dwp_options): Add --exec/-e.
  2788. (usage): Likewise.
  2789. (main): Likewise.
  2790. 2013-01-24 Sriraman Tallam <tmsriram@google.com>
  2791. * layout.cc (Layout::layout): Check for option text_reorder.
  2792. (Layout::make_output_section): Ditto.
  2793. * options.h (text_reorder): New option.
  2794. * output.cc (Input_section_sort_compare): Remove special ordering
  2795. of section names.
  2796. (Output_section::
  2797. Input_section_sort_section_name_special_ordering_compare::
  2798. operator()): New function.
  2799. (Output_section::sort_attached_input_sections): Use new sort function
  2800. for .text.
  2801. * output.h (Input_section_sort_section_name_special_ordering_compare):
  2802. New struct.
  2803. * testsuite/Makefile.am (text_section_grouping): Test option
  2804. --no-text-reorder
  2805. * testsuite/Makefile.in: Regenerate.
  2806. * testsuite/text_section_grouping.sh: Check order of functions without
  2807. default text reordering.
  2808. 2013-01-18 Mike Frysinger <vapier@gentoo.org>
  2809. * options.h (General_options): Change default to true for new_dtags.
  2810. 2013-01-18 Mike Frysinger <vapier@gentoo.org>
  2811. * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
  2812. when enable_new_dtags is false. Only add DT_RUNPATH when
  2813. enable_new_dtags is true.
  2814. 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
  2815. * powerpc.cc (Stub_table::find_plt_call_entry): Make types
  2816. used in declaration and definition consistent.
  2817. (Target_powerpc::symval_for_branch): Ditto.
  2818. 2013-01-16 Sriraman Tallam <tmsriram@google.com>
  2819. * testsuite/plugin_final_layout.cc: Fix comment.
  2820. 2013-01-16 Sriraman Tallam <tmsriram@google.com>
  2821. * layout.cc (Layout::layout): Do not do default sorting for
  2822. text sections when section ordering is specified.
  2823. (make_output_section): Ditto.
  2824. * testsuite/plugin_final_layout.cc: Name the function sections
  2825. to catch reordering issues.
  2826. 2013-01-15 Alan Modra <amodra@gmail.com>
  2827. * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
  2828. plt-thread-safe.
  2829. 2013-01-15 Alan Modra <amodra@gmail.com>
  2830. * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
  2831. * testsuite/Makefile.in: Regenerate.
  2832. 2013-01-14 Alan Modra <amodra@gmail.com>
  2833. * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
  2834. * testsuite/Makefile.in: Regenerate.
  2835. 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
  2836. PR bfd/14430
  2837. Fix mingw gold build with plugins enabled
  2838. * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
  2839. * configure.ac: Export DLOPEN_LIBS and add headers check.
  2840. * plugin.cc: Handle non-dlfcn case.
  2841. * Makefile.in: Regenerate.
  2842. * config.in: Regenerate.
  2843. * configure: Regenerate.
  2844. * testsuite/Makefile.in: Regenerate.
  2845. 2013-01-09 Sriraman Tallam <tmsriram@google.com>
  2846. * output.h (sort_attached_input_sections): Change to be public.
  2847. * script-sections.cc
  2848. (Output_section_definition::set_section_addresses): Sort
  2849. attached input sections according to section order before linker
  2850. script assigns section addresses.
  2851. (Orphan_output_section::set_section_addresses): Sort
  2852. attached input sections according to section order before linker
  2853. script assigns section addresses.
  2854. * Makefile.am (final_layout.sh): Use a simple linker script to
  2855. check if section ordering still works.
  2856. * Makefile.in: Regenerate.
  2857. 2013-01-09 Ben Cheng <bccheng@google.com>
  2858. * arm.cc (Target_arm::attributes_accept_div): New function.
  2859. (Target_arm::attributes_forbid_div): New function.
  2860. (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
  2861. attribute using the same new functions as what bfd/elf32_arm.c
  2862. does.
  2863. 2013-01-07 Cary Coutant <ccoutant@google.com>
  2864. PR gold/14993
  2865. * output.cc (Output_section::add_input_section): For incremental
  2866. updates, don't track input sections that are allocated from patch
  2867. space.
  2868. 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
  2869. Ian Lance Taylor <iant@google.com>
  2870. PR gold/14897
  2871. * configure.ac (--enable-ld): Removed.
  2872. (install_as_default): Set to yes only for --enable-gold=default
  2873. or --disable-ld.
  2874. * configure: Regenerated.
  2875. 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
  2876. * options.h (General_options): Add -fuse-ld= for GCC linker
  2877. option compatibility.
  2878. 2013-01-04 Cary Coutant <ccoutant@google.com>
  2879. * configure.ac: Fix typo restoring CXXFLAGS.
  2880. * configure: Regenerate.
  2881. 2013-01-04 Cary Coutant <ccoutant@google.com>
  2882. * testsuite/Makefile.am (CXXLINK_S): New macro.
  2883. (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
  2884. * testsuite/Makefile.in: Regenerate.
  2885. 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
  2886. * version.cc (print_version): Update copyright year to 2013.
  2887. 2012-12-20 Ian Lance Taylor <iant@google.com>
  2888. * layout.cc (Layout::special_ordering_of_input_section): New
  2889. function.
  2890. (Layout::layout): If input section requires special ordering, must
  2891. sort input sections.
  2892. (Layout::make_output_section): May sort .text input sections.
  2893. (Layout::is_section_name_prefix_grouped): Remove.
  2894. * layout.h (class Layout): Declare
  2895. special_ordering_of_input_section. Don't declare
  2896. is_section_name_prefix_grouped.
  2897. * output.cc (Output_section::add_input_section): Revert last
  2898. change.
  2899. (Output_section::Input_section_sort::match_file_name): Don't crash
  2900. if called on output section data.
  2901. (Output_section::Input_section_sort_compare): Sort based on
  2902. special ordering.
  2903. (Output_section::Input_section_sort_section_order_index_compare):
  2904. Revert last patch.
  2905. (Output_section::sort_attached_input_sections): Likewise.
  2906. 2012-12-18 Sriraman Tallam <tmsriram@google.com>
  2907. * layout.cc (Layout::is_section_name_prefix_grouped): New function.
  2908. * layout.h (Layout::is_section_name_prefix_grouped): New function.
  2909. * output.cc (Output_section::add_input_section): Check if section
  2910. name contains special prefix. Keep input sections to sort such
  2911. sections.
  2912. (Output_section::Input_section_sort_section_order_index_compare
  2913. ::operator()): Group sections according to prefixes.
  2914. (Output_section::sort_attached_input_sections): Add condition to
  2915. Input_section_entry constructor call.
  2916. * testsuite/Makefile.am (text_section_grouping): New test.
  2917. * testsuite/Makefile.in: Regenerate.
  2918. * testsuite/text_section_grouping.cc: New file.
  2919. * testsuite/text_section_grouping.sh: New file.
  2920. 2012-12-17 Nick Clifton <nickc@redhat.com>
  2921. * Makefile.am: Add copyright notice.
  2922. * NEWS: Likewise.
  2923. * README: Likewise.
  2924. * configure.ac: Likewise.
  2925. * ftruncate.c: Likewise.
  2926. * Makefile.in: Regenerate.
  2927. 2012-12-14 Cary Coutant <ccoutant@google.com>
  2928. * testsuite/Makefile.am (exception_separate_shared_12_test): Add
  2929. --no-as-needed flag.
  2930. (exception_separate_shared_12_test): Likewise.
  2931. (incremental_copy_test): Likewise.
  2932. * testsuite/Makefile.in: Regenerate.
  2933. 2012-12-14 Cary Coutant <ccoutant@google.com>
  2934. * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
  2935. (Dwp_output_file::Dwp_index::enter_set): Add assert.
  2936. 2012-12-12 Alan Modra <amodra@gmail.com>
  2937. * powerpc.cc (class Track_tls): New.
  2938. (class Relocate, class Scan): Inherit Track_tls.
  2939. (Target_powerpc::Scan::local, global): Track tls optimization
  2940. and avoid creating plt entry for __tls_get_addr if all uses
  2941. are optimized away.
  2942. (Target_powerpc::Relocate::relocate): Update to use Track_tls.
  2943. 2012-12-12 Alan Modra <amodra@gmail.com>
  2944. * options.h (General_options): Add --toc-sort/--no-toc-sort.
  2945. Replace no_toc_optimize with toc_optimize.
  2946. * output.h (Output_section::input_sections): Provide non-const variant.
  2947. * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
  2948. set_has_small_toc_reloc, has_small_toc_reloc): New variable and
  2949. accessors.
  2950. (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
  2951. (class Sort_toc_sections): New.
  2952. (Target_powerpc::do_finalize_sections): Sort toc sections.
  2953. (Target_powerpc::Relocate::relocate): Update toc_optimize test.
  2954. 2012-12-10 Roland McGrath <mcgrathr@google.com>
  2955. * testsuite/binary_unittest.cc (read_all): New function.
  2956. (Sized_binary_test): Use it instead of ::read.
  2957. * fileread.cc (do_read): Don't assume pread always reads the whole
  2958. amount in a single call.
  2959. 2012-12-10 Alan Modra <amodra@gmail.com>
  2960. * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
  2961. Set EM_PPC64 or EM_PPC here.
  2962. (Target_selector_powerpc::do_recognize): Delete.
  2963. 2012-12-10 Alan Modra <amodra@gmail.com>
  2964. * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
  2965. stub_table_.
  2966. (Target_powerpc::Branch_info::make_stub): Don't omit addend.
  2967. 2012-12-07 Roland McGrath <mcgrathr@google.com>
  2968. * testsuite/binary_unittest.cc (Sized_binary_test):
  2969. Use open_descriptor rather than ::open.
  2970. 2012-12-07 Alan Modra <amodra@gmail.com>
  2971. * powerpc.cc (Stub_table::do_write): Delete redundant Address
  2972. typedef and invalid_address constant.
  2973. (Output_data_glink, Stub_table, Target_powerpc): Explicitly
  2974. instantiate constants.
  2975. 2012-12-06 Roland McGrath <mcgrathr@google.com>
  2976. * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
  2977. Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
  2978. * aclocal.m4: Regenerate.
  2979. * configure: Regenerate.
  2980. * Makefile.in: Regenerate.
  2981. * testsuite/Makefile.in: Regenerate.
  2982. 2012-12-07 Alan Modra <amodra@gmail.com>
  2983. * options.h (General_options): Add no_toc_optimize.
  2984. * powerpc.cc (ok_lo_toc_insn): New function.
  2985. (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
  2986. 2012-12-06 Alan Modra <amodra@gmail.com>
  2987. * options.h (General_options): Add plt_align, plt_static_chain,
  2988. plt_thread_safe. Update stub_group_size help text.
  2989. * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
  2990. for new plt_thread_safe_ var.
  2991. (use_plt_offset): Correct comments.
  2992. (Target_powerpc::do_relax): Look for thread creation symbols to
  2993. determine default plt_thread_safe value. Clear plt call stubs
  2994. as well as branch stubs each iteration.
  2995. (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
  2996. insn constants.
  2997. (l, hi, ha, write_insn): Move earlier.
  2998. (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
  2999. (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
  3000. plt stubs too.
  3001. (Stub_table::update_size): Adjust.
  3002. (Stub_table::prev_size, set_prev_size): Delete.
  3003. (Stub_table::stub_align): Let --plt-align affect result.
  3004. (Stub_table::plt_call_size): Calculate sizes for various stubs.
  3005. (Stub_table::branch_stub_size): Use last_plt_size in address calc.
  3006. (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
  3007. (Stub_table::do_write): Support more stub variants.
  3008. 2012-12-04 Alan Modra <amodra@gmail.com>
  3009. * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
  3010. (Target_powerpc::do_define_standard_symbols): New function.
  3011. 2012-12-03 Alan Modra <amodra@gmail.com>
  3012. * output.h: Formatting, whitespace.
  3013. 2012-12-03 Alan Modra <amodra@gmail.com>
  3014. * layout.h (Layout::get_executable_sections): Declare.
  3015. * layout.cc (Layout::get_executable_sections): New function.
  3016. * arm.cc (Target_arm::group_sections): Use it.
  3017. (Arm_output_section::group_sections): Delete now redundant test.
  3018. * output.cc (Output_reloc::Output_reloc): Add is_relative.
  3019. param to handle relative relocs.
  3020. * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
  3021. (Output_data_reloc::add_absolute): Adjust.
  3022. (Output_data_reloc::add_relative): New function.
  3023. (Output_data::reset_data_size): New function.
  3024. (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
  3025. (Output_section::set_addralign): New function.
  3026. (Output_section::checkpoint_set_addralign): New function.
  3027. (Output_section::clear_section_offsets_need_adjustment): New function.
  3028. (Output_section::input_sections): Make public.
  3029. * powerpc.cc (class Output_data_brlt_powerpc): New.
  3030. (class Stub_table, class Stub_control): New.
  3031. (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
  3032. stub_table_, set_stub_table, stub_table): New vectors and accessor
  3033. functions.
  3034. (Target_powerpc::do_may_relax, do_relax, push_branch,
  3035. new_stub_table, stub_tables, brlt_section, group_sections,
  3036. add_branch_lookup_table, find_branch_lookup_table,
  3037. write_branch_lookup_table, make_brlt_section): New functions.
  3038. (Target_powerpc::struct Sort_sections, class Branch_info): New.
  3039. (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
  3040. branch_info_): New vars.
  3041. (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
  3042. make call stubs here.
  3043. (Output_data_glink): Remove all call stub handling from this class.
  3044. (Target_powerpc::Scan::local, global): Save interesting branch
  3045. relocs and relocs for ifunc. Adjust calls to plt entry functions.
  3046. (Target_powerpc::do_finalize_sections): Only make reg save/restore
  3047. functions on final link.
  3048. (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
  3049. Handle long branch destinations too.
  3050. (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
  3051. do_plt_address_for_local): Adjust lookup of plt call stubs.
  3052. 2012-11-30 Alan Modra <amodra@gmail.com>
  3053. * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
  3054. relocs against protected symbols when building 32-bit shared libs.
  3055. 2012-11-30 Alan Modra <amodra@gmail.com>
  3056. * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
  3057. param. Call got_section() to make .got. Update all callers
  3058. and their callers and so on.
  3059. 2012-11-30 Alan Modra <amodra@gmail.com>
  3060. * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
  3061. _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
  3062. (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
  3063. value if it already exists.
  3064. 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
  3065. PR gold/14858
  3066. * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
  3067. 2012-11-14 Roland McGrath <mcgrathr@google.com>
  3068. * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
  3069. than bfc instruction for data sandboxing.
  3070. 2012-11-08 Alan Modra <amodra@gmail.com>
  3071. * po/POTFILES.in: Regenerate.
  3072. 2012-11-05 Alan Modra <amodra@gmail.com>
  3073. * configure.ac: Apply 2012-09-10 change to config.in here.
  3074. * configure: Regenerate.
  3075. 2012-11-05 Alan Modra <amodra@gmail.com>
  3076. * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
  3077. (struct Opd_ent): Use "Address" rather than "Offset".
  3078. (Output_data_got_powerpc::got_base_offset): Return Valtype.
  3079. (Target_powerpc::got_section): Make public.
  3080. (Target_powerpc::scan_relocs): Move code setting symbols..
  3081. (Powerpc_relobj::do_scan_relocs): ..to here, new function.
  3082. Create _SDA_BASE_ only when referenced.
  3083. 2012-11-02 Roland McGrath <mcgrathr@google.com>
  3084. * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
  3085. from last change.
  3086. 2012-11-01 Roland McGrath <mcgrathr@google.com>
  3087. * target.h (Sized_target::relocate_relocs): Use Elf_Off
  3088. for offset_in_output_section parameter.
  3089. (Sized_target::relocate_special_relocatable): Likewise.
  3090. * arm.cc (Target_arm::relocate_relocs): Likewise.
  3091. (Target_arm::relocate_special_relocatable): Likewise.
  3092. * i386.cc (Target_i386::relocate_relocs): Likewise.
  3093. * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
  3094. * sparc.cc (Target_sparc::relocate_relocs): Likewise.
  3095. * target-reloc.h (relocate_relocs): Likewise.
  3096. * testsuite/testfile.cc (Target_test): Likewise.
  3097. * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
  3098. * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
  3099. * system.h: Move inclusion of <clocale> to after <libintl.h> in
  3100. [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
  3101. * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
  3102. parameter, which is unused in the [!F_SETFD] case.
  3103. * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
  3104. SYMNDX to off_t before comparing it to this->data_size().
  3105. * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
  3106. * incremental.cc (Output_section_incremental_inputs::do_write):
  3107. Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
  3108. * nacl.cc: Include "libiberty.h" for vasprintf declaration.
  3109. 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
  3110. * gold.cc (Target_arm::do_adjust_elf_header): Add the
  3111. hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
  3112. in EABI_VER5.
  3113. 2012-10-29 Cary Coutant <ccoutant@google.com>
  3114. * dwp.cc (usage): Add file and exit status parameters;
  3115. add --help and --version options.
  3116. (print_version): New function.
  3117. (main): Add --help and --version options.
  3118. 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
  3119. * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
  3120. final_layout_sequence.txt.
  3121. * testsuite/Makefile.in: Regenerated.
  3122. 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
  3123. * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
  3124. COMPILE generated by automake.
  3125. (LINK1): Likewise.
  3126. (CXXCOMPILE1): Likewise.
  3127. (CXXLINK1): Likewise.
  3128. (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
  3129. (LINK): Likewise.
  3130. (CXXCOMPILE): Likewise.
  3131. (CXXLINK): Likewise.
  3132. * testsuite/Makefile.in: Regenerated.
  3133. 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
  3134. * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
  3135. on bad fwrite return.
  3136. 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
  3137. * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
  3138. on val.
  3139. 2012-10-23 Cary Coutant <ccoutant@google.com>
  3140. * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
  3141. * testsuite/Makefile.in: Regenerate.
  3142. * testsuite/dwp_test.h: New source file.
  3143. * testsuite/dwp_test_1.cc: New source file.
  3144. * testsuite/dwp_test_1.s: New source file.
  3145. * testsuite/dwp_test_1.sh: New source file.
  3146. * testsuite/dwp_test_1b.cc: New source file.
  3147. * testsuite/dwp_test_1b.s: New source file.
  3148. * testsuite/dwp_test_2.cc: New source file.
  3149. * testsuite/dwp_test_2.s: New source file.
  3150. * testsuite/dwp_test_2.sh: New source file.
  3151. * testsuite/dwp_test_main.cc: New source file.
  3152. * testsuite/dwp_test_main.s: New source file.
  3153. 2012-10-23 Cary Coutant <ccoutant@google.com>
  3154. * dwp.h: New header file.
  3155. * dwp.cc: New source file.
  3156. * gold.h: Move shared declarations to system.h.
  3157. * system.h: New header file.
  3158. * Makefile.am: Add dwp.
  3159. * Makefile.in: Regenerate.
  3160. 2012-10-23 Cary Coutant <ccoutant@google.com>
  3161. * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
  3162. Dwarf_info_reader::read_from_pointer.
  3163. (Dwarf_pubnames_table::read_header): Likewise.
  3164. (Dwarf_pubnames_table::next_name): Likewise.
  3165. (Dwarf_die::read_attributes): Likewise.
  3166. (Dwarf_die::skip_attributes): Likewise.
  3167. (Dwarf_info_reader::read_from_pointer): New function template.
  3168. * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
  3169. (Dwarf_pubnames_table): Likewise.
  3170. (Dwarf_info_reader::read_from_pointer): New function template.
  3171. * gdb-index.cc (Gdb_index_info_reader): Adjust call to
  3172. Dwarf_pubnames_table ctor.
  3173. 2012-10-23 Cary Coutant <ccoutant@google.com>
  3174. * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
  3175. abbrev_shndx.
  3176. * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
  3177. abbrev_shndx_.
  3178. (Dwarf_info_reader::set_abbrev_shndx): New method.
  3179. (Dwarf_info_reader::abbrev_shndx_): New data member.
  3180. 2012-10-23 Cary Coutant <ccoutant@google.com>
  3181. * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
  3182. from object, not parameters.
  3183. (Dwarf_info_reader::parse): Likewise.
  3184. * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
  3185. (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
  3186. (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
  3187. methods.
  3188. 2012-10-23 Cary Coutant <ccoutant@google.com>
  3189. * fileread.cc (Input_file::Input_file): New constructor.
  3190. * fileread.h (class Input_file): Add new constructor.
  3191. 2012-10-18 Alan Modra <amodra@gmail.com>
  3192. PR gold/14727
  3193. * object.cc (Relobj::is_section_name_included): Also match
  3194. .sdata personality section.
  3195. 2012-10-18 Alan Modra <amodra@gmail.com>
  3196. * target-reloc.h (class Default_comdat_behavior): New, package up..
  3197. (get_comdat_behaviour): ..this.
  3198. (relocate_section): Add Relocate_comdat_behavior template arg,
  3199. adjust code to suit.
  3200. * arm.cc (Target_arm::relocate_section): Adjust to suit.
  3201. (Target_arm::scan_reloc_section): Likewise.
  3202. * i386.cc (Target_i386::relocate_section): Likewise.
  3203. * sparc.cc (Target_sparc::relocate_section): Likewise.
  3204. * tilegx.cc (Target_tilegx::relocate_section): Likewise.
  3205. * x86_64.cc (Target_x86_64::relocate_section): Likewise.
  3206. * powerpc.cc (class Relocate_comdat_behavior): New.
  3207. (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
  3208. gold::relocate_section with new template arg.
  3209. 2012-10-18 Alan Modra <amodra@gmail.com>
  3210. * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
  3211. dynamic relocs for GOT_TPREL got entries, without symbol if
  3212. resolving locally.
  3213. (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
  3214. (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
  3215. (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
  3216. 2012-10-17 Alan Modra <amodra@gmail.com>
  3217. PR gold/14726
  3218. * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
  3219. 2012-10-16 Sriraman Tallam <tmsriram@google.com>
  3220. * layout.cc (Layout::include_section): Keep sections marked
  3221. SHF_EXCLUDE when doing relocatable links.
  3222. 2012-10-16 Alan Modra <amodra@gmail.com>
  3223. * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
  3224. (Target_powerpc::do_finalize_sections): Call it.
  3225. (Output_data_save_res): New class and supporting functions.
  3226. (Target_powerpc::symval_for_branch): Only look up .opd entry for
  3227. normal symbols defined in object files.
  3228. 2012-10-12 Alan Modra <amodra@gmail.com>
  3229. * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
  3230. (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
  3231. (Target_powerpc::do_gc_mark_symbol): Delay marking function code
  3232. section if scan_opd_relocs not yet called.
  3233. (Target_powerpc::gc_process_relocs): Call process_gc_mark.
  3234. 2012-10-12 Alan Modra <amodra@gmail.com>
  3235. * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
  3236. add_local_ifunc_entry): Revert last change.
  3237. (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
  3238. 2012-10-05 Alan Modra <amodra@gmail.com>
  3239. * powerpc.cc (Target_powerpc::do_plt_address_for_local,
  3240. do_plt_address_for_global): New functions.
  3241. (Output_data_got_powerpc::do_write): Don't segfault when linking
  3242. statically.
  3243. (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
  3244. add_local_ifunc_entry): Return true on adding entry..
  3245. (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
  3246. glink->add_entry call. Remove unused symtab param. Adjust calls.
  3247. (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
  3248. (Target_powerpc::make_iplt_section): Remove symtab param. Don't
  3249. set up symbols here.
  3250. (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
  3251. syms here. Do so even when no .iplt. Don't segfault when linking
  3252. statically.
  3253. (Output_data_glink::add_entry, find_entry): Rearrange params. Add
  3254. new variants without reloc param.
  3255. (Glink_sym_ent::Glink_sym_ent): Likewise.
  3256. (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
  3257. reloc when refs will resolve to plt call stub.
  3258. (Target_powerpc::Scan::local): Correct ifunc handling. Allow
  3259. R_PPC_PLTREL24 to resolve locally.
  3260. (Target_powerpc::Scan::global): Correct ifunc handling.
  3261. (Target_powerpc::Relocate::relocate): Correct local sym glink
  3262. lookup. Don't destroy "value" when we have a plt call stub,
  3263. and when checking plt call validity.
  3264. (Target_powerpc::do_dynsym_value): Simplify.
  3265. 2012-10-05 Alan Modra <amodra@gmail.com>
  3266. * i386.cc (Output_data_plt_i386::address_for_global,
  3267. address_for_local): Add plt offset to returned value. Adjust uses.
  3268. * sparc.cc (Output_data_plt_sparc::address_for_global,
  3269. address_for_local): Likewise.
  3270. * tilegx.cc (Output_data_plt_tilegx::address_for_global,
  3271. address_for_local): Likewise.
  3272. * x86_64.cc (Output_data_plt_x86_64::address_for_global,
  3273. address_for_local): Likewise.
  3274. * target.h (Target::plt_address_for_global, plt_address_for_local):
  3275. Update comment.
  3276. * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
  3277. (Output_data_got::Got_entry::write): Nor here.
  3278. * output.h: Comment fix.
  3279. 2012-10-02 Jiong Wang <jiwang@tilera.com>
  3280. * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
  3281. global_offset_table_ value for larget got.
  3282. (Target_tilegx::Relocate::relocate): Handle adjusted got value.
  3283. 2012-09-29 Alan Modra <amodra@gmail.com>
  3284. * powerpc.cc (Target_powerpc::iplt_): New output section.
  3285. (Target_powerpc::iplt_section, make_iplt_section,
  3286. reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
  3287. (Target_powerpc::make_plt_entry): Handle ifunc syms.
  3288. Target_powerpc::plt_entry_count): Count iplt entries too.
  3289. (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
  3290. reloc section in constructor. New params.
  3291. (Target_powerpc::make_plt_section): Create reloc section here instead.
  3292. (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
  3293. functions.
  3294. (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
  3295. (Output_data_glink::add_entry, find_entry): New functions to
  3296. deal with local syms.
  3297. (Glink_sym_ent): Add support for local syms.
  3298. (Output_data_glink::do_write): Handle ifunc plt entries.
  3299. (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
  3300. (Target_powerpc::Scan::local, global): Handle ifunc syms.
  3301. (Target_powerpc::Relocate::relocate): Likewise.
  3302. (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
  3303. 2012-09-25 Alan Modra <amodra@gmail.com>
  3304. * object.h (Sized_relobj_file::adjust_local_symbol,
  3305. do_adjust_local_symbol): New functions.
  3306. * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
  3307. * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
  3308. (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
  3309. and irregular opd entry spacing.
  3310. (Powerpc_relobj::do_read_relocs): Add opd size checks.
  3311. (Global_symbol_visitor_opd): New functor.
  3312. (Target_powerpc::do_finalize_sections): Omit global symbols defined
  3313. on deleted opd entries.
  3314. 2012-09-15 Jiong Wang <jiwang@tilera.com>
  3315. * tilegx.cc: New file.
  3316. * Makefile.am (TARGETSOURCES): Add tilegx.cc
  3317. (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
  3318. * configure.tgt: Add entries for tilegx*.
  3319. * configure.ac: Likewise.
  3320. * Makefile.in: Rebuild.
  3321. * configure: Likewise.
  3322. * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
  3323. tilegx.
  3324. 2012-09-13 Alan Modra <amodra@gmail.com>
  3325. * target-reloc.h (scan_relocs): Call scan.local for relocs
  3326. against symbols in discarded sections. Pass is_discarded
  3327. param.
  3328. * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
  3329. Add is_discarded param.
  3330. * powerpc (Target_powerpc::Scan::local): Likewise. Use
  3331. is_discarded to flag opd entry as discarded. Don't emit dyn
  3332. relocs on such entries.
  3333. (Target_powerpc::Scan::global): Similarly detect and handle
  3334. such opd entries.
  3335. (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
  3336. opd_ent_. Update all uses.
  3337. (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
  3338. (Target_powerpc::relocate_section): Zero out discarded opd
  3339. entry relocs.
  3340. 2012-09-12 Ian Lance Taylor <iant@google.com>
  3341. PR gold/14570
  3342. * output.cc: Rename Output_data_got template parameter from size
  3343. to got_size for all functions. Compile all variants of
  3344. Output_data_got.
  3345. (Output_data_got::Got_entry::write): Correct use of size for
  3346. symbol value. Use local_is_tls rather than casting to
  3347. Sized_relobj_file.
  3348. * object.h (class Object): Add local_is_tls and do_local_is_tls.
  3349. (class Sized_relobj_file): Add do_local_is_tls.
  3350. * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
  3351. 2012-09-11 Alan Modra <amodra@gmail.com>
  3352. PR gold/14566
  3353. * layout.cc (Layout::set_segment_offsets): When using
  3354. common-page-size alignment, ensure we are on a new max-page-size
  3355. page.
  3356. * output.cc (Output_segment::set_section_addresses): Use
  3357. abi_pagesize, not common_pagesize for relro boundary.
  3358. (Output_segment::set_offset): Likewise.
  3359. 2012-09-11 Alan Modra <amodra@gmail.com>
  3360. * output.h (Output_data_got::add_global_tls, add_local_tls,
  3361. add_local_tls_pair): New functions.
  3362. (Output_data_got::add_local_pair_with_rel): Remove second
  3363. reloc param. Expand comment.
  3364. (Output_data_got::Got_entry): Rename use_plt_offset_ to
  3365. use_plt_or_tls_offset_, similarly for constructor param.
  3366. (Output_data_got::Got_entry::write): Add got_index param.
  3367. * output.cc (Output_data_got::add_global_tls, add_local_tls,
  3368. add_local_tls_pair): New functions.
  3369. (Output_data_got::Got_entry::write): Handle tls symbols
  3370. with use_plt_or_tls_offset_ set specially.
  3371. (Output_data_got::add_local_pair_with_rel): Only one reloc.
  3372. (Output_data_got::do_write): Replace iterator with index, pass
  3373. index to entry write function.
  3374. * target.h (Target::tls_offset_for_local, tls_offset_for_global,
  3375. do_tls_offset_for_local, do_tls_offset_for_global): New functions.
  3376. * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
  3377. call.
  3378. * i386.cc (Target_i386::Scan::local): Likewise.
  3379. * sparc.cc (Target_sparc::Scan::local): Likewise.
  3380. * x86_64.cc (Target_x86_64::Scan::local): Likewise.
  3381. * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
  3382. do_tls_offset_for_global): New functions.
  3383. (Target_powerpc::Scan::local): Correct TLS relocations and got
  3384. entry values.
  3385. (Target_powerpc::Scan::global): Don't emit unnecessary
  3386. dynamic relocations on TLS GOT entries.
  3387. 2012-09-10 Matthias Klose <doko@ubuntu.com>
  3388. * config.in: Disable sanity check for kfreebsd.
  3389. 2012-09-10 Sterling Augustine <saugustine@google.com>
  3390. * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
  3391. (Gdb_index::pubtypes_read): New parameter.
  3392. (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
  3393. to calls.
  3394. * gdb-index.h (Gdb_index): New fields pubnames_object_ and
  3395. pubtypes_object_.
  3396. 2012-09-09 Alan Modra <amodra@gmail.com>
  3397. * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
  3398. (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
  3399. * gc.h (gc_process_relocs): Call target gc_add_reference.
  3400. * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
  3401. * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
  3402. (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
  3403. unnecessary cast.
  3404. * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
  3405. to cater for when we don't need code offset. Update use.
  3406. (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
  3407. (Powerpc_relobj::access_from_map, add_reference, opd_valid,
  3408. set_opd_valid): New functions.
  3409. (Target_powerpc::do_gc_add_reference): New function.
  3410. (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
  3411. stashed refs.
  3412. (Target_powerpc::do_gc_mark_symbol): New function.
  3413. 2012-09-06 Cary Coutant <ccoutant@google.com>
  3414. * dwarf_reader.cc (Dwarf_die::read_attributes): Add
  3415. DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
  3416. (Dwarf_die::skip_attributes): Likewise.
  3417. * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
  3418. * testsuite/gdb_index_test.cc (inline_func_1): New function.
  3419. (main): Call it.
  3420. * testsuite/gdb_index_test_comm.sh: Check index for inline function.
  3421. 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
  3422. * testsuite/script_test_3.t: Add .got.plt output section
  3423. statement.
  3424. * testsuite/script_test_4.t: Likewise.
  3425. 2012-09-05 Alan Modra <amodra@gmail.com>
  3426. * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
  3427. update all uses and lose "enum" when using type.
  3428. 2012-09-05 Alan Modra <amodra@gmail.com>
  3429. * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
  3430. * configure: Regenerate.
  3431. * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
  3432. (plugin_final_layout.stdout): Likewise.
  3433. (memory_test): Set page sizes to 0x1000.
  3434. * testsuite/Makefile.in: Regenerate.
  3435. * testsuite/discard_locals_test.sh: Add FIXME comment.
  3436. * testsuite/justsyms_exec.c: Disable function test for powerpc64.
  3437. * testsuite/pr14265.t: Add .got output section statement.
  3438. * testsuite/script_test_2.t: Likewise.
  3439. * testsuite/script_test_3.t: Likewise.
  3440. * testsuite/script_test_4.t: Likewise.
  3441. * testsuite/script_test_5.t: Likewise.
  3442. * testsuite/script_test_6.t: Likewise.
  3443. * testsuite/script_test_7.t: Likewise.
  3444. * testsuite/script_test_9.t: Likewise.
  3445. 2012-09-05 Alan Modra <amodra@gmail.com>
  3446. * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
  3447. (Powerpc_relocate_functions::Status): New typedef.
  3448. (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
  3449. (Target_powerpc::Scan::local): Handle REL64.
  3450. (Target_powerpc::Scan::global): Likewise, and dynamic relocs
  3451. for REL32 and REL64.
  3452. (Target_powerpc::symval_for_branch): New function, extracted from..
  3453. (Target_powerpc::Relocate::relocate): ..here. Correct plt call
  3454. checks. Report overflow errors.
  3455. 2012-09-05 Alan Modra <amodra@gmail.com>
  3456. * object.h (Sized_relobj_file::emit_relocs): Delete.
  3457. (Sized_relobj_file::emit_relocs_reltype): Delete.
  3458. * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
  3459. relocate_relocs for --emit-relocs.
  3460. (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
  3461. * output.h: Update comment.
  3462. (Output_segment::first_section): New function.
  3463. (Output_segment::first_section_load_address): Use first_section.
  3464. * output.cc (Output_segment::first_section): New function extracted..
  3465. (Output_segment::first_section_load_address): ..from here. Delete.
  3466. * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
  3467. * target.h (Sized_target::relocate_for_relocatable): Likewise.
  3468. * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
  3469. adjust call to target.h function.
  3470. * i386.cc (Target_i386): Likewise.
  3471. * sparc.cc (Target_sparc): Likewise.
  3472. * x86_64.cc (Target_x86_64): Likewise.
  3473. * powerpc.cc (Target_powerpc): Likewise.
  3474. (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
  3475. first tls section has section symbol for optimised local dynamic
  3476. output relocs.
  3477. (Target_powerpc::Relocate::relocate): Correct local dynamic value.
  3478. (Target_powerpc::relocate_relocs): Adjust relocs emitted for
  3479. optimised tls code.
  3480. * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
  3481. Rename to relocate_relocs. Update error message.
  3482. 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
  3483. * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
  3484. --just-symbols.
  3485. 2012-08-31 Alan Modra <amodra@gmail.com>
  3486. * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
  3487. (Powerpc_relobj::toc_base_offset): New stub function.
  3488. (Target_powerpc): Add tp_offset, dtp_offset. Rename
  3489. got_mod_index_offset to tlsld_got_offset. Update all refs.
  3490. (Target_powerpc::Relocate::enum skip_tls): New.
  3491. (Target_powerpc::call_tls_get_addr_): New var.
  3492. (Target_powerpc::is_branch_reloc): Move to file scope.
  3493. (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
  3494. (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
  3495. New functions.
  3496. (Target_powerpc::enum Got_type): Delete old values, add new ones.
  3497. (powerpc_info): Correct common_pagesize for ppc64.
  3498. (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
  3499. (Powerpc_relocate_functions): Add overflow check enums and functions.
  3500. Add non-shift version of rela, rela_ua. Delete all rel public
  3501. functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
  3502. addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
  3503. addr16_ha3, addr14 functions.
  3504. (Output_data_got_powerpc::add_constant_pair): New function.
  3505. (Output_data_got_powerpc::got_base_offset): Likewise.
  3506. (Output_data_got_powerpc::do_write): Correct 64-bit got header.
  3507. (instruction constants): Sort, add some more.
  3508. (Output_data_glink::do_write): Add and use Address typedef. Use
  3509. object->toc_base_offset() stub for 64-bit.
  3510. (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
  3511. (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
  3512. (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
  3513. for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
  3514. Always treat .opd relocs as against locally defined symbol.
  3515. Correct condition for RELATIVE relocs.
  3516. (Target_powerpc::do_finalize_sections): Test for NULL sections.
  3517. (Target_powerpc::Relocate::relocate): Use plt call stub as value
  3518. for 32-bit syms with a plt entry. Correct ppc64 toc base
  3519. calculations. Handle TLS relocs, and more. Add overflow
  3520. checking and adjust for Powerpc_relocate_functions changes.
  3521. (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
  3522. Reinstate --emit-relocs code with FIXME.
  3523. 2012-08-30 Alan Modra <amodra@gmail.com>
  3524. * layout.cc (Layout::set_segment_offsets): Set p_align to
  3525. abi_pagesize, not common_pagesize.
  3526. (Layout::relaxation_loop_body): Similarly use abi_pagesize
  3527. to determine whether file header can go in segment.
  3528. 2012-08-30 Alan Modra <amodra@gmail.com>
  3529. * output.h (Output_reloc::Output_reloc <output section>): Add
  3530. is_relative param. Adjust calls.
  3531. (Output_reloc::add_output_section_relative): New functions.
  3532. * output.cc (Output_reloc::Output_reloc <output section>): Handle
  3533. is_relative.
  3534. (Output_reloc::symbol_value): Handle SECTION_CODE.
  3535. 2012-08-24 Sriraman Tallam <tmsriram@google.com>
  3536. * gold.cc (queue_middle_tasks): Call layout again when unique
  3537. segments for sections is desired.
  3538. * layout.cc (Layout::Layout): Initialize new members.
  3539. (Layout::get_output_section_flags): New function.
  3540. (Layout::choose_output_section): Call get_output_section_flags.
  3541. (Layout::layout): Make output section for mapping to a unique segment.
  3542. (Layout::insert_section_segment_map): New function.
  3543. (Layout::attach_allocated_section_to_segment): Make unique segment for
  3544. output sections marked so.
  3545. (Layout::segment_precedes): Check for unique segments when sorting.
  3546. * layout.h (Layout::Unique_segment_info): New struct.
  3547. (Layout::Section_segment_map): New typedef.
  3548. (Layout::insert_section_segment_map): New function.
  3549. (Layout::get_output_section_flags): New function.
  3550. (Layout::is_unique_segment_for_sections_specified): New function.
  3551. (Layout::set_unique_segment_for_sections_specified): New function.
  3552. (Layout::unique_segment_for_sections_specified_): New member.
  3553. (Layout::section_segment_map_): New member.
  3554. * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
  3555. Rename is_gc_pass_one to is_pass_one.
  3556. Rename is_gc_pass_two to is_pass_two.
  3557. Rename is_gc_or_icf to is_two_pass.
  3558. Check for which pass based on whether symbols data is present.
  3559. Make it two pass when unique segments for sections is desired.
  3560. * output.cc (Output_section::Output_section): Initialize new
  3561. members.
  3562. * output.h (Output_section::is_unique_segment): New function.
  3563. (Output_section::set_is_unique_segment): New function.
  3564. (Output_section::is_unique_segment_): New member.
  3565. (Output_section::extra_segment_flags): New function.
  3566. (Output_section::set_extra_segment_flags): New function.
  3567. (Output_section::extra_segment_flags_): New member.
  3568. (Output_section::segment_alignment): New function.
  3569. (Output_section::set_segment_alignment): New function.
  3570. (Output_section::segment_alignment_): New member.
  3571. (Output_segment::Output_segment): Initialize is_unique_segment_.
  3572. (Output_segment::is_unique_segment): New function.
  3573. (Output_segment::set_is_unique_segment): New function.
  3574. (Output_segment::is_unique_segment_): New member.
  3575. * plugin.cc (allow_unique_segment_for_sections): New function.
  3576. (unique_segment_for_sections): New function.
  3577. (Plugin::load): Add new functions to transfer vector.
  3578. * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
  3579. * Makefile.in: Regenerate.
  3580. * testsuite/plugin_final_layout.sh: Check if unique segment
  3581. functionality works.
  3582. * testsuite/plugin_section_order.c (onload): Check if new interfaces
  3583. are available.
  3584. (allow_unique_segment_for_sections): New global.
  3585. (unique_segment_for_sections): New global.
  3586. (claim_file_hook): Call allow_unique_segment_for_sections.
  3587. (all_symbols_read_hook): Call unique_segment_for_sections.
  3588. 2012-08-22 Cary Coutant <ccoutant@google.com>
  3589. * layout.cc (Layout::include_section): Don't assert on GROUP
  3590. sections with --emit-relocs.
  3591. 2012-08-21 Cary Coutant <ccoutant@google.com>
  3592. * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
  3593. if --export-dynamic-symbol names an undef symbol.
  3594. 2012-08-18 Alan Modra <amodra@gmail.com>
  3595. * powerpc.cc: Formatting and white space.
  3596. (Powerpc_relobj): Rename got2_section_ to special_.
  3597. Add opd_ent_shndx_ and opd_ent_off_ vectors.
  3598. (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
  3599. scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
  3600. (Target_powerpc): Add Address typedef and invalid_address. Use
  3601. throughout.
  3602. (Target_powerpc::is_branch_reloc): New function.
  3603. (Powerpc_relocate_functions): Add Address typedef, use throughout.
  3604. (Powerpc_relocate_functions:rela, rela_ua): Correct type used
  3605. for dst_mask, value and addend.
  3606. (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
  3607. (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
  3608. (Output_data_glink::do_write): Correct toc base. Don't try to use
  3609. uint16_t for 24-bit offset. Use get_output_section_offset and
  3610. check return.
  3611. (Target_powerpc::Scan::local): Handle more relocs.
  3612. (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
  3613. (Target_powerpc::Relocate::relocate): Correct toc base calculation.
  3614. Plug in toc restoring insn after plt calls. Translate branches
  3615. to function descriptor symbols to corresponding entry point.
  3616. (Target_powerpc::relocate_for_relocatable): Check return from
  3617. get_output_section_offset.
  3618. * symtab.h: Comment typo.
  3619. 2012-08-14 Ian Lance Taylor <iant@google.com>
  3620. * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
  3621. unsupported_relocal_local to call unsupported_reloc_global.
  3622. 2012-08-14 Nick Clifton <nickc@redhat.com>
  3623. PR ld/14265
  3624. * script-sections.cc (Sections_element::output_section_name): Add
  3625. keep return parameter.
  3626. (Output_section_element::match_name): Add keep return parameter.
  3627. Return the value of the keep_ member.
  3628. * script-sections.h (class Output_section): Update
  3629. output_section_name prototype.
  3630. * layout.cc (Layout::keep_input_section): New public member
  3631. function.
  3632. (Layout::choose_output_section): Pass keep parameter to
  3633. output_section_name.
  3634. * layout.h (class Layout): Add keep_input_section.
  3635. * object.cc (Sized_relobj_file::do_layout): Check for kept input
  3636. sections.
  3637. * testsuite/Makefile.am: Add a test.
  3638. * testsuite/Makefile.in: Regenerate.
  3639. * testsuite/pr14265.c: Source file for the test.
  3640. * testsuite/pr14265.t: Linker script for the test.
  3641. * testsuite/pr14265.sh: Shell script for the test.
  3642. 2012-08-14 Alan Modra <amodra@gmail.com>
  3643. * target.h (Target::output_section_name): New function.
  3644. (Target::do_output_section_name): New function.
  3645. * layout.cc (Layout::choose_output_section): Call the above.
  3646. * powerpc.cc (Target_powerpc::do_output_section_name): New function.
  3647. 2012-08-14 Alan Modra <amodra@gmail.com>
  3648. * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
  3649. (Output_data_got_powerpc::do_write): Don't rely on base class lookup
  3650. for replace_constant call.
  3651. (Output_data_plt_powerpc::do_print_to_mapfile): New function.
  3652. (Output_data_glink::do_print_to_mapfile): New function.
  3653. (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
  3654. (Target_powerpc::Relocate::relocate): Likewise.
  3655. 2012-08-14 Alan Modra <amodra@gmail.com>
  3656. * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
  3657. (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
  3658. (Output_data_glink::add_entry,find_entry): Remove shndx param.
  3659. (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
  3660. all references to shndx_. Handle special case for R_PPC_PLTREL24
  3661. here.
  3662. (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
  3663. (Output_data_glink::do_write): Retrieve got2_shdnx from object.
  3664. (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
  3665. here.
  3666. (Target_powerpc::Scan::global): Nor on make_plt_entry call.
  3667. (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
  3668. 2012-08-12 Alan Modra <amodra@gmail.com>
  3669. * powerpc.cc: Whitespace fixes. Wrap overly long lines.
  3670. (glink insn constants): Use uint32_t.
  3671. (Output_data_glink::add_entry): Use insert, not [] operator.
  3672. 2012-08-11 Alan Modra <amodra@gmail.com>
  3673. * object.h (Sized_relobj_file::find_shdr): New function.
  3674. (Sized_relobj_file::find_special_sections): New function.
  3675. * object.cc (Sized_relobj_file::find_shdr): New function.
  3676. (Sized_relobj_file::find_eh_frame): Use find_shdr.
  3677. (Sized_relobj_file::find_special_sections): New function, split out..
  3678. (Sized_relobj_file::do_read_symbols): ..from here.
  3679. * output.h (Output_data_got::replace_constant): New function.
  3680. (Output_data_got::num_entries): New function.
  3681. (Output_data_got::last_got_offset,set_got_size): Use num_entries.
  3682. (Output_data_got::got_offset): Protected rather than private.
  3683. (Output_data_got::replace_got_entry): New function.
  3684. * output.cc (Output_data_got::replace_got_entry): New function.
  3685. * powerpc.cc (class Powerpc_relobj): New.
  3686. (class Powerpc_relocate_functions): Delete all psymval variants or
  3687. convert to value,addend type. Delete pcrela, pcrela_unaligned.
  3688. Implement _ha functions using corresponding _hi function.
  3689. (Powerpc_relobj::find_special_sections): New function.
  3690. (Target_powerpc::do_make_elf_object): New function.
  3691. (class Output_data_got_powerpc): New.
  3692. (class Output_data_glink): New.
  3693. (class Powerpc_scan_relocatable_reloc): New.
  3694. Many more changes througout file.
  3695. 2012-08-09 Nick Clifton <nickc@redhat.com>
  3696. * po/vi.po: Updated Vietnamese translation.
  3697. 2012-08-07 Ian Lance Taylor <iant@google.com>
  3698. * layout.cc (Layout::add_target_dynamic_tags): If
  3699. dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
  3700. plt_rel.
  3701. 2012-07-30 Nick Clifton <nickc@redhat.com>
  3702. * po/gold.pot: Updated template.
  3703. * po/es.po: Updated Spanish translation.
  3704. 2012-07-18 Cary Coutant <ccoutant@google.com>
  3705. PR gold/14344
  3706. * configure.ac: Add check for -gpubnames support.
  3707. * configure: Regenerate.
  3708. * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
  3709. support; force -gno-pubnames.
  3710. (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
  3711. support.
  3712. (gdb_index_test_4): New test.
  3713. * testsuite/Makefile.in: Regenerate.
  3714. * testsuite/gdb_index_test_1.sh: Refactor code into common file.
  3715. * testsuite/gdb_index_test_2.sh: Likewise.
  3716. * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
  3717. * testsuite/gdb_index_test_4.sh: New script.
  3718. * testsuite/gdb_index_test_comm.sh: New script with common code;
  3719. don't look for space after colon.
  3720. 2012-07-16 Sriraman Tallam <tmsriram@google.com>
  3721. * gold.cc (queue_middle_tasks): Update function order only after
  3722. deferred objects due to plugins are processed.
  3723. 2012-07-11 Ian Lance Taylor <iant@google.com>
  3724. * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
  3725. (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
  3726. (Target_arm::scan_reloc_for_stub): Likewise.
  3727. * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
  3728. * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
  3729. * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
  3730. * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
  3731. * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
  3732. 2012-07-10 Dodji Seketeli <dodji@redhat.com>
  3733. Ian Lance Taylor <iant@google.com>
  3734. PR gold/14309
  3735. * configure.ac: Test whether std::tr1::hash<off_t> works.
  3736. * gold.h: Add a specialization for std::tr1::hash<off_t> if
  3737. needed.
  3738. * output.h (class Output_fill): Add virtual destructor.
  3739. * configure, config.in: Rebuild.
  3740. 2012-06-22 Roland McGrath <mcgrathr@google.com>
  3741. * layout.cc (finalize): Define __ehdr_start symbol if applicable.
  3742. 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
  3743. * plugin.cc (Plugin::load): Handle position independent executables.
  3744. 2012-06-06 Cary Coutant <ccoutant@google.com>
  3745. * layout.cc (gdb_sections): Remove ".debug_" prefixes,
  3746. add .debug_macro.
  3747. (lines_only_debug_sections): Likewise.
  3748. (gdb_fast_lookup_sections): New static array.
  3749. (is_gdb_debug_section): Rename formal parameter.
  3750. (is_lines_only_debug_section): Likewise.
  3751. (is_gdb_fast_lookup_section): New function.
  3752. (Layout::include_section): Check for ".zdebug_" prefix; pass
  3753. section name suffix to is_gdb_debug_section, et al.; check for
  3754. fast-lookup sections when building .gdb_index.
  3755. * options.h (--strip-debug-gdb): Update GDB version number.
  3756. 2012-06-06 Cary Coutant <ccoutant@google.com>
  3757. * configure.ac: Add check for fallocate.
  3758. * configure: Regenerate.
  3759. * config.in: Regenerate.
  3760. * options.h (class General_options): Add --mmap-output-file and
  3761. --posix-fallocate options.
  3762. * output.cc: (posix_fallocate): Remove; replace with...
  3763. (gold_fallocate): New function.
  3764. (Output_file::map_no_anonymous): Call gold_fallocate.
  3765. (Output_file::map): Check --mmap-output-file option.
  3766. 2012-06-05 Jing Yu <jingyu@google.com>
  3767. * gold.h (textdomain): Add do {} to empty while(0).
  3768. (bindtextdomain): Likewise.
  3769. 2012-06-04 Cary Coutant <ccoutant@google.com>
  3770. * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
  3771. has_dynsym_index.
  3772. 2012-05-25 Sriraman Tallam <tmsriram@google.com>
  3773. * symtab.cc (Symbol_table::define_special_symbol):
  3774. Initialize *poldsym to prevent uninitialized variable errors.
  3775. 2012-05-23 Cary Coutant <ccoutant@google.com>
  3776. * layout.cc (Layout::section_name_mapping): Add rules to handle
  3777. exact match on .data.rel.ro.local or .data.rel.ro.
  3778. (Layout::output_section_name): Check for exact matches.
  3779. 2012-05-23 Cary Coutant <ccoutant@google.com>
  3780. * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
  3781. more carefully.
  3782. 2012-05-22 Cary Coutant <ccoutant@google.com>
  3783. * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
  3784. object before exporting symbol.
  3785. 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
  3786. * testsuite/tls_test.cc: Include "config.h" first.
  3787. * testsuite/tls_test_c.c: Likewise.
  3788. 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
  3789. Nick Clifton <nickc@redhat.com>
  3790. PR 14072
  3791. * configure.in: Add check that sysdep.h has been included before
  3792. any system header files.
  3793. * configure: Regenerate.
  3794. * config.in: Regenerate.
  3795. 2012-05-14 Cary Coutant <ccoutant@google.com>
  3796. * layout.cc (Layout::make_output_section): Mark .tdata section
  3797. as RELRO.
  3798. * testsuite/relro_test.cc: Add a TLS variable.
  3799. 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
  3800. PR gold/14091
  3801. * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
  3802. R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
  3803. R_X86_64_64.
  3804. 2012-05-08 Cary Coutant <ccoutant@google.com>
  3805. * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
  3806. (lines_only_debug_sections): Likewise.
  3807. 2012-05-02 Roland McGrath <mcgrathr@google.com>
  3808. * nacl.cc: New file.
  3809. * nacl.h: New file.
  3810. * Makefile.am (CCFILES, HFILES): Add them.
  3811. * Makefile.in: Regenerate.
  3812. * i386.cc (Output_data_plt_i386_nacl): New class.
  3813. (Output_data_plt_i386_nacl_exec): New class.
  3814. (Output_data_plt_i386_nacl_dyn): New class.
  3815. (Target_i386_nacl): New class.
  3816. (Target_selector_i386_nacl): New class.
  3817. (target_selector_i386): Use it instead of Target_selector_i386.
  3818. * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
  3819. (Target_x86_64_nacl): New class.
  3820. (Target_selector_x86_64_nacl): New class.
  3821. (target_selector_x86_64, target_selector_x32): Use it instead of
  3822. Target_selector_x86_64.
  3823. * arm.cc (Output_data_plt_arm_nacl): New class.
  3824. (Target_arm_nacl): New class.
  3825. (Target_selector_arm_nacl): New class.
  3826. (target_selector_arm, target_selector_armbe): Use it instead of
  3827. Target_selector_arm.
  3828. * target-select.cc (select_target): Take new Input_file* and off_t
  3829. arguments, pass them on to recognize method of selector.
  3830. * object.cc (make_elf_sized_object): Update caller.
  3831. * parameters.cc (parameters_force_valid_target): Likewise.
  3832. * incremental.cc (make_sized_incremental_binary): Likewise.
  3833. * target-select.h: Update decl.
  3834. (Target_selector::recognize): Take new Input_file* argument,
  3835. pass it on to do_recognize.
  3836. (Target_selector::do_recognize): Take new Input_file* argument.
  3837. * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
  3838. * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
  3839. * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
  3840. * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
  3841. * target.h (Target::Target_info): New members isolate_execinstr
  3842. and rosegment_gap.
  3843. (Target::isolate_execinstr, Target::rosegment_gap): New methods.
  3844. * arm.cc (Target_arm::arm_info): Update initializer.
  3845. * i386.cc (Target_i386::i386_info): Likewise.
  3846. * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
  3847. * sparc.cc (Target_sparc::sparc_info): Likewise.
  3848. * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
  3849. * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
  3850. * layout.cc (Layout::attach_allocated_section_to_segment):
  3851. Take new const Target* argument. If target->isolate_execinstr(), act
  3852. like --rosegment.
  3853. (Layout::find_first_load_seg): Take new const Target* argument;
  3854. if target->isolate_execinstr(), reject PF_X segments.
  3855. (Layout::relaxation_loop_body): Update caller.
  3856. (Layout::set_segment_offsets): If target->isolate_execinstr(),
  3857. reset file offset to zero when we hit LOAD_SEG, and then do a second
  3858. loop over the segments before LOAD_SEG to reassign offsets after
  3859. addresses have been determined. Handle target->rosegment_gap().
  3860. (Layout::attach_section_to_segment): Take new const Target* argument;
  3861. pass it to attach_allocated_section_to_segment.
  3862. (Layout::make_output_section): Update caller.
  3863. (Layout::attach_sections_to_segments): Take new const Target* argument;
  3864. pass it to attach_section_to_segment.
  3865. * gold.cc (queue_middle_tasks): Update caller.
  3866. * layout.h (Layout): Update method decls with new arguments.
  3867. * arm.cc (Target_arm::Target_arm): Take optional argument for the
  3868. Target_info pointer to use.
  3869. (Target_arm::do_make_data_plt): New virtual method.
  3870. (Target_arm::make_data_plt): New method that calls it.
  3871. (Target_arm::make_plt_entry): Use it.
  3872. (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
  3873. for the section alignment.
  3874. (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
  3875. method.
  3876. (Output_data_plt_arm::first_plt_entry_offset): Call it.
  3877. (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
  3878. method.
  3879. (Output_data_plt_arm::get_plt_entry_size): Call it.
  3880. (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
  3881. (Output_data_plt_arm::fill_plt_entry): New method that calls it.
  3882. (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
  3883. method.
  3884. (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
  3885. (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
  3886. method instead of sizeof(plt_entry).
  3887. (Output_data_plt_arm::add_entry): Likewise.
  3888. Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
  3889. (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
  3890. than static method.
  3891. (Target_arm::plt_entry_size): Likewise.
  3892. (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
  3893. Move to ...
  3894. (Output_data_plt_arm_standard): ... here, new class.
  3895. (Output_data_plt_arm::do_write): Move guts of PLT filling to...
  3896. (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
  3897. (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
  3898. * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
  3899. Take additional argument for the PLT entry size.
  3900. (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
  3901. Use get_plt_entry_size method rather than plt_entry_size variable.
  3902. (Output_data_plt_x86_64::reserve_slot): Likewise.
  3903. (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
  3904. (Output_data_plt_x86_64::add_entry): Likewise.
  3905. (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
  3906. (Output_data_plt_x86_64::address_for_global): Likewise.
  3907. (Output_data_plt_x86_64::address_for_local): Likewise.
  3908. (Output_data_plt_x86_64::set_final_data_size): Likewise.
  3909. (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
  3910. Make method non-static.
  3911. (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
  3912. method.
  3913. (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
  3914. (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
  3915. (Output_data_plt_x86_64::add_eh_frame): New method to call it.
  3916. (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
  3917. virtual method.
  3918. (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
  3919. (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
  3920. virtual method.
  3921. (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
  3922. (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
  3923. virtual method.
  3924. (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
  3925. (Output_data_plt_x86_64::plt_entry_size)
  3926. (Output_data_plt_x86_64::first_plt_entry)
  3927. (Output_data_plt_x86_64::plt_entry)
  3928. (Output_data_plt_x86_64::tlsdesc_plt_entry)
  3929. (Output_data_plt_x86_64::plt_eh_frame_fde_size)
  3930. (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
  3931. (Output_data_plt_x86_64_standard): ... here, new class.
  3932. (Target_x86_64::Target_x86_64): Take optional argument for the
  3933. Target_info pointer to use.
  3934. (Target_x86_64::do_make_data_plt): New virtual method.
  3935. (Target_x86_64::make_data_plt): New method to call it.
  3936. (Target_x86_64::init_got_plt_for_update): Use that.
  3937. Call this->plt_->add_eh_frame method here.
  3938. (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
  3939. (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
  3940. rather than static method.
  3941. (Target_x86_64::plt_entry_size): Likewise.
  3942. (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
  3943. rather than plt_entry_size variable. Move guts of PLT filling to...
  3944. (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
  3945. (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
  3946. (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
  3947. * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
  3948. additional argument for the section alignment.
  3949. Don't do add_eh_frame_for_plt here.
  3950. (Output_data_plt_i386::first_plt_entry_offset): Make the method
  3951. non-static. Use get_plt_entry_size method rather than plt_entry_size
  3952. variable.
  3953. (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
  3954. method.
  3955. (Output_data_plt_i386::get_plt_entry_size): Call it.
  3956. (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
  3957. (Output_data_plt_i386::add_eh_frame): New method to call it.
  3958. (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
  3959. method.
  3960. (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
  3961. (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
  3962. method.
  3963. (Output_data_plt_i386::fill_plt_entry): New method to call it.
  3964. (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
  3965. method instead of plt_entry_size.
  3966. (Output_data_plt_i386::plt_entry_size)
  3967. (Output_data_plt_i386::plt_eh_frame_fde_size)
  3968. (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
  3969. (Output_data_plt_i386_standard): ... here, new class.
  3970. (Output_data_plt_i386_exec): New class.
  3971. (Output_data_plt_i386::exec_first_plt_entry): Move to ...
  3972. (Output_data_plt_i386_exec::first_plt_entry): ... here.
  3973. (Output_data_plt_i386::exec_plt_entry): Move to ...
  3974. (Output_data_plt_i386_exec::plt_entry): ... here.
  3975. (Output_data_plt_i386_dyn): New class.
  3976. (Output_data_plt_i386::first_plt_entry): Move to ...
  3977. (Output_data_plt_i386_dyn::first_plt_entry): ... here.
  3978. (Output_data_plt_i386::dyn_plt_entry): Move to ...
  3979. (Output_data_plt_i386_dyn::plt_entry): ... here.
  3980. (Target_i386::Target_i386): Take optional argument for the Target_info
  3981. pointer to use.
  3982. (Target_i386::do_make_data_plt): New virtual method.
  3983. (Target_i386::make_data_plt): New method to call it.
  3984. (Target_i386::make_plt_section): Use that.
  3985. Call this->plt_->add_eh_frame method here.
  3986. (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
  3987. rather than plt_entry_size variable.
  3988. (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
  3989. (Output_data_plt_i386::address_for_local): Likewise.
  3990. (Output_data_plt_i386::do_write): Likewise.
  3991. Move guts of PLT filling to...
  3992. (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
  3993. (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
  3994. (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
  3995. (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
  3996. 2012-05-01 Cary Coutant <ccoutant@google.com>
  3997. * dwarf_reader.cc (Dwarf_die::read_attributes)
  3998. (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
  3999. (Dwarf_die::uint_attribute): Remove DW_FORM_null.
  4000. * reduced_debug_output.cc
  4001. (Output_reduced_debug_info_section::get_die_end): Remove
  4002. DW_FORM_GNU_ref_index. Add default case.
  4003. 2012-04-26 Mark Wielaard <mjw@redhat.com>
  4004. * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
  4005. * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
  4006. * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
  4007. DW_AT_high_pc as offset from DW_AT_low_pc.
  4008. * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
  4009. * testsuite/Makefile.in: Regenerate.
  4010. * testsuite/gdb_index_test_3.c: New test source file.
  4011. * testsuite/gdb_index_test_3.sh: New test source file.
  4012. 2012-04-25 Ian Lance Taylor <iant@google.com>
  4013. * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
  4014. pointer.
  4015. (Stub_addend_reader::operator()): Declare Arm_relocate_functions
  4016. as a class, not a struct.
  4017. (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
  4018. (Target_arm::apply_cortex_a8_workaround): Likewise.
  4019. * gc.h: Declare Reloc_types as a struct, not a class.
  4020. * object.h: Declare Symbols_data as a struct.
  4021. * reloc.h: Declare Read_relocs_data as a struct.
  4022. * target.h: Declare Relocate_info as a struct.
  4023. 2012-04-24 David S. Miller <davem@davemloft.net>
  4024. * sparc.cc (Target_sparc::Relocate::relax_call): New function.
  4025. (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
  4026. and R_SPARC_WPLT30.
  4027. 2012-04-24 Cary Coutant <ccoutant@google.com>
  4028. * incremental-dump.cc (find_input_containing_global): Replace
  4029. magic number with symbolic constant.
  4030. (dump_incremental_inputs): Update version number.
  4031. * incremental.cc (Output_section_incremental_inputs): Update version
  4032. number; import symbolic constants from Incremental_inputs_reader.
  4033. (Incremental_inputs::create_data_sections): Align relocations
  4034. section correctly for 64-bit targets.
  4035. (Output_section_incremental_inputs::set_final_data_size): Use symbolic
  4036. constants; add padding.
  4037. (Output_section_incremental_inputs::write_header): Add assert for
  4038. header_size.
  4039. (Output_section_incremental_inputs::write_input_files): Add assert
  4040. for input_entry_size.
  4041. (Output_section_incremental_inputs::write_info_blocks): Add padding;
  4042. add assert for object_info_size, input_section_entry_size,
  4043. global_sym_entry_size.
  4044. * incremental.h (Incremental_inputs_reader): Add symbolic constants
  4045. for data structure sizes; use them.
  4046. (Incremental_input_entry_reader): Import symbolic constants from
  4047. Incremental_inputs_reader; use them.
  4048. 2012-04-23 David S. Miller <davem@davemloft.net>
  4049. * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
  4050. and elf_flags_set_.
  4051. (Target_sparc::Target_sparc): Initialize new fields.
  4052. (Target_sparc::do_make_elf_object): New function.
  4053. (Target_sparc::do_adjust_elf_header): New function.
  4054. 2012-04-23 Cary Coutant <ccoutant@google.com>
  4055. * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
  4056. CU range table of gdb index.
  4057. 2012-04-20 David S. Miller <davem@davemloft.net>
  4058. * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
  4059. instead of false.
  4060. 2012-04-16 David S. Miller <davem@davemloft.net>
  4061. * sparc.cc (Target_sparc::got_address): New function.
  4062. (Sparc_relocate_functions::gdop_hix22): New function.
  4063. (Sparc_relocate_functions::gdop_lox10): New function.
  4064. (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
  4065. relocs.
  4066. (Target_sparc::Scan::local): Likewise if the global symbol is not
  4067. preemptible and is not IFUNC.
  4068. (Target_sparc::Relocate::relocate): Perform GOTDATA code
  4069. transformations for local and non-preemptible non-IFUNC global
  4070. symbols.
  4071. * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
  4072. writing out 64-bit part of ranges.
  4073. * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
  4074. -fpic and -fpie respectively.
  4075. * Makefile.in: Regenerate.
  4076. * sparc.cc (class Target_sparc): Add rela_ifunc_.
  4077. (Target_sparc::Target_sparc): Initialize new field.
  4078. (Target_sparc::do_plt_section_for_global): New function.
  4079. (Target_sparc::do_plt_section_for_local): New function.
  4080. (Target_sparc::reloc_needs_plt_for_ifunc): New function.
  4081. (Target_sparc::make_plt_section): New function, broken out of
  4082. make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
  4083. (Target_sparc::make_plt_entry): Call make_plt_section.
  4084. (Target_sparc::make_local_ifunc_plt_entry): New function.
  4085. (Target_sparc::rela_ifunc_section): New function.
  4086. (Target_sparc::plt_section): Remove const.
  4087. (Output_data_plt_sparc): Update declarations. Define Global_ifunc
  4088. and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
  4089. and ifunc_count_ fields.
  4090. (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
  4091. (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
  4092. (Output_data_plt_sparc::add_local_ifunc_entry): New function.
  4093. (Output_data_plt_sparc::rela_ifunc): New function.
  4094. (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
  4095. (Output_data_plt_sparc::has_ifunc_section): New function.
  4096. (Output_data_plt_sparc::entry_count): Include ifunc_count_.
  4097. (Output_data_plt_sparc::address_for_global): New function.
  4098. (Output_data_plt_sparc::address_for_local): New function.
  4099. (Output_data_plt_sparc::plt_index_to_offset): New function.
  4100. (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
  4101. and entry_count.
  4102. (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
  4103. entry_count.
  4104. (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
  4105. R_SPARC_JMP_IREL to switch.
  4106. (Target_sparc::Scan::check_non_pic): Likewise.
  4107. (Target_sparc::Scan::local): Handle IFUNC symbols.
  4108. (Target_sparc::Scan::local): Likewise.
  4109. (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
  4110. and plt_address_for_local.
  4111. (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
  4112. Define __rel_iplt_start and __rel_iplt_end if doing a static link.
  4113. * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
  4114. (class Output_data_reloc): Adjust calls to Output_reloc_type.
  4115. (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
  4116. * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
  4117. global relocs too.
  4118. (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
  4119. * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
  4120. calls.
  4121. * sparc.cc (Target_sparc::Scan::global): Likewise.
  4122. * x86_64.cc (Target_x86_64::Scan::global): Likewise.
  4123. 2012-04-16 Cary Coutant <ccoutant@google.com>
  4124. * archive.cc (Library_base::should_include_member): Check for
  4125. --export-dynamic-symbol.
  4126. * options.h (class General_options): Add --export-dynamic-symbol.
  4127. * symtab.cc (Symbol::should_add_dynsym_entry): Check for
  4128. --export-dynamic-symbol.
  4129. (Symbol_table::gc_mark_undef_symbols): Likewise.
  4130. (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
  4131. 2012-04-12 David S. Miller <davem@davemloft.net>
  4132. * sparc.cc (Reloc::wdisp10): New relocation method.
  4133. (Reloc::h34): Likewise.
  4134. (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
  4135. (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
  4136. R_SPARC_WDISP10.
  4137. (Target_sparc::Scan::local): Likewise.
  4138. (Target_sparc::Scan::global): Likewise.
  4139. (Target_sparc::Relocate::relocate): Likewise.
  4140. 2012-04-09 Cary Coutant <ccoutant@google.com>
  4141. * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
  4142. low_pc == 0.
  4143. 2012-04-06 Ian Lance Taylor <iant@google.com>
  4144. * timer.cc: #include <unistd.h>.
  4145. 2012-04-06 Roland McGrath <mcgrathr@google.com>
  4146. * configure.in (AC_CHECK_HEADERS): Add locale.h.
  4147. * config.in: Regenerate.
  4148. * configure: Regenerate.
  4149. 2012-04-05 Nick Clifton <nickc@redhat.com>
  4150. * configure.ac (AC_CHECK_FUNCS): Add setlocale.
  4151. (AM_LC_MESSAGES): Add.
  4152. * aclocal.m4: Regenerate.
  4153. * config.in: Regenerate.
  4154. * configure: Regenerate.
  4155. 2012-03-21 Cary Coutant <ccoutant@google.com>
  4156. * Makefile.am: Add gdb-index.cc, gdb-index.h.
  4157. * Makefile.in: Regenerate.
  4158. * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
  4159. (Sized_elf_reloc_mapper::symbol_section): New function.
  4160. (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
  4161. (make_elf_reloc_mapper): New function.
  4162. (Dwarf_abbrev_table::clear_abbrev_codes): New function.
  4163. (Dwarf_abbrev_table::do_read_abbrevs): New function.
  4164. (Dwarf_abbrev_table::do_get_abbrev): New function.
  4165. (Dwarf_ranges_table::read_ranges_table): New function.
  4166. (Dwarf_ranges_table::read_range_list): New function.
  4167. (Dwarf_pubnames_table::read_section): New function.
  4168. (Dwarf_pubnames_table::read_header): New function.
  4169. (Dwarf_pubnames_table::next_name): New function.
  4170. (Dwarf_die::Dwarf_die): New function.
  4171. (Dwarf_die::read_attributes): New function.
  4172. (Dwarf_die::skip_attributes): New function.
  4173. (Dwarf_die::set_name): New function.
  4174. (Dwarf_die::set_linkage_name): New function.
  4175. (Dwarf_die::attribute): New function.
  4176. (Dwarf_die::string_attribute): New function.
  4177. (Dwarf_die::int_attribute): New function.
  4178. (Dwarf_die::uint_attribute): New function.
  4179. (Dwarf_die::ref_attribute): New function.
  4180. (Dwarf_die::child_offset): New function.
  4181. (Dwarf_die::sibling_offset): New function.
  4182. (Dwarf_info_reader::check_buffer): New function.
  4183. (Dwarf_info_reader::parse): New function.
  4184. (Dwarf_info_reader::do_parse): New function.
  4185. (Dwarf_info_reader::do_read_string_table): New function.
  4186. (Dwarf_info_reader::lookup_reloc): New function.
  4187. (Dwarf_info_reader::get_string): New function.
  4188. (Dwarf_info_reader::visit_compilation_unit): New function.
  4189. (Dwarf_info_reader::visit_type_unit): New function.
  4190. (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
  4191. Sized_elf_reloc_mapper.
  4192. (Sized_dwarf_line_info::symbol_section): Remove function.
  4193. (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
  4194. (Sized_dwarf_line_info::read_line_mappings): Remove object
  4195. parameter, adjust callers.
  4196. (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
  4197. * dwarf_reader.h: Include <sys/types.h>.
  4198. (class Track_relocs): Remove forward declaration.
  4199. (class Elf_reloc_mapper): New class.
  4200. (class Sized_elf_reloc_mapper): New class.
  4201. (class Dwarf_abbrev_table): New class.
  4202. (class Dwarf_range_list): New class.
  4203. (class Dwarf_ranges_table): New class.
  4204. (class Dwarf_pubnames_table): New class.
  4205. (class Dwarf_die): New class.
  4206. (class Dwarf_info_reader): New class.
  4207. (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
  4208. (Sized_dwarf_line_info::symbol_section): Remove member function.
  4209. * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
  4210. base class.
  4211. * gdb-index.cc: New source file.
  4212. * gdb-index.h: New source file.
  4213. * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
  4214. and .debug_types sections, call Layout::add_to_gdb_index.
  4215. (Sized_relobj_incr::do_section_name): Implement.
  4216. (Sized_relobj_incr::do_section_contents): Adjust parameter list and
  4217. return type; Implement.
  4218. (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
  4219. return type.
  4220. * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
  4221. parameter list and return type.
  4222. (Sized_incr_dynobj::do_section_contents): Likewise.
  4223. * layout.cc: Include gdb-index.h.
  4224. (Layout::Layout): Initialize gdb_index_data_.
  4225. (Layout::init_fixed_output_section): Check for .gdb_index section.
  4226. (Layout::add_to_gdb_index): New function. Instantiate.
  4227. * layout.h: Add forward declaration for class Gdb_index.
  4228. (Layout::add_to_gdb_index): New member function.
  4229. (Layout::gdb_index_data_): New data member.
  4230. * main.cc: Include gdb-index.h.
  4231. (main): Print statistics for gdb index.
  4232. * object.cc (Object::section_contents): Move code into
  4233. do_section_contents.
  4234. (need_decompressed_section): Check for sections needed when building
  4235. gdb index.
  4236. (build_compressed_section_map): Likewise.
  4237. (Sized_relobj_file::do_read_symbols): Need local symbols when building
  4238. gdb index.
  4239. (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
  4240. sections; call Layout::add_to_gdb_index.
  4241. (Sized_relobj_file::do_decompressed_section_contents): Call
  4242. do_section_contents directly.
  4243. * object.h (Object::do_section_contents): Adjust parameter list and
  4244. return type.
  4245. (Object::do_decompressed_section_contents): Call do_section_contents
  4246. directly.
  4247. (Sized_relobj_file::do_section_contents): Adjust parameter list and
  4248. return type.
  4249. * options.h (class General_options): Add --gdb-index option.
  4250. * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
  4251. list and return type.
  4252. * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
  4253. * reloc.h (Track_relocs::checkpoint): New function.
  4254. (Track_relocs::reset): New function.
  4255. * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
  4256. New test cases.
  4257. * testsuite/Makefile.in: Regenerate.
  4258. * testsuite/gdb_index_test.cc: New test source file.
  4259. * testsuite/gdb_index_test_1.sh: New test source file.
  4260. * testsuite/gdb_index_test_2.sh: New test source file.
  4261. 2012-03-19 Doug Kwan <dougkwan@google.com>
  4262. * arm.cc (Target_arm::do_define_standard_symbols): New method.
  4263. (Target_arm::do_finalize_sections): Remove code which defines
  4264. __exidx_start and __exidx_end. Make symbol table parameter
  4265. anonymous as it is not used.
  4266. * gold.cc (queue_middle_tasks): Call target hook to define any
  4267. target-specific symbols.
  4268. * target.h (Target::define_standard_symbols): New method.
  4269. (Target::do_define_standard_symbols): Same.
  4270. * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
  4271. * testsuite/Makefile.in: Regenerate.
  4272. * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
  4273. and __exidx_end.
  4274. * testsuite/arm_exidx_test.sh: Check that no unused dynamic
  4275. relocations are generated for __exidx_start and __exidx_end.
  4276. 2012-03-16 Doug Kwan <dougkwan@google.com>
  4277. * testsuite/Makefile.am: Disable test initpri3b.
  4278. * testsuite/Makefile.in: Regenerate.
  4279. 2012-03-15 Doug Kwan <dougkwan@google.com>
  4280. * arm.cc (Target_arm::got_section): Make .got section read-only
  4281. if -z now is given.
  4282. 2012-03-15 Ian Lance Taylor <iant@google.com>
  4283. PR gold/13850
  4284. * layout.cc (Layout::make_output_section): Correctly mark
  4285. SHT_INIT_ARRAY, et. al., as relro.
  4286. 2012-03-14 Doug Kwan <dougkwan@google.com>
  4287. * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
  4288. dynamic relocations for protected symbols in shared objects.
  4289. 2012-03-13 Ian Lance Taylor <iant@google.com>
  4290. * resolve.cc (Symbol_table::resolve): When merging common symbols,
  4291. keep the larger alignment.
  4292. 2012-03-12 Cary Coutant <ccoutant@google.com>
  4293. * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
  4294. handling of DW_LNE_define_file.
  4295. 2012-03-12 Cary Coutant <ccoutant@google.com>
  4296. * reduced_debug_output.cc
  4297. (Output_reduced_debug_info_section::get_die_end): Add new FORM
  4298. codes to switch.
  4299. 2012-02-29 Cary Coutant <ccoutant@google.com>
  4300. * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
  4301. 2012-02-29 Cary Coutant <ccoutant@google.com>
  4302. * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
  4303. Call Object::decompressed_section_contents.
  4304. * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
  4305. New dtor.
  4306. (Sized_dwarf_line_info::buffer_start_): New data member.
  4307. * merge.cc (Output_merge_data::do_add_input_section): Call
  4308. Object::decompressed_section_contents.
  4309. (Output_merge_string::do_add_input_section): Likewise.
  4310. * object.cc (need_decompressed_section): New function.
  4311. (build_compressed_section_map): Decompress sections needed later.
  4312. (Sized_relobj_file::do_decompressed_section_contents): New function.
  4313. (Sized_relobj_file::do_discard_decompressed_sections): New function.
  4314. * object.h (Object::decompressed_section_contents): New function.
  4315. (Object::discard_decompressed_sections): New function.
  4316. (Object::do_decompressed_section_contents): New function.
  4317. (Object::do_discard_decompressed_sections): New function.
  4318. (Compressed_section_info): New type.
  4319. (Compressed_section_map): Include decompressed section contents.
  4320. (Sized_relobj_file::do_decompressed_section_contents): New function.
  4321. (Sized_relobj_file::do_discard_decompressed_sections): New function.
  4322. 2012-02-16 Cary Coutant <ccoutant@google.com>
  4323. * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
  4324. * testsuite/Makefile.in: Regenerate.
  4325. 2012-02-14 Cary Coutant <ccoutant@google.com>
  4326. * options.cc (General_options::finalize): Disallow -pie and -static.
  4327. 2012-02-03 Doug Kwan <dougkwan@google.com>
  4328. * arm.cc (Arm_relocate_functions::abs8,
  4329. Arm_relocate_functions::abs16): Use
  4330. Bits::has_signed_unsigned_overflow32.
  4331. (Arm_relocate_functions::thm_abs8): Correct range of
  4332. overflow check.
  4333. * reloc.h (Bits class): Change minimum number of bits from 0 to 1
  4334. in assertions.
  4335. 2012-02-02 Doug Kwan <dougkwan@google.com>
  4336. * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
  4337. position independent outputs, not just shared objects.
  4338. 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
  4339. * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
  4340. * configure: Regenerated.
  4341. 2012-01-27 Ian Lance Taylor <iant@google.com>
  4342. * reloc.h (Bits): New class with static functions, copied from
  4343. namespace utils in arm.cc.
  4344. * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
  4345. instead.
  4346. 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
  4347. * incremental.cc (write_info_blocks): Correct relocation offset.
  4348. 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
  4349. * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
  4350. (Relocate::tls_gd_to_le): Likewise.
  4351. 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
  4352. * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
  4353. 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
  4354. * configure.ac: Check if -mcmodel=medium works.
  4355. * configure: Regenerated.
  4356. 2012-01-24 Cary Coutant <ccoutant@google.com>
  4357. * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
  4358. definition and ...
  4359. (read_unsigned_LEB_128_x): ... this new function.
  4360. (read_signed_LEB_128): Replaced with inline definition and ...
  4361. (read_signed_LEB_128_x): ... this new function.
  4362. * int_encoding.h (read_unsigned_LEB_128_x): New function.
  4363. (read_unsigned_LEB_128): Add inline definition.
  4364. (read_signed_LEB_128_x): New function.
  4365. (read_signed_LEB_128): Add inline definition.
  4366. * testsuite/Makefile.am (leb128_unittest): New unit test.
  4367. * testsuite/Makefile.in: Regenerate.
  4368. * testsuite/leb128_unittest.cc: New unit test.
  4369. 2012-01-23 Ian Lance Taylor <iant@google.com>
  4370. PR gold/13617
  4371. * i386.cc (Target_i386::do_code_fill): When using a jmp
  4372. instruction, pad with nop instructions.
  4373. * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
  4374. 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
  4375. * x86_64.cc (gc_process_relocs): Add typename on types used in
  4376. template.
  4377. (scan_relocs): Likewise.
  4378. (relocate_section): Likewise.
  4379. (apply_relocation): Likewise.
  4380. 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
  4381. * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
  4382. (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
  4383. under x32.
  4384. 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
  4385. * x86_64.cc: Initial support for x32.
  4386. 2012-01-03 Cary Coutant <ccoutant@google.com>
  4387. * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
  4388. Use abstract base class for GOT.
  4389. * gold/output.h (class Output_data_got_base): New abstract base class.
  4390. (class Output_data_got): Derive from new base class, adjust ctors.
  4391. (Output_data_got::reserve_slot): Make virtual; rename to
  4392. do_reserve_slot; Adjust callers.
  4393. * gold/target.h (Sized_target::init_got_plt_for_update): Return
  4394. pointer to abstract base class.
  4395. * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
  4396. 2011-12-18 Ian Lance Taylor <iant@google.com>
  4397. * object.h (Relobj::local_symbol_value): New function.
  4398. (Relobj::local_plt_offset): New function.
  4399. (Relobj::local_has_got_offset): New function.
  4400. (Relobj::local_got_offset): New function.
  4401. (Relobj::set_local_got_offset): New function.
  4402. (Relobj::do_local_symbol_value): New pure virtual function.
  4403. (Relobj::do_local_plt_offset): Likewise.
  4404. (Relobj::do_local_has_got_offset): Likewise.
  4405. (Relobj::do_local_got_offset): Likewise.
  4406. (Relobj::do_set_local_got_offset): Likewise.
  4407. (Sized_relobj::do_local_has_got_offset): Rename from
  4408. local_has_got_offset.
  4409. (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
  4410. (Sized_relobj::do_set_local_got_offset): Rename from
  4411. set_local_got_offset.
  4412. (Sized_relobj_file::do_local_plt_offset): Rename from
  4413. local_plt_offset.
  4414. (Sized_relobj_file::do_local_symbol_value): New function.
  4415. * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
  4416. local_plt_offset.
  4417. * output.cc (Output_data_got::Got_entry::write): Change object to
  4418. Relobj. Use local_symbol_value.
  4419. (Output_data_got::add_global_with_rel): Change rel_dyn to
  4420. Output_data_reloc_generic*. Use add_global_generic.
  4421. (Output_data_got::add_global_with_rela): Remove. Change all
  4422. callers to use add_global_with_rel.
  4423. (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
  4424. Output_data_reloc_generic*. Use add_global_generic.
  4425. (Output_data_got::add_global_pair_with_rela): Remove. Change all
  4426. callers to use add_global_pair_with_rel.
  4427. (Output_data_got::add_local): Change object to Relobj*.
  4428. (Output_data_got::add_local_plt): Likewise.
  4429. (Output_data_got::add_local_with_rel): Change object to Relobj*,
  4430. change rel_dyn to Output_data_reloc_generic*. Use
  4431. add_local_generic.
  4432. (Output_data_got::add_local_with_rela): Remove. Change all
  4433. callers to use all_local_with_rel.
  4434. (Output_data_got::add_local_pair_with_rel): Change object to
  4435. Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
  4436. add_output_section_generic.
  4437. (Output_data_got::add_local_pair_with_rela): Remove. Change all
  4438. callers to use add_local_pair_with_rel.
  4439. (Output_data_got::reserve_local): Change object to Relobj*.
  4440. * output.h: (class Output_data_reloc_generic): Add pure virtual
  4441. declarations for add_global_generic, add_local_generic,
  4442. add_output_section_generic.
  4443. (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
  4444. functions for Output_data_reloc_generic. Update declarations for
  4445. changes listed in output.cc.
  4446. (class Output_data_got): Change template parameter to got_size.
  4447. Don't define Rel_dyn or Rela_dyn. Update declarations per above.
  4448. * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
  4449. function.
  4450. (Sized_relobj_incr::do_local_plt_offset): New function.
  4451. * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
  4452. add_global_generic.
  4453. 2011-12-17 Cary Coutant <ccoutant@google.com>
  4454. * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
  4455. * resolve.cc (Symbol_table::resolve): Likewise.
  4456. * i386.cc (Target_i386::do_code_fill): Use char constants for nop
  4457. arrays.
  4458. * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
  4459. 2011-12-16 Ian Lance Taylor <iant@google.com>
  4460. * output.h (Output_data_reloc_generic::add): Only call
  4461. add_dynamic_reloc if this is a dynamic reloc section.
  4462. 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
  4463. PR gold/13505
  4464. * target-reloc.h (apply_relocation): Replace <64, false> with
  4465. <size, big_endian>.
  4466. 2011-11-25 Nick Clifton <nickc@redhat.com>
  4467. * po/it.po: New Italian translation.
  4468. 2011-11-17 Sterling Augustine <saugustine@google.com>
  4469. * script.cc (script_include_directive): Implement.
  4470. (read_script_file): New local variables name and search_path. Update
  4471. comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
  4472. * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
  4473. * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
  4474. 2011-11-11 Sterling Augustine <saugustine@google.com>
  4475. * yyscript.y (section_cmd): Add support for INCLUDE directive.
  4476. (file_or_sections_cmd): Likewise.
  4477. 2011-11-11 Doug Kwan <dougkwan@google.com>
  4478. * arm.cc (Target_arm::do_make_elf_object): Allow executable also
  4479. if --just-symbols is given.
  4480. 2011-11-10 Doug Kwan <dougkwan@google.com>
  4481. PR gold/13362
  4482. * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
  4483. when processing data relocs.
  4484. * reloc.h (Relocate_functions::rel_unaligned): New method.
  4485. (Relocate_functions::pcrel_unaligned): Ditto.
  4486. (Relocate_functions::rel32_unaligned): Ditto.
  4487. (Relocate_functions::pcrel32_unaligned): Ditto.
  4488. 2011-11-09 Doug Kwan <dougkwan@google.com>
  4489. PR gold/13362
  4490. * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
  4491. Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
  4492. * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
  4493. RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
  4494. (Relocate_functions::rel_unaligned): New.
  4495. (Relocate_functions::rel32_unaligned): New.
  4496. * target-reloc.h (relocate_for_relocatable): Add code to handle
  4497. RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
  4498. * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
  4499. arm_unaligned_reloc_r): New targets.
  4500. * testsuite/Makefile.in: Regenerate.
  4501. * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
  4502. linking.
  4503. 2011-11-02 Ian Lance Taylor <iant@google.com>
  4504. * configure.ac: Add --with-lib-path option. Define LIB_PATH and
  4505. NATIVE_LINKER.
  4506. * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
  4507. * options.cc (General_options::finalize): Use library search path
  4508. from configure script if specified. If not native and no sysroot,
  4509. only search TOOLLIBDIR.
  4510. * options.h (Search_directory::Search_directory): Change name to
  4511. const std::string&.
  4512. (General_options::add_to_library_path_with_sysroot): Change arg to
  4513. const std::string&.
  4514. * configure, Makefile.in, config.in: Rebuild.
  4515. 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
  4516. * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
  4517. we are working around the ARM1176 Erratum.
  4518. * options.h (General_options::fix_arm1176): Add option.
  4519. * testsuite/Makefile.am: Add testcases, and keep current ones
  4520. working.
  4521. * testsuite/Makefile.in: Regenerate.
  4522. * testsuite/arm_fix_1176.s: New file.
  4523. * testsuite/arm_fix_1176.sh: Likewise.
  4524. 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
  4525. * arm.cc (Target_arm::Target_arm): Remove initialisation of
  4526. may_use_blx_.
  4527. (Target_arm::may_use_blx): Remove method.
  4528. (Target_arm::set_may_use_blx): Likewise.
  4529. (Target_arm::may_use_v4t_interworking): New method.
  4530. (Target_arm::may_use_v5t_interworking): Likewise.
  4531. (Target_arm::may_use_blx_): Remove member variable.
  4532. (Arm_relocate_functions::arm_branch_common): Check for v5T
  4533. interworking.
  4534. (Arm_relocate_functions::thumb_branch_common): Likewise.
  4535. (Reloc_stub::stub_type_for_reloc): Likewise.
  4536. (Target_arm::do_finalize_sections): Correct interworking checks.
  4537. * testsuite/Makefile.am: Add new tests.
  4538. * testsuite/Makefile.in: Regenerate.
  4539. * testsuite/arm_farcall_arm_arm.s: New test.
  4540. * testsuite/arm_farcall_arm_arm.sh: Likewise.
  4541. * testsuite/arm_farcall_arm_thumb.s: Likewise.
  4542. * testsuite/arm_farcall_arm_thumb.sh: Likewise.
  4543. * testsuite/arm_farcall_thumb_arm.s: Likewise.
  4544. * testsuite/arm_farcall_thumb_arm.sh: Likewise.
  4545. * testsuite/arm_farcall_thumb_thumb.s: Likewise.
  4546. * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
  4547. 2011-10-31 Cary Coutant <ccoutant@google.com>
  4548. PR gold/13023
  4549. * expression.cc (Expression::eval_with_dot): Add
  4550. is_section_dot_assignment parameter.
  4551. (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
  4552. absolute and assigning to dot within a section.
  4553. * script-sections.cc
  4554. (Output_section_element_assignment::set_section_addresses): Pass
  4555. dot_section to set_if_absolute.
  4556. (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
  4557. as is_section_dot_assignment flag to eval_with_dot.
  4558. (Output_section_element_dot_assignment::set_section_addresses):
  4559. Likewise.
  4560. * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
  4561. parameter. Also set value if relative to dot_section; set the
  4562. symbol's output_section.
  4563. * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
  4564. parameter. Adjust all callers.
  4565. (Expression::eval_maybe_dot): Likewise.
  4566. (Symbol_assignment::set_if_absolute): Add dot_section parameter.
  4567. Adjust all callers.
  4568. * testsuite/script_test_2.t: Test assignment of an absolute value
  4569. to dot within an output section element.
  4570. 2011-10-31 Cary Coutant <ccoutant@google.com>
  4571. * options.h (class General_options): Add --[no-]gnu-unique options.
  4572. * symtab.cc (Symbol_table::sized_write_globals): Convert
  4573. STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
  4574. 2011-10-31 Cary Coutant <ccoutant@google.com>
  4575. PR gold/13359
  4576. * i386.cc (Target_i386::Relocate::relocate_tls): Remove
  4577. unnecessary assertion.
  4578. * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
  4579. 2011-10-31 Sriraman Tallam <tmsriram@google.com>
  4580. * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
  4581. gc_mark_symbol.
  4582. * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
  4583. gc_mark_symbol.
  4584. Change to just keep the section associated with symbol.
  4585. (Symbol_table::add_from_relobj): Mark symbols as not garbage when
  4586. they are externally visible and --export-dynamic is turned on.
  4587. (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
  4588. 2011-10-19 Ian Lance Taylor <iant@google.com>
  4589. PR gold/13163
  4590. * script-sections.cc
  4591. (Output_section_element_dot_assignment::needs_output_section): New
  4592. function.
  4593. 2011-10-19 Ian Lance Taylor <iant@google.com>
  4594. PR gold/13204
  4595. * layout.cc (Layout::segment_precedes): Don't assert failure if a
  4596. --section-start option was seen.
  4597. * options.h (General_options::any_section_start): New function.
  4598. 2011-10-18 David S. Miller <davem@davemloft.net>
  4599. PR binutils/13301
  4600. * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
  4601. member to track relocation locations that have moved during TLS
  4602. reloc optimizations.
  4603. (Target_sparc::Relocate::Relocate): Initialize to NULL.
  4604. (Target_sparc::Relocate::relocate): Adjust view down by 4
  4605. bytes if it matches reloc_adjust_addr_.
  4606. (Target_sparc::Relocate::relocate_tls): Always move the
  4607. __tls_get_addr call delay slot instruction forward 4 bytes when
  4608. performing relaxation.
  4609. 2011-10-18 Cary Coutant <ccoutant@google.com>
  4610. * output.cc (posix_fallocate): Return 0 on success, errno on failure.
  4611. (Output_file::map_no_anonymous): Check for non-zero
  4612. return code from posix_fallocate.
  4613. 2011-10-17 Cary Coutant <ccoutant@google.com>
  4614. PR gold/13245
  4615. * plugin.cc (is_visible_from_outside): Check for symbols
  4616. referenced from dynamic objects.
  4617. * resolve.cc (Symbol_table::resolve): Don't count references
  4618. from dynamic objects as references from real ELF files.
  4619. * testsuite/plugin_test_2.sh: Adjust expected result.
  4620. 2011-10-17 Cary Coutant <ccoutant@google.com>
  4621. * gold.cc: Include timer.h.
  4622. (queue_middle_tasks): Stamp time.
  4623. (queue_final_tasks): Likewise.
  4624. * main.cc (main): Store timer in parameters. Print timers
  4625. for each pass.
  4626. * parameters.cc (Parameters::Parameters): Initialize timer_.
  4627. (Parameters::set_timer): New function.
  4628. (set_parameters_timer): New function.
  4629. * parameters.h (Parameters::set_timer): New function.
  4630. (Parameters::timer): New function.
  4631. (Parameters::timer_): New data member.
  4632. (set_parameters_timer): New function.
  4633. * timer.cc (Timer::stamp): New function.
  4634. (Timer::get_pass_time): New function.
  4635. * timer.h (Timer::stamp): New function.
  4636. (Timer::get_pass_time): New function.
  4637. (Timer::pass_times_): New data member.
  4638. 2011-10-17 Cary Coutant <ccoutant@google.com>
  4639. * readsyms.cc (Read_symbols::run): Don't queue an unblocker
  4640. task for members of lib groups.
  4641. 2011-10-17 Cary Coutant <ccoutant@google.com>
  4642. PR gold/13288
  4643. * fileread.cc (File_read::find_view): Add assert.
  4644. (File_read::make_view): Move bounds check (replace with assert)...
  4645. (File_read::find_or_make_view): ... to here.
  4646. 2011-10-12 Cary Coutant <ccoutant@google.com>
  4647. * output.cc (Output_file::open_base_file): Handle case where
  4648. ::read returns less than requested size.
  4649. 2011-10-10 Cary Coutant <ccoutant@google.com>
  4650. * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
  4651. Initialize defined_count_.
  4652. (Sized_relobj_incr::do_add_symbols): Count defined symbols.
  4653. (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
  4654. (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
  4655. (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
  4656. (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
  4657. * incremental.h (Sized_relobj_incr::defined_count_): New data
  4658. member.
  4659. (Sized_incr_dynobj::defined_count_): New data member.
  4660. * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
  4661. Return zeroes instead of internal error.
  4662. 2011-10-10 Cary Coutant <ccoutant@google.com>
  4663. PR gold/13249
  4664. * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
  4665. (Output_reloc::symbol_value): Return PLT offset if flag is set.
  4666. * output.h (class Output_reloc): Add use_plt_offset flag.
  4667. (Output_reloc::type_): Adjust size of bit field.
  4668. (Output_reloc::use_plt_offset_): New bit field.
  4669. (class Output_data_reloc): Adjust all calls to Output_reloc_type.
  4670. (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
  4671. flag. Adjust all callers.
  4672. * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
  4673. creating RELATIVE relocations.
  4674. 2011-10-10 Nick Clifton <nickc@redhat.com>
  4675. * po/es.po: Updated Spanish translation.
  4676. * po/fi.po: Updated Finnish translation.
  4677. 2011-10-03 Diego Novillo <dnovillo@google.com>
  4678. * options.cc (parse_uint): Fix dereference of RETVAL.
  4679. 2011-09-29 Sriraman Tallam <tmsriram@google.com>
  4680. * layout.h (section_order_map_): New member.
  4681. (get_section_order_map): New member function.
  4682. * output.cc (Output_section::add_input_section): Check for patterns
  4683. only when --section-ordering-file is specified.
  4684. * gold.cc (queue_middle_tasks): Delay updating order of sections till
  4685. output_sections have been formed.
  4686. * layout.cc (Layout_Layout): Initialize section_order_map_.
  4687. * plugin.cc (update_section_order): Store order in order_map. Do not
  4688. update the order.
  4689. * testsuite/Makefile.am: Add test case for plugin_final_layout.
  4690. * testsuite/Makefile.in: Regenerate.
  4691. * testsuite/plugin_section_order.c: New file.
  4692. * testsuite/plugin_final_layout.cc: New file.
  4693. * testsuite/plugin_final_layout.sh: New file.
  4694. 2011-09-29 Cary Coutant <ccoutant@google.com>
  4695. * incremental.cc (Sized_incremental_binary::do_process_got_plt):
  4696. Check for NULL.
  4697. * symtab.cc (Symbol_table::add_from_relobj): Ignore version
  4698. symbols during incremental update.
  4699. (Symbol_table::add_from_dynobj): Likewise.
  4700. 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  4701. Ian Lance Taylor <iant@google.com>
  4702. * symtab.cc (Symbol_table::define_special_symbol): Always
  4703. canonicalize version string.
  4704. 2011-09-26 Cary Coutant <ccoutant@google.com>
  4705. * gold.cc (queue_initial_tasks): Move option checks ...
  4706. * options.cc (General_options::finalize): ... to here. Disable
  4707. some options; make others fatal.
  4708. 2011-09-26 Cary Coutant <ccoutant@google.com>
  4709. gcc PR lto/47247
  4710. * plugin.cc (get_symbols_v2): New function.
  4711. (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
  4712. (is_referenced_from_outside): New function.
  4713. (Pluginobj::get_symbol_resolution_info): Add version parameter, return
  4714. LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
  4715. (get_symbols): Pass version parameter.
  4716. (get_symbols_v2): New function.
  4717. * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
  4718. parameter.
  4719. * testsuite/plugin_test.c (get_symbols_v2): New static variable.
  4720. (onload): Add LDPT_GET_SYMBOLS_V2.
  4721. (all_symbols_read_hook): Use get_symbols_v2; check for
  4722. LDPR_PREVAILING_DEF_IRONLY_EXP.
  4723. * testsuite/plugin_test_3.sh: Update expected results.
  4724. 2011-09-23 Simon Baldwin <simonb@google.com>
  4725. * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
  4726. configuration options.
  4727. * configure: Regenerate.
  4728. * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
  4729. * Makefile.in: Regenerate.
  4730. * testsuite/Makefile.in: Regenerate.
  4731. 2011-09-19 Sriraman Tallam <tmsriram@google.com>
  4732. * plugin.h (should_defer_layout): Modify to check for any_claimed_.
  4733. 2011-09-19 Cary Coutant <ccoutant@google.com>
  4734. * incremental.cc (can_incremental_update): Fix typo in comment.
  4735. * incremental.h (can_incremental_update): Likewise.
  4736. 2011-09-18 Cary Coutant <ccoutant@google.com>
  4737. * incremental.cc (can_incremental_update): New function.
  4738. * incremental.h (can_incremental_update): New function.
  4739. * layout.cc (Layout::init_fixed_output_section): Call it.
  4740. (Layout::make_output_section): Don't allow patch space in .eh_frame.
  4741. * object.cc (Sized_relobj_file::do_layout): Call
  4742. can_incremental_update.
  4743. 2011-09-13 Cary Coutant <ccoutant@google.com>
  4744. * configure.ac: Check for glibc support for gnu_indirect_function
  4745. support with static linking, setting automake conditional
  4746. IFUNC_STATIC.
  4747. * Makefile.in: Regenerate.
  4748. * configure: Regenerate.
  4749. * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
  4750. (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
  4751. for IFUNC_STATIC.
  4752. * testsuite/Makefile.in: Regenerate.
  4753. 2011-09-13 Cary Coutant <ccoutant@google.com>
  4754. * incremental.cc (Sized_relobj_incr::do_layout): Call
  4755. report_comdat_group for kept comdat sections.
  4756. * testsuite/Makefile.am (incremental_comdat_test_1): New test.
  4757. * testsuite/Makefile.in: Regenerate.
  4758. * testsuite/incr_comdat_test_1.cc: New source file.
  4759. * testsuite/incr_comdat_test_2_v1.cc: New source file.
  4760. * testsuite/incr_comdat_test_2_v2.cc: New source file.
  4761. * testsuite/incr_comdat_test_2_v3.cc: New source file.
  4762. 2011-09-13 Ian Lance Taylor <iant@google.com>
  4763. * object.cc (Sized_relobj_file::do_layout): Remove unused local
  4764. variable external_symbols_offset.
  4765. 2011-09-12 Ian Lance Taylor <iant@google.com>
  4766. * object.cc (Sized_relobj_file::do_layout): Remove assertion which
  4767. triggered if object has no symbols.
  4768. 2011-09-09 David S. Miller <davem@davemloft.net>
  4769. * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
  4770. (Output_fill_debug_line::do_write): Likewise.
  4771. 2011-08-29 Cary Coutant <ccoutant@google.com>
  4772. * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
  4773. casts to match formatting specs.
  4774. (Output_fill_debug_line::do_minimum_hole_size): Likewise.
  4775. 2011-08-26 Cary Coutant <ccoutant@google.com>
  4776. * layout.cc (Free_list::allocate): Provide guarantee of minimum
  4777. remaining hole size when allocating.
  4778. (Layout::make_output_section): Set fill methods for debug sections.
  4779. * layout.h (Free_list::Free_list_node): Move from private to
  4780. public.
  4781. (Free_list::set_min_hole_size): New function.
  4782. (Free_list::begin, Free_list::end): New functions.
  4783. (Free_list::min_hole_): New data member.
  4784. * output.cc: Include dwarf.h.
  4785. (Output_fill_debug_info::do_minimum_hole_size): New function.
  4786. (Output_fill_debug_info::do_write): New function.
  4787. (Output_fill_debug_line::do_minimum_hole_size): New function.
  4788. (Output_fill_debug_line::do_write): New function.
  4789. (Output_section::Output_section): Initialize new data member.
  4790. (Output_section::set_final_data_size): Ensure patch space is larger
  4791. than minimum hole size.
  4792. (Output_section::do_write): Fill holes in debug sections.
  4793. * output.h (Output_fill): New class.
  4794. (Output_fill_debug_info): New class.
  4795. (Output_fill_debug_line): New class.
  4796. (Output_section::set_free_space_fill): New function.
  4797. (Output_section::free_space_fill_): New data member.
  4798. * testsuite/Makefile.am (incremental_test_3): Add
  4799. --incremental-patch option.
  4800. (incremental_test_4): Likewise.
  4801. (incremental_test_5): Likewise.
  4802. (incremental_test_6): Likewise.
  4803. (incremental_copy_test): Likewise.
  4804. (incremental_common_test_1): Likewise.
  4805. * testsuite/Makefile.in: Regenerate.
  4806. 2011-08-26 Nick Clifton <nickc@redhat.com>
  4807. * po/es.po: Updated Spanish translation.
  4808. 2011-08-01 Cary Coutant <ccoutant@google.com>
  4809. * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
  4810. * gold/testsuite/Makefile.in: Regenerate.
  4811. * gold/testsuite/justsyms_exec.c: New source file.
  4812. * gold/testsuite/justsyms_lib.c: New source file.
  4813. 2011-08-01 Cary Coutant <ccoutant@google.com>
  4814. * layout.cc (Layout::set_segment_offsets): Don't realign text
  4815. segment if -Ttext was specified.
  4816. * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
  4817. file type.
  4818. * object.h (Sized_relobj_file::e_type): New function.
  4819. (Sized_relobj_file::e_type_): New data member.
  4820. * symtab.cc (Symbol_table::add_from_relobj): Don't add section
  4821. base address for ET_EXEC files.
  4822. * target.cc (Target::do_make_elf_object_implementation): Allow
  4823. ET_EXEC files with --just-symbols option.
  4824. 2011-07-28 Cary Coutant <ccoutant@google.com>
  4825. * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
  4826. Add thread_number parameter.
  4827. (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
  4828. * workqueue-threads.cc
  4829. (Workqueue_threader_threadpool::should_cancel_thread): Cancel
  4830. current thread if its thread number is greater than desired thread
  4831. count.
  4832. * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
  4833. Add thread_number parameter.
  4834. (Workqueue::should_cancel_thread): Likewise.
  4835. (Workqueue::find_runnable_or_wait): Pass thread_number to
  4836. should_cancel_thread.
  4837. * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
  4838. parameter.
  4839. 2011-07-22 Sriraman Tallam <tmsriram@google.com>
  4840. * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
  4841. only after checking if it cannot be forced local.
  4842. * symtab.h (is_externally_visible): Check if the symbol is not forced
  4843. local.
  4844. 2011-07-15 Ian Lance Taylor <iant@google.com>
  4845. * options.h (class General_options): Add --print-output-format.
  4846. Move -EL next to -EB, for better --help output.
  4847. * target-select.cc: Include <cstdio>, "options.h", and
  4848. "parameters.h".
  4849. (Target_selector::do_target_bfd_name): New function.
  4850. (print_output_format): New function.
  4851. * target-select.h (class Target_selector): Update declarations.
  4852. (Target_selector::target_bfd_name): New function.
  4853. (print_output_format): Declare.
  4854. * main.cc: Include "target-select.h".
  4855. (main): Handle --print-output-format.
  4856. * gold.cc: Include "target-select.h".
  4857. (queue_initial_tasks): Handle --print-output-format when there are
  4858. no input files.
  4859. * parameters.cc (parameters_force_valid_target): Give a better
  4860. error message if -EB/-EL does not match target.
  4861. * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
  4862. function.
  4863. 2011-07-15 Ian Lance Taylor <iant@google.com>
  4864. * i386.cc (class Output_data_plt_i386): Add layout_ field.
  4865. (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
  4866. (Output_data_plt_i386::do_write): Write address of .dynamic
  4867. section to first entry in .got.plt section.
  4868. * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
  4869. (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
  4870. Initialize layout_.
  4871. (Output_data_plt_x86_64::do_write): Write address of .dynamic
  4872. section to first entry in .got.plt section.
  4873. * layout.h (Layout::dynamic_section): New function.
  4874. 2011-07-13 Sriraman Tallam <tmsriram@google.com>
  4875. * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
  4876. to claim_file call.
  4877. * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
  4878. input_section_position_, and input_section_glob_.
  4879. (read_layout_from_file): Call function section_ordering_specified.
  4880. * layout.h (is_section_ordering_specified): New function.
  4881. (section_ordering_specified): New function.
  4882. (section_ordering_specified_): New boolean member.
  4883. * main.cc(main): Call load_plugins after layout object is defined.
  4884. * output.cc (Output_section::add_input_section): Use
  4885. function section_ordering_specified to check if section ordering is
  4886. needed.
  4887. * output.cc (Output_section::add_relaxed_input_section): Use
  4888. function section_ordering_specified to check if section ordering is
  4889. needed.
  4890. (Output_section::update_section_layout): New function.
  4891. (Output_section::sort_attached_input_sections): Check if input section
  4892. must be reordered.
  4893. * output.h (Output_section::update_section_layout): New function.
  4894. * plugin.cc (get_section_count): New function.
  4895. (get_section_type): New function.
  4896. (get_section_name): New function.
  4897. (get_section_contents): New function.
  4898. (update_section_order): New function.
  4899. (allow_section_ordering): New function.
  4900. (Plugin::load): Add the new interfaces to the transfer vector.
  4901. (Plugin_manager::load_plugins): New parameter.
  4902. (Plugin_manager::all_symbols_read): New parameter.
  4903. (Plugin_manager::claim_file): New parameter. Save the elf object for
  4904. unclaimed objects.
  4905. (Plugin_manager::get_elf_object): New function.
  4906. (Plugin_manager::get_view): Change to directly use the bool to check
  4907. if get_view is called from claim_file_hook.
  4908. * plugin.h (input_objects): New function
  4909. (Plugin__manager::load_plugins): New parameter.
  4910. (Plugin_manager::claim_file): New parameter.
  4911. (Plugin_manager::get_elf_object): New function.
  4912. (Plugin_manager::in_claim_file_handler): New function.
  4913. (Plugin_manager::in_claim_file_handler_): New member.
  4914. (layout): New function.
  4915. * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
  4916. handler with an extra parameter. Make the elf object before calling
  4917. claim_file handler.
  4918. * testsuite/plugin_test.c (get_section_count): New function pointer.
  4919. (get_section_type): New function pointer.
  4920. (get_section_name): New function pointer.
  4921. (get_section_contents): New function pointer.
  4922. (update_section_order): New function pointer.
  4923. (allow_section_ordering): New function pointer.
  4924. (onload): Check if the new interfaces exist.
  4925. 2011-07-13 Ian Lance Taylor <iant@google.com>
  4926. * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
  4927. relro section.
  4928. * x86_64.cc (Target_x86_64::got_section): Likewise.
  4929. * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
  4930. (relro_now_test_SOURCES): New variable.
  4931. (relro_now_test_DEPENDENCIES): New variable.
  4932. (relro_now_test_LDFLAGS): New variable.
  4933. (relro_now_test_LDADD): New variable.
  4934. (relro_now_test.so): New target.
  4935. * testsuite/Makefile.in: Rebuild.
  4936. 2011-07-12 Ian Lance Taylor <iant@google.com>
  4937. PR gold/12980
  4938. * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
  4939. GLOB_DAT relocation rather than a RELATIVE relocation for a
  4940. protected symbol when creating a shared library.
  4941. * x86_64.cc (Target_x86_64::Scan::global): Likewise.
  4942. * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
  4943. * testsuite/protected_main_1.cc (main): Test that protected
  4944. function has same address.
  4945. 2011-07-11 Ian Lance Taylor <iant@google.com>
  4946. PR gold/12979
  4947. * options.h (class General_options): Add -Bgroup.
  4948. * options.cc (General_options::finalize): If -Bgroup is set,
  4949. default to --unresolved-symbols=report-all.
  4950. * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
  4951. * target-reloc.h (issue_undefined_symbol_error): Handle
  4952. --unresolved-symbols=report-all.
  4953. 2011-07-08 Ian Lance Taylor <iant@google.com>
  4954. PR gold/11985
  4955. * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
  4956. if linker script discards key sections.
  4957. (Layout::create_dynamic_symtab): Likewise.
  4958. (Layout::assign_local_dynsym_offsets): Likewise.
  4959. (Layout::sized_create_version_sections): Likewise.
  4960. (Layout::create_interp): Likewise.
  4961. (Layout::finish_dynamic_section): Likewise.
  4962. (Layout::set_dynamic_symbol_size): Likewise.
  4963. 2011-07-08 Ian Lance Taylor <iant@google.com>
  4964. PR gold/12386
  4965. * options.h (class General_options): Add --unresolved-symbols.
  4966. * target-reloc.h (issue_undefined_symbol_error): Check
  4967. --unresolved-symbols. Add comments.
  4968. 2011-07-08 Ian Lance Taylor <iant@google.com>
  4969. * testsuite/odr_violation2.cc (Ordering::operator()): Make
  4970. expression more complex.
  4971. 2011-07-08 Ian Lance Taylor <iant@google.com>
  4972. PR gold/11317
  4973. * target-reloc.h (issue_undefined_symbol_error): New inline
  4974. function, broken out of relocate_section.
  4975. (relocate_section): Call issue_undefined_symbol_error.
  4976. * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
  4977. there is no TLS segment if we are about to issue an undefined
  4978. symbol error.
  4979. * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
  4980. 2011-07-08 Ian Lance Taylor <iant@google.com>
  4981. PR gold/12279
  4982. * resolve.cc (Symbol_table::should_override): Add fromtype
  4983. parameter. Change all callers. Give error when linking together
  4984. TLS and non-TLS symbol.
  4985. (Symbol_table::should_override_with_special): Add fromtype
  4986. parameter. Change all callers.
  4987. * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
  4988. there is no TLS segment if we have reported some errors.
  4989. * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
  4990. 2011-07-08 Ian Lance Taylor <iant@google.com>
  4991. PR gold/12372
  4992. * target.h (Target::plt_address_for_global): New function.
  4993. (Target::plt_address_for_local): New function.
  4994. (Target::plt_section_for_global): Remove.
  4995. (Target::plt_section_for_local): Remove.
  4996. (Target::do_plt_address_for_global): New virtual function.
  4997. (Target::do_plt_address_for_local): New virtual function.
  4998. (Target::do_plt_section_for_global): Remove.
  4999. (Target::do_plt_section_for_local): Remove.
  5000. (Target::register_global_plt_entry): Add Symbol_table and Layout
  5001. parameters.
  5002. * output.cc (Output_data_got::Got_entry::write): Use
  5003. plt_address_for_global and plt_address_for_local.
  5004. * layout.cc (Layout::add_target_dynamic_tags): Use size and
  5005. address of output section.
  5006. * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
  5007. got_irelative_, and irelative_count_ fields. Update
  5008. declarations.
  5009. (Output_data_plt_i386::has_irelative_section): New function.
  5010. (Output_data_plt_i386::entry_count): Add irelative_count_.
  5011. (Output_data_plt_i386::set_final_data_size): Likewise.
  5012. (class Target_i386): Add got_irelative_ and rel_irelative_
  5013. fields. Update declarations.
  5014. (Target_i386::Target_i386): Initialize new fields.
  5015. (Target_i386::do_plt_address_for_global): New function replacing
  5016. do_plt_section_for_global.
  5017. (Target_i386::do_plt_address_for_local): New function replacing
  5018. do_plt_section_for_local.
  5019. (Target_i386::got_section): Create got_irelative_.
  5020. (Target_i386::rel_irelative_section): New function.
  5021. (Output_data_plt_i386::Output_data_plt_i386): Initialize new
  5022. fields. Don't define __rel_iplt_{start,end}.
  5023. (Output_data_plt_i386::add_entry): Add symtab and layout
  5024. parameters. Change all callers. Use different PLT and GOT for
  5025. IFUNC symbols.
  5026. (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
  5027. layout parameters. Change all callers. Use different PLT and
  5028. GOT.
  5029. (Output_data_plt_i386::rel_tls_desc): Fix formatting.
  5030. (Output_data_plt_i386::rel_irelative): New function.
  5031. (Output_data_plt_i386::address_for_global): New function.
  5032. (Output_data_plt_i386::address_for_local): New function.
  5033. (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
  5034. IRELATIVE GOT when changing IFUNC GOT entries.
  5035. (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
  5036. reloc.
  5037. (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
  5038. if we didn't create an IRELATIVE GOT.
  5039. (Target_i386::Relocate::relocate): Use plt_address_for_global and
  5040. plt_address_for_local.
  5041. (Target_i386::do_dynsym_value): Use plt_address_for_global.
  5042. * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
  5043. got_irelative_, and irelative_count_ fields. Update
  5044. declarations.
  5045. (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
  5046. Initialize new fields. Remove symtab parameter. Change all
  5047. callers.
  5048. (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
  5049. irelative_count_.
  5050. (Output_data_plt_x86_64::has_irelative_section): New function.
  5051. (Output_data_plt_x86_64::entry_count): Add irelative_count_.
  5052. (class Target_x86_64): Add got_irelative_ and rel_irelative_
  5053. fields. Update declarations.
  5054. (Target_x86_64::Target_x86_64): Initialize new fields.
  5055. (Target_x86_64::do_plt_address_for_global): New function replacing
  5056. do_plt_section_for_global.
  5057. (Target_x86_64::do_plt_address_for_local): New function replacing
  5058. do_plt_section_for_local.
  5059. (Target_x86_64::got_section): Create got_irelative_.
  5060. (Target_x86_64::rela_irelative_section): New function.
  5061. (Output_data_plt_x86_64::init): Remove symtab parameter. Change
  5062. all callers. Don't create __rel_iplt_{start,end}.
  5063. (Output_data_plt_x86_64::add_entry): Add symtab and layout
  5064. parameters. Change all callers. Use different PLT and GOT for
  5065. IFUNC symbols.
  5066. (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
  5067. layout parameters. Change all callers. Use different PLT and
  5068. GOT.
  5069. (Output_data_plt_x86_64::add_relocation): Add symtab and layout
  5070. parameters. Change all callers. Use different PLT and GOT for
  5071. IFUNC symbols.
  5072. (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
  5073. (Output_data_plt_x86_64::rela_irelative): New function.
  5074. (Output_data_plt_x86_64::address_for_global): New function.
  5075. (Output_data_plt_x86_64::address_for_local): New function.
  5076. (Output_data_plt_x86_64::set_final_data_size): Likewise.
  5077. (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
  5078. (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
  5079. (Target_x86_64::register_global_plt_entry): Add symtab and layout
  5080. parameters.
  5081. (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
  5082. reloc.
  5083. (Target_x86_64::do_finalize_sections): Create the __rela_iplt
  5084. symbols if we didn't create an IRELATIVE GOT.
  5085. (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
  5086. plt_address_for_local.
  5087. (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
  5088. * testsuite/ifuncvar1.c: New test file.
  5089. * testsuite/ifuncvar2.c: New test file.
  5090. * testsuite/ifuncvar3.c: New test file.
  5091. * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
  5092. (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
  5093. (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
  5094. (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
  5095. * testsuite/Makefile.in: Rebuild.
  5096. 2011-07-07 Cary Coutant <ccoutant@google.com>
  5097. * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
  5098. (two_file_test_1_ndebug.o): Likewise.
  5099. (two_file_test_1b_ndebug.o): Likewise.
  5100. (two_file_test_2_ndebug.o): Likewise.
  5101. (two_file_test_main_ndebug.o): Likewise.
  5102. (incremental_test_2): Link with no-debug versions.
  5103. 2011-07-06 Cary Coutant <ccoutant@google.com>
  5104. * gold/incremental.cc
  5105. (Output_section_incremental_inputs::write_info_blocks): Check for
  5106. hidden and internal symbols.
  5107. 2011-07-06 Cary Coutant <ccoutant@google.com>
  5108. * incremental.cc (Sized_incremental_binary::do_file_has_changed):
  5109. Check disposition for startup file.
  5110. (Incremental_inputs::report_command_line): Ignore
  5111. --incremental-startup-unchanged option.
  5112. * options.cc (General_options::parse_incremental_startup_unchanged):
  5113. New function.
  5114. (General_options::General_options): Initialize new data member.
  5115. * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
  5116. (General_options): Add --incremental-startup-unchanged option.
  5117. (General_options::incremental_startup_disposition): New function.
  5118. (General_options::incremental_startup_disposition_): New data member.
  5119. 2011-07-06 Cary Coutant <ccoutant@google.com>
  5120. * incremental.cc (Sized_incremental_binary::setup_readers): Pass
  5121. input file index to Script_info ctor.
  5122. (Sized_incremental_binary::do_file_has_changed): Find the
  5123. command-line argument for files named in scripts.
  5124. * incremental.h (Script_info::Script_info): New ctor
  5125. with input file index.
  5126. (Script_info::input_file_index): New function.
  5127. (Script_info::input_file_index_): New data member.
  5128. (Incremental_binary::get_library): Add const.
  5129. (Incremental_binary::get_script_info): Add const.
  5130. * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
  5131. * testsuite/Makefile.am (incremental_test_5): New test case.
  5132. (incremental_test_6): New test case.
  5133. * testsuite/Makefile.in: Regenerate.
  5134. 2011-07-06 Cary Coutant <ccoutant@google.com>
  5135. * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
  5136. debug output when command lines differ.
  5137. 2011-07-06 Cary Coutant <ccoutant@google.com>
  5138. * incremental.cc (Incremental_inputs::report_command_line): Ignore
  5139. --incremental-patch option.
  5140. * layout.cc (Free_list::allocate): Extend allocation beyond original
  5141. end if enabled.
  5142. (Layout::make_output_section): Mark sections that should get
  5143. patch space.
  5144. * options.cc (parse_percent): New function.
  5145. * options.h (parse_percent): New function.
  5146. (DEFINE_percent): New macro.
  5147. (General_options): Add --incremental-patch option.
  5148. * output.cc (Output_section::Output_section): Initialize new data
  5149. members.
  5150. (Output_section::add_input_section): Print section name when out
  5151. of patch space.
  5152. (Output_section::add_output_section_data): Likewise.
  5153. (Output_section::set_final_data_size): Add patch space when
  5154. doing --incremental-full.
  5155. (Output_section::do_reset_address_and_file_offset): Remove patch
  5156. space.
  5157. (Output_segment::set_section_list_addresses): Print debug output
  5158. only if --incremental-update.
  5159. * output.h (Output_section::set_is_patch_space_allowed): New function.
  5160. (Output_section::is_patch_space_allowed_): New data member.
  5161. (Output_section::patch_space_): New data member.
  5162. * parameters.cc (Parameters::incremental_full): New function.
  5163. * parameters.h (Parameters::incremental_full): New function
  5164. * testsuite/Makefile.am (incremental_test_2): Add test for
  5165. --incremental-patch option.
  5166. * testsuite/Makefile.in: Regenerate.
  5167. * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
  5168. (t18): Remove function body.
  5169. 2011-07-05 Doug Kwan <dougkwan@google.com>
  5170. PR gold/12771
  5171. * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
  5172. Arm_Address type for relocation result.
  5173. (Arm_relocate_functions::abs16): Use unaligned access. Also fix
  5174. overflow check.
  5175. (Arm_relocate_functions::abs32): Use unaligned access.
  5176. (Arm_relocate_functions::rel32): Ditto.
  5177. (Arm_relocate_functions::prel31): Ditto.
  5178. (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
  5179. * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
  5180. static data relocations.
  5181. * testsuite/Makefile.in: Regnerate.
  5182. * testsuite/arm_unaligned_reloc.{s,sh}: New files.
  5183. 2011-07-05 Ian Lance Taylor <iant@google.com>
  5184. PR gold/12392
  5185. * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
  5186. symbols if necessary.
  5187. * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
  5188. 2011-07-05 Ian Lance Taylor <iant@google.com>
  5189. PR gold/12952
  5190. * resolve.cc (Symbol::override_base_with_special): Simply override
  5191. version with special symbol version, ignoring previous version.
  5192. 2011-07-05 Ian Lance Taylor <iant@google.com>
  5193. * object.cc (Sized_relobj_file::include_section_group): Add
  5194. information to comment about signature location.
  5195. 2011-07-02 Ian Lance Taylor <iant@google.com>
  5196. PR gold/12957
  5197. * options.h (class General_options): Add -f and -F.
  5198. * options.cc (General_options::finalize): Fatal error if -f/-F
  5199. are used without -shared.
  5200. * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
  5201. 2011-07-02 Ian Lance Taylor <iant@google.com>
  5202. * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
  5203. 2011-07-01 Ian Lance Taylor <iant@google.com>
  5204. PR gold/12525
  5205. PR gold/12952
  5206. * resolve.cc (Symbol::override_base_with_special): Don't override
  5207. the version if the overriding symbol has a different name.
  5208. * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
  5209. all callers. If we give an error about an undefined version,
  5210. define the base version if necessary.
  5211. * dynobj.h (class Versions): Update declaration.
  5212. * testsuite/weak_alias_test_5.cc: New file.
  5213. * testsuite/weak_alias_test.script: New file.
  5214. * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
  5215. and versioned_alias have the right value, and call t2.
  5216. * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
  5217. weak_alias_test_5.so.
  5218. (weak_alias_test_LDADD): Likewise.
  5219. (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
  5220. * testsuite/Makefile.in: Rebuild.
  5221. 2011-07-01 Ian Lance Taylor <iant@google.com>
  5222. PR gold/12525
  5223. * options.h (class General_options): Support -z notext.
  5224. * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
  5225. -Wl,-z,notext.
  5226. (two_file_shared_nonpic.so): Likewise.
  5227. (two_file_shared_mixed.so): Likewise.
  5228. (two_file_shared_mixed_1.so): Likewise.
  5229. (weak_undef_lib_nonpic.so): Likewise.
  5230. (alt/weak_undef_lib_nonpic.so): Likewise.
  5231. (tls_test_shared_nonpic.so): Likewise.
  5232. * testsuite/Makefile.in: Rebuild.
  5233. 2011-07-01 Ian Lance Taylor <iant@google.com>
  5234. PR gold/12525
  5235. * configure.ac: Test whether static linking works, setting
  5236. the automake conditional HAVE_STATIC.
  5237. * testsuite/Makefile.am: Disable tests using -static if
  5238. HAVE_STATIC is not true.
  5239. * configure, testsuite/Makefile.in: Rebuild.
  5240. 2011-07-01 Ian Lance Taylor <iant@google.com>
  5241. PR gold/12525
  5242. * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
  5243. Assert if we see DW_EH_PE_indirect.
  5244. * target.h (Target::ehframe_datarel_base): New function.
  5245. (Target::do_ehframe_datarel_base): New target function.
  5246. * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
  5247. * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
  5248. function.
  5249. 2011-07-01 Ian Lance Taylor <iant@google.com>
  5250. PR gold/12571
  5251. * options.h (class General_options): Add
  5252. --ld-generated-unwind-info.
  5253. * ehframe.cc (Fde::write): Add address parameter. Change all
  5254. callers. If associated with PLT, fill in address and size.
  5255. (Cie::set_output_offset): Only add merge mapping if there is an
  5256. object.
  5257. (Cie::write): Add address parameter. Change all callers.
  5258. (Eh_frame::add_ehframe_for_plt): New function.
  5259. * ehframe.h (class Fde): Update declarations. Move shndx_ and
  5260. input_offset_ fields into union u_, with new plt field.
  5261. (Fde::Fde): Adjust for new union field.
  5262. (Fde::Fde) [Output_data version]: New constructor.
  5263. (Fde::add_mapping): Only add merge mapping if there is an object.
  5264. (class Cie): Update declarations.
  5265. (class Eh_frame): Declare add_ehframe_for_plt.
  5266. * layout.cc (Layout::layout_eh_frame): Break out code into
  5267. make_eh_frame_section, and call it.
  5268. (Layout::make_eh_frame_section): New function.
  5269. (Layout::add_eh_frame_for_plt): New function.
  5270. * layout.h (class Layout): Update declarations.
  5271. * merge.cc (Merge_map::add_mapping): Add assertion.
  5272. * i386.cc: Include "dwarf.h".
  5273. (class Output_data_plt_i386): Make first_plt_entry,
  5274. dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
  5275. plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
  5276. and plt_eh_frame_fde.
  5277. (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
  5278. boundary. Call add_eh_frame_for_plt if appropriate.
  5279. * x86_64.cc: Include "dwarf.h".
  5280. (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
  5281. first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
  5282. plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
  5283. and plt_eh_frame_fde.
  5284. (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
  5285. appropriate.
  5286. 2011-06-29 Ian Lance Taylor <iant@google.com>
  5287. PR gold/12629
  5288. * object.cc (Sized_relobj_file::layout_section): Change shdr
  5289. parameter to be const.
  5290. (Sized_relobj_file::layout_eh_frame_section): New function, broken
  5291. out of do_layout.
  5292. (Sized_relobj_file::do_layout): Defer .eh_frame sections if
  5293. appropriate. Call layout_eh_frame_section.
  5294. (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
  5295. sections.
  5296. * object.h (class Sized_relobj_file): Update declarations.
  5297. 2011-06-29 Ian Lance Taylor <iant@google.com>
  5298. PR gold/12652
  5299. * script.cc (Token::integer_value): Accept trailing M/m/K/k
  5300. modifier.
  5301. (Lex::gather_token): Accept trailing M/m/K/k for integers.
  5302. 2011-06-29 Ian Lance Taylor <iant@google.com>
  5303. PR gold/12675
  5304. * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
  5305. SHT_X86_64_UNWIND.
  5306. * layout.cc (Layout::layout_eh_frame): Likewise.
  5307. 2011-06-29 Ian Lance Taylor <iant@google.com>
  5308. PR gold/12695
  5309. * layout.cc (Layout::symtab_section_shndx): New function.
  5310. * layout.h (class Layout): Declare symtab_section_shndx.
  5311. * output.cc (Output_section::write_header): Call it.
  5312. 2011-06-29 Ian Lance Taylor <iant@google.com>
  5313. PR gold/12818
  5314. * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
  5315. symbols which are not used in a relocation.
  5316. 2011-06-28 Ian Lance Taylor <iant@google.com>
  5317. PR gold/12898
  5318. * layout.cc (Layout::segment_precedes): Don't crash if a linker
  5319. script create indistinguishable segments.
  5320. (Layout::set_segment_offsets): Use stable_sort when sorting
  5321. segments. Pass this to Compare_segments constructor.
  5322. * layout.h (class Layout): Make segment_precedes non-static.
  5323. (class Compare_segments): Change from struct to class. Add
  5324. layout_ field. Add constructor.
  5325. * script-sections.cc
  5326. (Script_sections::attach_sections_using_phdrs_clause): Rename
  5327. local orphan to is_orphan. Don't report failure to put empty
  5328. section in segment. On attachment failure, report name of
  5329. section, and attach to first PT_LOAD segment.
  5330. 2011-06-28 Ian Lance Taylor <iant@google.com>
  5331. PR gold/12934
  5332. * target-select.cc (Target_selector::Target_selector): Add
  5333. emulation parameter. Change all callers.
  5334. (select_target_by_bfd_name): Rename from select_target_by_name.
  5335. Change all callers.
  5336. (select_target_by_emulation): New function.
  5337. (supported_emulation_names): New function.
  5338. * target-select.h (class Target_selector): Add emulation_ field.
  5339. Update declarations.
  5340. (Target_selector::recognize_by_bfd_name): Rename from
  5341. recognize_by_name. Change all callers.
  5342. (Target_selector::supported_bfd_names): Rename from
  5343. supported_names. Change all callers.
  5344. (Target_selector::recognize_by_emulation): New function.
  5345. (Target_selector::supported_emulations): New function.
  5346. (Target_selector::emulation): New function.
  5347. (Target_selector::do_recognize_by_bfd_name): Rename from
  5348. do_recognize_by_name. Change all callers.
  5349. (Target_selector::do_supported_bfd_names): Rename from
  5350. do_supported_names. Change all callers.
  5351. (Target_selector::do_recognize_by_emulation): New function.
  5352. (Target_selector::do_supported_emulations): New function.
  5353. (select_target_by_bfd_name): Change name in declaration.
  5354. (select_target_by_emulation): Declare.
  5355. (supported_emulation_names): Declare.
  5356. * parameters.cc (parameters_force_valid_target): Try to find
  5357. target based on emulation from -m option.
  5358. * options.h (class General_options): Change doc string for -m.
  5359. * options.cc (help): Print emulations.
  5360. (General_options::parse_V): Likewise.
  5361. * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
  5362. Add emulation parameter. Change all callers.
  5363. 2011-06-28 Ian Lance Taylor <iant@google.com>
  5364. * target.h (class Target): Add osabi_ field.
  5365. (Target::osabi): New function.
  5366. (Target::set_osabi): New function.
  5367. (Target::Target): Initialize osabi_.
  5368. (Target::do_adjust_elf_header): Make pure virtual.
  5369. (Sized_target::do_adjust_elf_header): Declare.
  5370. * target.cc (Sized_target::do_adjust_elf_header): New function.
  5371. (class Sized_target): Instantiate all versions.
  5372. * freebsd.h (class Target_freebsd): Remove.
  5373. (Target_selector_freebsd::do_recognize): Call set_osabi on
  5374. Target.
  5375. (Target_selector_freebsd::do_recognize_by_name): Likewise.
  5376. (Target_selector_freebsd::set_osabi): Remove.
  5377. * i386.cc (class Target_i386): Inherit from Sized_target rather
  5378. than Target_freebsd.
  5379. * x86_64.cc (class Target_x86_64): Likewise.
  5380. 2011-06-28 Ian Lance Taylor <iant@google.com>
  5381. * target.h (Target::can_check_for_function_pointers): Rewrite.
  5382. Make non-virtual.
  5383. (Target::can_icf_inline_merge_sections): Likewise.
  5384. (Target::section_may_have_icf_unsafe_poineters): Likewise.
  5385. (Target::Target_info): Add can_icf_inline_merge_sections field.
  5386. (Target::do_can_check_for_function_pointers): New virtual
  5387. function.
  5388. (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
  5389. * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
  5390. from can_check_for_function_pointers, move in file.
  5391. (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
  5392. section_may_have_icf_unsafe_poineters, move in file.
  5393. (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
  5394. * i386.cc (Target_i386::do_can_check_for_function_pointers):
  5395. Rename from can_check_for_function_pointers, move in file.
  5396. (Target_i386::can_icf_inline_merge_sections): Remove.
  5397. (Target_i386::i386_info): Initialize
  5398. can_icf_inline_merge_sections.
  5399. * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
  5400. Initialize can_icf_inline_merge_sections.
  5401. * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
  5402. * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
  5403. Rename from can_check_for_function_pointers, move in file.
  5404. (Target_x86_64::can_icf_inline_merge_sections): Remove.
  5405. (Target_x86_64::x86_64_info): Initialize
  5406. can_icf_inline_merge_sections.
  5407. * testsuite/testfile.cc (Target_test::test_target_info):
  5408. Likewise.
  5409. * icf.cc (get_section_contents): Correct formatting.
  5410. 2011-06-27 Ian Lance Taylor <iant@google.com>
  5411. * symtab.cc (Symbol::versioned_name): New function.
  5412. (Symbol_table::add_to_final_symtab): Use versioned_name when
  5413. appropriate.
  5414. (Symbol_table::sized_write_symbol): Likewise.
  5415. * symtab.h (class Symbol): Declare versioned_name.
  5416. * stringpool.h (class Stringpool_template): Add variant of add
  5417. which takes a std::basic_string.
  5418. * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
  5419. (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
  5420. (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
  5421. (ver_test_12.o): New target.
  5422. * testsuite/Makefile.in: Rebuild.
  5423. 2011-06-27 Doug Kwan <dougkwan@google.com>
  5424. * arm.cc (Arm_relocate_functions::thm_jump8,
  5425. Arm_relocate_functions::thm_jump11): Use a wider signed
  5426. type to compute offset.
  5427. * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
  5428. arm_thm_jump8.
  5429. * testsuite/Makefile.in: Regenerate.
  5430. * testsuite/arm_branch_in_range.sh: Check test results of
  5431. arm_thm_jump11 and arm_thm_jump8.
  5432. * testsuite/arm_thm_jump11.s: New test source file.
  5433. * testsuite/arm_thm_jump11.t: New linker script.
  5434. * testsuite/arm_thm_jump8.s: New test source file.
  5435. * testsuite/arm_thm_jump8.t: New linker script.
  5436. 2011-06-24 Ian Lance Taylor <iant@google.com>
  5437. * layout.cc: Include "object.h".
  5438. (ctors_sections_in_init_array): New static variable.
  5439. (Layout::is_ctors_in_init_array): New function.
  5440. (Layout::layout): Add entry to ctors_sections_in_init_array if
  5441. appropriate.
  5442. * layout.h (class Layout): Declare is_ctors_in_init_array.
  5443. * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
  5444. is_ctors_reverse_view is set.
  5445. (Sized_relobj_file::write_sections): Add layout parameter. Change
  5446. all callers. Set is_ctors_reverse_view field of View_size.
  5447. (Sized_relobj_file::reverse_words): New function.
  5448. * object.h (Sized_relobj_file::View_size): Add
  5449. is_ctors_reverse_view field.
  5450. (class Sized_relobj_file): Update declarations.
  5451. * testsuite/initpri3.c: New test.
  5452. * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
  5453. initpri3b.
  5454. (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
  5455. (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
  5456. (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
  5457. (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
  5458. * testsuite/Makefile.in: Rebuild.
  5459. 2011-06-24 Cary Coutant <ccoutant@google.com>
  5460. * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
  5461. (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
  5462. (debug_msg_cdebug.err): New targets.
  5463. * testsuite/Makefile.in: Regenerate.
  5464. * testsuite/debug_msg.sh: Check output of link with compressed debug.
  5465. Fix checks for link with shared library.
  5466. 2011-06-24 Doug Kwan <dougkwan@google.com>
  5467. * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
  5468. skip empty text sections.
  5469. * testsuite/arm_exidx_test.s: Test handling of an empty text section.
  5470. 2011-06-22 Ian Lance Taylor <iant@google.com>
  5471. PR gold/12910
  5472. * options.h (class General_options): Add --ctors-in-init-array.
  5473. * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
  5474. friends as SHT_PROGBITS for merging sections.
  5475. (Layout::layout): Remove special handling of .init_array and
  5476. friends. Don't sort if doing relocatable link. Sort for .ctors
  5477. and .dtors if ctors_in_init_array.
  5478. (Layout::make_output_section): Force correct section types for
  5479. .init_array and friends. Don't sort if doing relocatable link,
  5480. Don't sort .ctors and .dtors if ctors_in_init_array.
  5481. (Layout::section_name_mapping): Remove .ctors. and .dtorso.
  5482. (Layout::output_section_name): Add relobj parameter. Change all
  5483. callers. Handle .ctors. and .dtors. in code rather than table.
  5484. Handle .ctors and .dtors if ctors_in_init_array.
  5485. (Layout::match_file_name): New function, moved from output.cc.
  5486. * layout.h (class Layout): Update declarations.
  5487. * output.cc: Include "layout.h".
  5488. (Input_section_sort_entry::get_priority): New function.
  5489. (Input_section_sort_entry::match_file_name): Just call
  5490. Layout::match_file_name.
  5491. (Output_section::Input_section_sort_init_fini_compare::operator()):
  5492. Handle .ctors and .dtors. Sort by explicit priority rather than
  5493. by name.
  5494. * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
  5495. * testsuite/initpri2.c: New test.
  5496. * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
  5497. (check_PROGRAMS): Add initpri2.
  5498. (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
  5499. (initpri2_LDFLAGS, initpri2_LDADD): New variables.
  5500. * configure, testsuite/Makefile.in: Rebuild.
  5501. 2011-06-19 Ian Lance Taylor <iant@google.com>
  5502. PR gold/12880
  5503. * layout.cc (Layout::attach_allocated_section_to_segment): Add a
  5504. .interp section to a PT_INTERP segment even if we have seen a
  5505. --dynamic-linker option. Don't do it if we have seen a PHDRS
  5506. clause in a linker script.
  5507. (Layout::finalize): Don't create a .interp section if we've
  5508. already create a PT_INTERP segment.
  5509. (Layout::create_interp): Always call choose_output_section (revert
  5510. patch of 2011-06-17). Don't create PT_INTERP segment.
  5511. * script-sections.cc
  5512. (Script_sections::create_note_and_tls_segments): Add a .interp
  5513. section to a PT_INTERP segment even if we have seen a
  5514. --dynamic-linker option.
  5515. 2011-06-18 Ian Lance Taylor <iant@google.com>
  5516. * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
  5517. merely because a non-PT_LOAD segment has a dynamic reloc.
  5518. 2011-06-18 Ian Lance Taylor <iant@google.com>
  5519. * layout.cc (Layout::finish_dynamic_section): Don't create
  5520. DT_FLAGS entry if not needed.
  5521. 2011-06-18 Ian Lance Taylor <iant@google.com>
  5522. PR gold/12745
  5523. * layout.cc (Layout::layout_eh_frame): Correct handling of
  5524. writable .eh_frame section.
  5525. 2011-06-17 Ian Lance Taylor <iant@google.com>
  5526. PR gold/12893
  5527. * resolve.cc (Symbol_table::resolve): Don't give an error if a
  5528. symbol is redefined with the exact same object and value.
  5529. 2011-06-17 Ian Lance Taylor <iant@google.com>
  5530. PR gold/12880
  5531. * layout.h (class Layout): Add interp_segment_ field.
  5532. * layout.cc (Layout::Layout): Initialize interp_segment_ field.
  5533. (Layout::attach_allocated_section_to_segment): If making shared
  5534. library, put .interp section in PT_INTERP segment.
  5535. (Layout::finalize): Also call create_interp if -dynamic-linker
  5536. option was used.
  5537. (Layout::create_interp): Assert that there is no PT_INTERP
  5538. segment. If not using a SECTIONS clause, use make_output_section.
  5539. (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
  5540. * script-sections.cc
  5541. (Script_sections::create_note_and_tls_segments): If making shared
  5542. library, put .interp section in PT_INTERP segment.
  5543. 2011-06-17 Ian Lance Taylor <iant@google.com>
  5544. * object.cc (Sized_relobj_file::do_layout): Keep warning sections
  5545. when making a shared library.
  5546. 2011-06-17 Ian Lance Taylor <iant@google.com>
  5547. * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
  5548. parameter. Change all callers. Don't issue warning about PC32
  5549. against locally defined symbol.
  5550. 2011-06-16 Ian Lance Taylor <iant@google.com>
  5551. * symtab.cc (Warnings::issue_warning): Don't warn if relocation
  5552. occurs in same object.
  5553. 2011-06-14 Alan Modra <amodra@gmail.com>
  5554. * po/POTFILES.in: Regenerate.
  5555. 2011-06-09 Ian Lance Taylor <iant@google.com>
  5556. * script-sections.cc
  5557. (Orphan_output_section::set_section_addresses): For a relocatable
  5558. link set address to 0.
  5559. 2011-06-09 Cary Coutant <ccoutant@google.com>
  5560. PR gold/12804
  5561. * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
  5562. used with --compress-debug-sections.
  5563. * gold/object.cc (Sized_relobj_file::do_layout): Report
  5564. uncompressed size of compressed input sections.
  5565. 2011-06-08 Cary Coutant <ccoutant@google.com>
  5566. PR gold/12804
  5567. * testsuite/two_file_test_2_v1.cc: Change initialization of
  5568. v2 to keep it in .data.
  5569. 2011-06-07 Cary Coutant <ccoutant@google.com>
  5570. * common.cc (Symbol_table::do_allocate_commons_list): Call
  5571. gold_fallback.
  5572. * errors.cc (Errors::fatal): Adjust call to gold_exit.
  5573. (Errors::fallback): New function.
  5574. (gold_fallback): New function.
  5575. * errors.h (Errors::fallback): New function.
  5576. * gold.cc (gold_exit): Change status parameter to enum; adjust
  5577. all callers.
  5578. (queue_initial_tasks): Call gold_fallback.
  5579. * gold.h: Include cstdlib.
  5580. (Exit_status): New enum type.
  5581. (gold_exit): Change status parameter to enum.
  5582. (gold_fallback): New function.
  5583. * layout.cc (Layout::set_section_offsets): Call gold_fallback.
  5584. (Layout::create_symtab_sections): Likewise.
  5585. (Layout::create_shdrs): Likewise.
  5586. * main.cc (main): Adjust call to gold_exit.
  5587. * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
  5588. (Output_data_got::add_got_entry_pair): Likewise.
  5589. (Output_section::add_input_section): Likewise.
  5590. (Output_section::add_output_section_data): Likewise.
  5591. (Output_segment::set_section_list_addresses): Likewise.
  5592. * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
  5593. 2011-06-07 Cary Coutant <ccoutant@google.com>
  5594. * layout.cc (Layout::set_segment_offsets): Don't adjust layout
  5595. for incremental links.
  5596. * output.cc (Output_segment::set_section_list_addresses): Remove
  5597. FIXME and test for TLS or BSS.
  5598. 2011-06-07 Cary Coutant <ccoutant@google.com>
  5599. * testsuite/Makefile.am: Add incremental_copy_test,
  5600. incremental_common_test_1.
  5601. * testsuite/Makefile.in: Regenerate.
  5602. * testsuite/common_test_1_v1.c: New source file.
  5603. * testsuite/common_test_1_v2.c: New source file.
  5604. * testsuite/copy_test_v1.cc: New source file.
  5605. 2011-06-07 Cary Coutant <ccoutant@google.com>
  5606. * common.cc (Symbol_table::do_allocate_commons_list): For incremental
  5607. update, allocate common from bss section's free list.
  5608. * incremental-dump.cc (dump_incremental_inputs): Print flag for
  5609. linker-defined symbols.
  5610. * incremental.cc (Sized_incremental_binary::do_process_got_plt):
  5611. Skip GOT and PLT entries that are no longer referenced.
  5612. (Output_section_incremental_inputs::write_info_blocks): Mark
  5613. linker-defined symbols.
  5614. (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
  5615. * output.cc (Output_section::allocate): New function.
  5616. * output.h (Output_section::allocate): New function.
  5617. * resolve.cc (Symbol_table::report_resolve_problem): Add case for
  5618. linker-defined symbols.
  5619. (Symbol::override_base_with_special): Copy is_predefined_ flag.
  5620. * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
  5621. (Symbol::init_base_output_data): Likewise.
  5622. (Symbol::init_base_output_segment): Likewise.
  5623. (Symbol::init_base_constant): Likewise.
  5624. (Sized_symbol::init_output_data): Likewise.
  5625. (Sized_symbol::init_output_segment): Likewise.
  5626. (Sized_symbol::init_constant): Likewise.
  5627. (Symbol_table::do_define_in_output_data): Likewise.
  5628. (Symbol_table::do_define_in_output_segment): Likewise.
  5629. (Symbol_table::do_define_as_constant): Likewise.
  5630. * symtab.h (Symbol::is_predefined): New function.
  5631. (Symbol::init_base_output_data): Add is_predefined parameter.
  5632. (Symbol::init_base_output_segment): Likewise.
  5633. (Symbol::init_base_constant): Likewise.
  5634. (Symbol::is_predefined_): New data member.
  5635. (Sized_symbol::init_output_data): Add is_predefined parameter.
  5636. (Sized_symbol::init_output_segment): Likewise.
  5637. (Sized_symbol::init_constant): Likewise.
  5638. (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
  5639. 2011-06-07 Cary Coutant <ccoutant@google.com>
  5640. * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
  5641. instead of emit_copy_reloc.
  5642. (Copy_relocs::emit_copy_reloc): Refactor.
  5643. (Copy_relocs::make_copy_reloc): New function.
  5644. (Copy_relocs::add_copy_reloc): Remove.
  5645. * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
  5646. section.
  5647. (Copy_relocs::make_copy_reloc): New function.
  5648. (Copy_relocs::add_copy_reloc): Remove.
  5649. * gold.cc (queue_middle_tasks): Emit old COPY relocations from
  5650. unchanged input files.
  5651. * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
  5652. * incremental.cc (Sized_incremental_binary::do_reserve_layout):
  5653. Reserve BSS space for COPY relocations.
  5654. (Sized_incremental_binary::do_emit_copy_relocs): New function.
  5655. (Output_section_incremental_inputs::write_info_blocks): Record
  5656. whether a symbol is copied from a shared object.
  5657. (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
  5658. * incremental.h (enum Incremental_shlib_symbol_flags): New type.
  5659. (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
  5660. (Incremental_input_entry_reader::get_output_symbol_index): Add
  5661. is_copy parameter.
  5662. (Incremental_binary::emit_copy_relocs): New function.
  5663. (Incremental_binary::do_emit_copy_relocs): New function.
  5664. (Sized_incremental_binary::Sized_incremental_binary): Initialize
  5665. new data member.
  5666. (Sized_incremental_binary::add_copy_reloc): New function.
  5667. (Sized_incremental_binary::do_emit_copy_relocs): New function.
  5668. (Sized_incremental_binary::Copy_reloc): New struct.
  5669. (Sized_incremental_binary::Copy_relocs): New typedef.
  5670. (Sized_incremental_binary::copy_relocs_): New data member.
  5671. * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
  5672. * symtab.h (Symbol_table::add_from_incrobj): Change return type.
  5673. * target.h (Sized_target::emit_copy_reloc): New function.
  5674. * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
  5675. 2011-06-02 Cary Coutant <ccoutant@google.com>
  5676. PR gold/12163
  5677. * gold/archive.cc (Archive::Archive): Initialize new data member.
  5678. (Archive::include_all_members): Return if archive has already been
  5679. included.
  5680. * gold/archive.h (Archive::include_all_members_): New data member.
  5681. 2011-06-02 Nick Clifton <nickc@redhat.com>
  5682. * dynobj.h: Fix spelling mistake in comment.
  5683. * output.cc: Likewise.
  5684. 2011-05-31 Doug Kwan <dougkwan@google.com>
  5685. Asier Llano
  5686. PR gold/12826
  5687. * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
  5688. arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
  5689. * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
  5690. redundant arm_exidx_test.so.
  5691. * testsuite/Makefile.in: Regenerate.
  5692. (check_SCRIPTS): Add pr12826.sh
  5693. (check_DATA): Add pr12826.stdout
  5694. (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
  5695. * testsuite/pr12826.sh: New file.
  5696. * testsuite/pr12826_1.s: Ditto.
  5697. * testsuite/pr12826_1.s: Ditto.
  5698. 2011-05-30 Ian Lance Taylor <iant@google.com>
  5699. * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
  5700. sections.
  5701. 2011-05-29 Ian Lance Taylor <iant@google.com>
  5702. PR gold/12804
  5703. * testsuite/Makefile.am: Use different file name for two_file_test
  5704. temporary file for each incremental test.
  5705. * testsuite/Makefile.in: Rebuild.
  5706. 2011-05-29 Ian Lance Taylor <iant@google.com>
  5707. * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
  5708. binary input file is empty.
  5709. 2011-05-27 Ian Lance Taylor <iant@google.com>
  5710. * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
  5711. (ver_test_9.so): Likewise.
  5712. * testsuite/Makefile.in: Rebuild.
  5713. 2011-05-26 Cary Coutant <ccoutant@google.com>
  5714. * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
  5715. * incremental.cc (Incremental_inputs::report_input_section): Fix
  5716. comment, indentation.
  5717. (Incremental_inputs::report_comdat_group): New function.
  5718. (Output_section_incremental_inputs::set_final_data_size): Adjust size
  5719. of data for incremental input file entry.
  5720. (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
  5721. group count, COMDAT group signatures.
  5722. (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
  5723. an unchanged input file.
  5724. * incremental.h (Incremental_object_entry::Incremental_object_entry):
  5725. Initialize new data member.
  5726. (Incremental_object_entry::add_comdat_group): New function.
  5727. (Incremental_object_entry::get_comdat_group_count): New function.
  5728. (Incremental_object_entry::get_comdat_signature_key): New function.
  5729. (Incremental_object_entry::groups_): New data member.
  5730. (Incremental_inputs::report_comdat_group): New function.
  5731. (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
  5732. data for incremental input file entry.
  5733. (Incremental_input_entry_reader::get_comdat_group_count): New function.
  5734. (Incremental_input_entry_reader::get_input_section): Adjust size of
  5735. data for incremental input file entry.
  5736. (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
  5737. (Incremental_input_entry_reader::get_comdat_group_signature): New
  5738. function.
  5739. * object.cc (Sized_relobj::include_section_group): Report kept
  5740. COMDAT groups for incremental links.
  5741. 2011-05-24 David Meyer <pdox@google.com>
  5742. * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
  5743. with name parameter. Add found_name parameter.
  5744. * fileread.cc (Input_file::find_file): Adjust code accordingly.
  5745. * dirsearch.h (class Dirsearch): Update declaration.
  5746. 2011-05-24 Ian Lance Taylor <iant@google.com>
  5747. * archive.cc (Library_base::should_include_member): Pull in object
  5748. from archive if it defines the entry symbol.
  5749. * parameters.cc (Parameters::entry): New function.
  5750. * parameters.h (class Parameters): Declare entry.
  5751. * output.h (class Output_file_header): Remove entry_ field.
  5752. * output.cc (Output_file_header::Output_file_header): Remove entry
  5753. parameter. Change all callers.
  5754. (Output_file_header::entry): Use parameters->entry.
  5755. * gold.cc (queue_middle_tasks): Likewise.
  5756. * plugin.cc (Plugin_hook::run): Likewise.
  5757. 2011-05-24 Cary Coutant <ccoutant@google.com>
  5758. * gold.cc (queue_initial_tasks): Pass incremental base filename
  5759. to Output_file::open_base_file; don't print error message.
  5760. * incremental-dump.cc (main): Adjust call to
  5761. Output_file::open_for_modification.
  5762. * incremental-dump.cc (main): Likewise.
  5763. * incremental.cc (Incremental_inputs::report_command_line):
  5764. Ignore --incremental-base option when comparing command lines.
  5765. Ignore parameter when given as separate argument.
  5766. * options.h (class General_options): Add --incremental-base.
  5767. * output.cc (Output_file::Output_file):
  5768. (Output_file::open_base_file): Add base_name and writable parameters;
  5769. read base file into new file; print error message here.
  5770. (Output_file::map_no_anonymous): Add writable parameter; adjust all
  5771. callers.
  5772. * output.h (Output_file::open_for_modification): Rename to...
  5773. (Output_file::open_base_file): ...this; add base_name and
  5774. writable parameters; adjust all callers.
  5775. (Output_file::map_no_anonymous): Add writable parameter; adjust all
  5776. callers.
  5777. * testsuite/Makefile.am (incremental_test_4): Test
  5778. --incremental-base.
  5779. * testsuite/Makefile.in: Regenerate.
  5780. 2011-05-24 Cary Coutant <ccoutant@google.com>
  5781. * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
  5782. incremental_test_4.
  5783. * testsuite/Makefile.in: Regenerate.
  5784. * testsuite/two_file_test_1_v1.cc: New test source file.
  5785. * testsuite/two_file_test_1b_v1.cc: New test source file.
  5786. * testsuite/two_file_test_2_v1.cc: New test source file.
  5787. 2011-05-24 Cary Coutant <ccoutant@google.com>
  5788. * dynobj.h (Dynobj::do_dynobj): New function.
  5789. * incremental-dump.cc (dump_incremental_inputs): Print as_needed
  5790. flag and soname for shared objects.
  5791. * incremental.cc (Incremental_inputs::report_object): Make
  5792. either Incremental_object_entry or Incremental_dynobj_entry; add
  5793. soname to string table.
  5794. (Incremental_inputs::report_input_section): Add assertion.
  5795. (Output_section_incremental_inputs::set_final_data_size): Adjust
  5796. type of input file entry for shared libraries; adjust size of
  5797. shared library info entry.
  5798. (Output_section_incremental_inputs::write_input_files): Write
  5799. as_needed flag for shared libraries.
  5800. (Output_section_incremental_inputs::write_info_blocks): Adjust type
  5801. of input file entry for shared libraries; write soname.
  5802. (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
  5803. soname from incremental info.
  5804. * incremental.h (enum Incremental_input_flags): Add
  5805. INCREMENTAL_INPUT_AS_NEEDED.
  5806. (Incremental_input_entry::Incremental_input_entry): Initialize new
  5807. data member.
  5808. (Incremental_input_entry::set_as_needed): New function.
  5809. (Incremental_input_entry::as_needed): New function.
  5810. (Incremental_input_entry::do_dynobj_entry): New function.
  5811. (Incremental_input_entry::as_needed_): New data member.
  5812. (Incremental_object_entry::Incremental_object_entry): Don't check
  5813. for shared library.
  5814. (Incremental_object_entry::do_type): Likewise.
  5815. (class Incremental_dynobj_entry): New class.
  5816. (Incremental_input_entry_reader::as_needed): New function.
  5817. (Incremental_input_entry_reader::get_soname): New function.
  5818. (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
  5819. (Incremental_input_entry_reader::get_output_symbol_index): Adjust
  5820. size of shared library info entry.
  5821. * layout.cc (Layout::finish_dynamic_section): Don't test for
  5822. incremental link when adding DT_NEEDED entries.
  5823. * object.h (Object::Object): Initialize new data member.
  5824. (Object::dynobj): New function.
  5825. (Object::set_as_needed): New function.
  5826. (Object::as_needed): New function.
  5827. (Object::do_dynobj): New function.
  5828. (Object::as_needed_): New data member.
  5829. 2011-05-24 Cary Coutant <ccoutant@google.com>
  5830. * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
  5831. info; adjust display of GOT entries.
  5832. * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
  5833. vector of input objects; remove file_status_.
  5834. (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
  5835. (Sized_incremental_binary::do_process_got_plt): Adjust calls to
  5836. got_plt reader; call target hooks to reserve GOT entries.
  5837. (Output_section_incremental_inputs::set_final_data_size): Adjust size
  5838. of input file info header and GOT info entry.
  5839. (Output_section_incremental_inputs::write_info_blocks): Write dynamic
  5840. relocation info.
  5841. (Got_plt_view_info::got_descriptor): Remove.
  5842. (Got_plt_view_info::sym_index): New data member.
  5843. (Got_plt_view_info::input_index): New data member.
  5844. (Local_got_offset_visitor::visit): Write input file index.
  5845. (Global_got_offset_visitor::visit): Write 0 for input file index.
  5846. (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
  5847. with sym_index and input_index.
  5848. (Output_section_incremental_inputs::write_got_plt): Adjust size of
  5849. incremental info GOT entry; replace got_descriptor with input_index.
  5850. (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
  5851. map from input file index to object.
  5852. (Sized_relobj_incr::do_layout): Replace direct data member reference
  5853. with accessor function.
  5854. (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
  5855. * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
  5856. Adjust size of input file info header.
  5857. (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
  5858. (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
  5859. (Incremental_input_entry_reader::get_input_section): Adjust size of
  5860. input file info header.
  5861. (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
  5862. of incremental info GOT entry.
  5863. (Incremental_got_plt_reader::get_got_desc): Remove.
  5864. (Incremental_got_plt_reader::get_got_symndx): New function.
  5865. (Incremental_got_plt_reader::get_got_input_index): New function.
  5866. (Sized_incremental_binary::Sized_incremental_binary): Remove
  5867. file_status_; add input_objects_.
  5868. (Sized_incremental_binary::~Sized_incremental_binary): Remove.
  5869. (Sized_incremental_binary::set_file_is_unchanged): Remove.
  5870. (Sized_incremental_binary::file_is_unchanged): Remove.
  5871. (Sized_incremental_binary::set_input_object): New function.
  5872. (Sized_incremental_binary::input_object): New function.
  5873. (Sized_incremental_binary::file_status_): Remove.
  5874. (Sized_incremental_binary::input_objects_): New data member.
  5875. (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
  5876. references.
  5877. (Sized_relobj_incr::invalid_address): Move to base class.
  5878. (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
  5879. class.
  5880. (Sized_relobj_incr::do_output_section_offset): Likewise.
  5881. (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
  5882. (Sized_relobj_incr::section_offsets_): Likewise.
  5883. * object.cc (Sized_relobj::do_for_all_local_got_entries): New
  5884. function.
  5885. (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
  5886. (Sized_relobj_file::layout_section): Replace refs to section_offsets_
  5887. with accessor function.
  5888. (Sized_relobj_file::do_layout): Likewise.
  5889. (Sized_relobj_file::do_layout_deferred_sections): Likewise.
  5890. (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
  5891. (Sized_relobj_file::compute_final_local_value): Replace refs to
  5892. section_offsets_ with accessor function.
  5893. (Sized_relobj_file::do_finalize_local_symbols): Likewise.
  5894. * object.h (Relobj::Relobj): Initialize new data members.
  5895. (Relobj::add_dyn_reloc): New function.
  5896. (Relobj::first_dyn_reloc): New function.
  5897. (Relobj::dyn_reloc_count): New function.
  5898. (Relobj::first_dyn_reloc_): New data member.
  5899. (Relobj::dyn_reloc_count_): New data member.
  5900. (Sized_relobj): Rename Sized_relobj_base to this; adjust all
  5901. references.
  5902. (Sized_relobj::Address): New typedef.
  5903. (Sized_relobj::invalid_address): Move here from child class.
  5904. (Sized_relobj::Sized_relobj): Initialize new data members.
  5905. (Sized_relobj::sized_relobj): New function.
  5906. (Sized_relobj::is_output_section_offset_invalid): Move here from
  5907. child class.
  5908. (Sized_relobj::get_output_section_offset): Likewise.
  5909. (Sized_relobj::local_has_got_offset): Likewise.
  5910. (Sized_relobj::local_got_offset): Likewise.
  5911. (Sized_relobj::set_local_got_offset): Likewise.
  5912. (Sized_relobj::do_for_all_local_got_entries): Likewise.
  5913. (Sized_relobj::clear_got_offsets): New function.
  5914. (Sized_relobj::section_offsets): Move here from child class.
  5915. (Sized_relobj::do_output_section_offset): Likewise.
  5916. (Sized_relobj::do_set_section_offset): Likewise.
  5917. (Sized_relobj::Local_got_offsets): Likewise.
  5918. (Sized_relobj::local_got_offsets_): Likewise.
  5919. (Sized_relobj::section_offsets_): Likewise.
  5920. (Sized_relobj_file): Rename Sized_relobj to this; adjust all
  5921. references.
  5922. (Sized_relobj_file::is_output_section_offset_invalid): Move to base
  5923. class.
  5924. (Sized_relobj_file::sized_relobj): New function
  5925. (Sized_relobj_file::local_has_got_offset): Move to base class.
  5926. (Sized_relobj_file::local_got_offset): Likewise.
  5927. (Sized_relobj_file::set_local_got_offset): Likewise.
  5928. (Sized_relobj_file::get_output_section_offset): Likewise.
  5929. (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
  5930. (Sized_relobj_file::do_output_section_offset): Likewise.
  5931. (Sized_relobj_file::do_set_section_offset): Likewise.
  5932. (Sized_relobj_file::Local_got_offsets): Likewise.
  5933. (Sized_relobj_file::local_got_offsets_): Likewise.
  5934. (Sized_relobj_file::section_offsets_): Likewise.
  5935. * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
  5936. (all constructors).
  5937. (set_needs_dynsym_index): Convert relobj to derived class pointer.
  5938. (Output_reloc::get_symbol_index): Likewise.
  5939. (Output_reloc::local_section_offset): Likewise.
  5940. (Output_reloc::get_address): Likewise.
  5941. (Output_reloc::symbol_value): Likewise.
  5942. (Output_data_got::reserve_slot): Move to class definition.
  5943. (Output_data_got::reserve_local): New function.
  5944. (Output_data_got::reserve_slot_for_global): Remove.
  5945. (Output_data_got::reserve_global): New function.
  5946. * output.h (Output_reloc::Output_reloc): Adjust type of relobj
  5947. (all constructors, two instantiations).
  5948. (Output_reloc::get_relobj): New function (two instantiations).
  5949. (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
  5950. (Output_data_reloc_base::add): Convert relobj to derived class pointer.
  5951. (Output_data_reloc::add_global): Adjust type of relobj.
  5952. (Output_data_reloc::add_global_relative): Likewise.
  5953. (Output_data_reloc::add_symbolless_global_addend): Likewise.
  5954. (Output_data_reloc::add_local): Likewise.
  5955. (Output_data_reloc::add_local_relative): Likewise.
  5956. (Output_data_reloc::add_symbolless_local_addend): Likewise.
  5957. (Output_data_reloc::add_local_section): Likewise.
  5958. (Output_data_reloc::add_output_section): Likewise.
  5959. (Output_data_reloc::add_absolute): Likewise.
  5960. (Output_data_reloc::add_target_specific): Likewise.
  5961. (Output_data_got::reserve_slot): Move definition here.
  5962. (Output_data_got::reserve_local): New function.
  5963. (Output_data_got::reserve_global): New function.
  5964. * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
  5965. section_offsets_ with accessor function.
  5966. (Sized_relobj_file::write_sections): Likewise.
  5967. (Sized_relobj_file::do_relocate_sections): Likewise.
  5968. * target.h (Sized_target::reserve_local_got_entry): New function.
  5969. (Sized_target::reserve_global_got_entry): New function.
  5970. * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
  5971. (Target_x86_64::reserve_global_got_entry): New function.
  5972. (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
  5973. 2011-05-23 Cary Coutant <ccoutant@google.com>
  5974. * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
  5975. * incremental-dump.cc (dump_incremental_inputs): Mask high-order
  5976. bit when checking got_type.
  5977. * incremental.cc (Sized_incremental_binary::setup_readers):
  5978. Store symbol table and string table locations; initialize bit vector
  5979. of file status flags.
  5980. (Sized_incremental_binary::do_reserve_layout): Set bit flag for
  5981. unchanged files.
  5982. (Sized_incremental_binary::do_process_got_plt): New function.
  5983. (Sized_incremental_binary::get_symtab_view): Use stored locations.
  5984. (Output_section_incremental_inputs::set_final_data_size): Record
  5985. file index for each input file.
  5986. (Output_section_incremental_inputs::write_got_plt): Store file index
  5987. instead of input entry offset for each GOT entry.
  5988. * incremental.h
  5989. (Incremental_input_entry::Incremental_input_entry): Initialize new
  5990. data member.
  5991. (Incremental_input_entry::set_offset): Store file index.
  5992. (Incremental_input_entry::get_file_index): New function.
  5993. (Incremental_input_entry::file_index_): New data member.
  5994. (Incremental_binary::process_got_plt): New function.
  5995. (Incremental_binary::do_process_got_plt): New function.
  5996. (Sized_incremental_binary::Sized_incremental_binary): Initialize new
  5997. data members.
  5998. (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
  5999. (Sized_incremental_binary::set_file_is_unchanged): New function.
  6000. (Sized_incremental_binary::file_is_unchanged): New function.
  6001. (Sized_incremental_binary::do_process_got_plt): New function.
  6002. (Sized_incremental_binary::file_status_): New data member.
  6003. (Sized_incremental_binary::main_symtab_loc_): New data member.
  6004. (Sized_incremental_binary::main_strtab_loc_): New data member.
  6005. * output.cc (Output_data_got::Got_entry::write): Add case
  6006. RESERVED_CODE.
  6007. (Output_data_got::add_global): Call add_got_entry.
  6008. (Output_data_got::add_global_plt): Likewise.
  6009. (Output_data_got::add_global_with_rel): Likewise.
  6010. (Output_data_got::add_global_with_rela): Likewise.
  6011. (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
  6012. (Output_data_got::add_global_pair_with_rela): Likewise.
  6013. (Output_data_got::add_local): Call add_got_entry.
  6014. (Output_data_got::add_local_plt): Likewise.
  6015. (Output_data_got::add_local_with_rel): Likewise.
  6016. (Output_data_got::add_local_with_rela): Likewise.
  6017. (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
  6018. (Output_data_got::add_local_pair_with_rela): Likewise.
  6019. (Output_data_got::reserve_slot): New function.
  6020. (Output_data_got::reserve_slot_for_global): New function.
  6021. (Output_data_got::add_got_entry): New function.
  6022. (Output_data_got::add_got_entry_pair): New function.
  6023. (Output_section::add_output_section_data): Edit FIXME.
  6024. * output.h
  6025. (Output_section_data_build::Output_section_data_build): New
  6026. constructor with size parameter.
  6027. (Output_data_space::Output_data_space): Likewise.
  6028. (Output_data_got::Output_data_got): Initialize new data member; new
  6029. constructor with size parameter.
  6030. (Output_data_got::add_constant): Call add_got_entry.
  6031. (Output_data_got::reserve_slot): New function.
  6032. (Output_data_got::reserve_slot_for_global): New function.
  6033. (class Output_data_got::Got_entry): Add RESERVED_CODE.
  6034. (Output_data_got::add_got_entry): New function.
  6035. (Output_data_got::add_got_entry_pair): New function.
  6036. (Output_data_got::free_list_): New data member.
  6037. * target.h (Sized_target::init_got_plt_for_update): New function.
  6038. (Sized_target::register_global_plt_entry): New function.
  6039. * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
  6040. Initialize new data member; call init; add constructor with PLT count.
  6041. (Output_data_plt_x86_64::init): New function.
  6042. (Output_data_plt_x86_64::add_relocation): New function.
  6043. (Output_data_plt_x86_64::reserve_slot): New function.
  6044. (Output_data_plt_x86_64::free_list_): New data member.
  6045. (Target_x86_64::init_got_plt_for_update): New function.
  6046. (Target_x86_64::register_global_plt_entry): New function.
  6047. (Output_data_plt_x86_64::add_entry): Allocate from free list for
  6048. incremental updates.
  6049. (Output_data_plt_x86_64::add_relocation): New function.
  6050. * testsuite/object_unittest.cc (Object_test): Set default options.
  6051. 2011-05-16 Ian Lance Taylor <iant@google.com>
  6052. * options.h (class General_options): Make -i a synonym for -r.
  6053. 2011-05-16 Ian Lance Taylor <iant@google.com>
  6054. * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
  6055. 2011-05-10 Cary Coutant <ccoutant@google.com>
  6056. * object.cc (Sized_relobj::do_count_local_symbols): Check for
  6057. strip_all (-s).
  6058. 2011-05-06 Ian Lance Taylor <iant@google.com>
  6059. * layout.cc (Layout::layout): If the output section flags change,
  6060. update the ordering.
  6061. 2011-04-25 Cary Coutant <ccoutant@google.com>
  6062. * incremental-dump.cc (dump_incremental_inputs): Print local
  6063. symbol info for each input file.
  6064. * incremental.cc
  6065. (Output_section_incremental_inputs::set_final_data_size): Add local
  6066. symbol info to input file entries in incremental info.
  6067. (Output_section_incremental_inputs::write_info_blocks): Likewise.
  6068. (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
  6069. (Sized_incr_relobj::do_add_symbols): Cosmetic change.
  6070. (Sized_incr_relobj::do_count_local_symbols): Replace stub with
  6071. implementation.
  6072. (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
  6073. (Sized_incr_relobj::do_relocate): Write the local symbols.
  6074. (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
  6075. * incremental.h (Incremental_inputs_reader::get_symbol_offset):
  6076. Adjust size of input file header.
  6077. (Incremental_inputs_reader::get_local_symbol_offset): New function.
  6078. (Incremental_inputs_reader::get_local_symbol_count): New function.
  6079. (Incremental_inputs_reader::get_input_section): Adjust size of input
  6080. file header.
  6081. (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
  6082. (Sized_incr_relobj::This): New typedef.
  6083. (Sized_incr_relobj::sym_size): New const data member.
  6084. (Sized_incr_relobj::Local_symbol): New struct.
  6085. (Sized_incr_relobj::do_output_local_symbol_count): New function.
  6086. (Sized_incr_relobj::do_local_symbol_offset): New function.
  6087. (Sized_incr_relobj::local_symbol_count_): New data member.
  6088. (Sized_incr_relobj::output_local_dynsym_count_): New data member.
  6089. (Sized_incr_relobj::local_symbol_index_): New data member.
  6090. (Sized_incr_relobj::local_symbol_offset_): New data member.
  6091. (Sized_incr_relobj::local_dynsym_offset_): New data member.
  6092. (Sized_incr_relobj::local_symbols_): New data member.
  6093. * object.h (Relobj::output_local_symbol_count): New function.
  6094. (Relobj::local_symbol_offset): New function.
  6095. (Relobj::do_output_local_symbol_count): New function.
  6096. (Relobj::do_local_symbol_offset): New function.
  6097. (Sized_relobj::do_output_local_symbol_count): New function.
  6098. (Sized_relobj::do_local_symbol_offset): New function.
  6099. 2011-04-22 Vladimir Simonov <sv@sw.ru>
  6100. * descriptors.cc (set_close_on_exec): New function.
  6101. (Descriptors::open): Use set_close_on_exec.
  6102. * output.cc (S_ISLNK): Define if not defined.
  6103. 2011-04-22 Cary Coutant <ccoutant@google.com>
  6104. * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
  6105. global symbol map.
  6106. (Sized_incremental_binary::do_apply_incremental_relocs): New function.
  6107. (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
  6108. (Sized_incr_relobj::do_relocate): Remap section indices in incremental
  6109. relocations.
  6110. (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
  6111. (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
  6112. (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
  6113. * incremental.h
  6114. (Incremental_inputs_reader::global_symbol_reader_at_offset): New
  6115. function.
  6116. (Incremental_binary::apply_incremental_relocs): New function.
  6117. (Incremental_binary::do_apply_incremental_relocs): New function.
  6118. (Sized_incremental_binary::Sized_incremental_binary): Initialize new
  6119. data member.
  6120. (Sized_incremental_binary::add_global_symbol): New function.
  6121. (Sized_incremental_binary::global_symbol): New function.
  6122. (Sized_incremental_binary::do_apply_incremental_relocs): New function.
  6123. (Sized_incremental_binary::symbol_map_): New data member.
  6124. * layout.cc (Layout_task_runner::run): Apply incremental relocations.
  6125. * target.h (Sized_target::apply_relocation): New function.
  6126. * target-reloc.h (apply_relocation): New function.
  6127. * x86_64.cc (Target_x86_64::apply_relocation): New function.
  6128. 2011-04-22 Doug Kwan <dougkwan@google.com>
  6129. * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
  6130. flag of a SHT_ARM_EXIDX section.
  6131. * testsuite/Makefile.am (arm_exidx_test): New test rules.
  6132. * testsuite/Makefile.in: Regenerate.
  6133. * testsuite/arm_exidx_test.s: New file.
  6134. * testsuite/arm_exidx_test.sh: Same.
  6135. 2011-04-20 Cary Coutant <ccoutant@google.com>
  6136. PR gold/12689
  6137. * archive.h (Incremental_archive_entry::Archive_member):
  6138. Initialize arg_serial_ (second constructor).
  6139. 2011-04-17 Ian Lance Taylor <iant@google.com>
  6140. * object.cc (Relocate_info::location): Simplify location string.
  6141. * errors.cc (Errors::error_at_location): Don't print program
  6142. name.
  6143. (Errors::warning_at_location): Likewise.
  6144. (Errors::undefined_symbol): Likewise.
  6145. * testsuite/debug_msg.sh: Update accordingly.
  6146. 2011-04-14 Cary Coutant <ccoutant@google.com>
  6147. * gold/layout.cc (Layout::symtab_section_offset): New function.
  6148. * gold/layout.h (Layout::symtab_section_offset): New function.
  6149. * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
  6150. 2011-04-12 Ian Lance Taylor <iant@google.com>
  6151. * configure.ac: Check for sys/mman.h and mmap. Check for mremap
  6152. with MREMAP_MAYMOVE.
  6153. * output.h (class Output_file): Add map_is_allocated_ field.
  6154. * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
  6155. not available, provide stubs. If mremap is not available, #define
  6156. it to gold_mremap.
  6157. (MREMAP_MAYMOVE): Define if not defined.
  6158. (Output_file::Output_file): Initialize map_is_allocated_.
  6159. (Output_file::resize): Check map_is_allocated_.
  6160. (Output_file::map_anonymous): If mmap fails, use malloc.
  6161. (Output_file::unmap): Don't do anything for an anonymous map.
  6162. * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
  6163. is not available, provide stubs.
  6164. (File_read::View::~View): Use free rather than delete[].
  6165. (File_read::make_view): Use malloc rather than new[]. If mmap
  6166. fails, use malloc.
  6167. (File_read::find_or_make_view): Use malloc rather than new[].
  6168. * gold.h: Remove HAVE_REMAP code.
  6169. * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
  6170. exists. Rename mremap to gold_mremap. If mmap is not available
  6171. don't do anything.
  6172. * configure, config.in: Rebuild.
  6173. 2011-04-11 Ian Lance Taylor <iant@google.com>
  6174. * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
  6175. initialize local variable v.
  6176. 2011-04-11 Cary Coutant <ccoutant@google.com>
  6177. * archive.cc (Archive::include_member): Adjust call to
  6178. report_object.
  6179. (Add_archive_symbols::run): Track argument serial numbers.
  6180. (Lib_group::include_member): Likewise.
  6181. (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
  6182. * archive.h (Incremental_archive_entry::Archive_member):
  6183. Initialize arg_serial_.
  6184. (Archive_member::arg_serial_): New data member.
  6185. * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
  6186. (Sized_dynobj::do_add_symbols): Track symbols when doing an
  6187. incremental link.
  6188. (Sized_dynobj::do_for_all_local_got_entries): New function.
  6189. * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
  6190. function.
  6191. * fileread.cc (get_mtime): New function.
  6192. * fileread.h (get_mtime): New function.
  6193. * gold.cc (queue_initial_tasks): Check for incremental update.
  6194. (process_incremental_input): New function.
  6195. (queue_middle_tasks): Don't force valid target for incremental
  6196. update.
  6197. * incremental-dump.cc (find_input_containing_global): Adjust
  6198. size of symbol info entry.
  6199. (dump_incremental_inputs): Dump argument serial number and
  6200. in_system_directory flag; bias shndx by 1; print symbol names
  6201. when dumping per-file symbol lists; use new symbol info readers.
  6202. * incremental.cc
  6203. (Output_section_incremental_inputs:update_data_size): New function.
  6204. (Sized_incremental_binary::setup_readers): Setup input readers
  6205. for each input file; build maps for files added from libraries
  6206. and scripts.
  6207. (Sized_incremental_binary::check_input_args): New function.
  6208. (Sized_incremental_binary::do_check_inputs): Build map of argument
  6209. serial numbers to input arguments.
  6210. (Sized_incremental_binary::do_file_has_changed): Rename
  6211. do_file_is_unchanged to this; compare file modification times.
  6212. (Sized_incremental_binary::do_init_layout): New function.
  6213. (Sized_incremental_binary::do_reserve_layout): New function.
  6214. (Sized_incremental_binary::do_get_input_reader): Remove.
  6215. (Sized_incremental_binary::get_symtab_view): New function.
  6216. (Incremental_checker::can_incrementally_link_output_file): Remove.
  6217. (Incremental_inputs::report_command_line): Exclude --debug options.
  6218. (Incremental_inputs::report_archive_begin): Add parameter; track
  6219. argument serial numbers; don't put input file entry for archive
  6220. before archive members.
  6221. (Incremental_inputs::report_archive_end): Put input file entry
  6222. for archive after archive members.
  6223. (Incremental_inputs::report_object): Add parameter; track argument
  6224. serial numbers and in_system_directory flag.
  6225. (Incremental_inputs::report_script): Add parameter; track argument
  6226. serial numbers.
  6227. (Output_section_incremental_inputs::set_final_data_size): Adjust
  6228. size of symbol info entry; check for forwarding symbols.
  6229. (Output_section_incremental_inputs::write_input_files): Write
  6230. in_system_directory flag and argument serial number.
  6231. (Output_section_incremental_inputs::write_info_blocks): Map section
  6232. indices between incremental info and original input file; store
  6233. input section index for each symbol.
  6234. (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
  6235. change operator() to visit().
  6236. (class Global_got_offset_visitor): Likewise.
  6237. (class Global_symbol_visitor_got_plt):
  6238. (Output_section_incremental_inputs::write_got_plt): Use new visitor
  6239. classes.
  6240. (Sized_incr_relobj::Sized_incr_relobj): New constructor.
  6241. (Sized_incr_relobj::do_read_symbols): New function.
  6242. (Sized_incr_relobj::do_layout): New function.
  6243. (Sized_incr_relobj::do_layout_deferred_sections): New function.
  6244. (Sized_incr_relobj::do_add_symbols): New function.
  6245. (Sized_incr_relobj::do_should_include_member): New function.
  6246. (Sized_incr_relobj::do_for_all_global_symbols): New function.
  6247. (Sized_incr_relobj::do_for_all_local_got_entries): New function.
  6248. (Sized_incr_relobj::do_section_size): New function.
  6249. (Sized_incr_relobj::do_section_name): New function.
  6250. (Sized_incr_relobj::do_section_contents): New function.
  6251. (Sized_incr_relobj::do_section_flags): New function.
  6252. (Sized_incr_relobj::do_section_entsize): New function.
  6253. (Sized_incr_relobj::do_section_address): New function.
  6254. (Sized_incr_relobj::do_section_type): New function.
  6255. (Sized_incr_relobj::do_section_link): New function.
  6256. (Sized_incr_relobj::do_section_info): New function.
  6257. (Sized_incr_relobj::do_section_addralign): New function.
  6258. (Sized_incr_relobj::do_initialize_xindex): New function.
  6259. (Sized_incr_relobj::do_get_global_symbol_counts): New function.
  6260. (Sized_incr_relobj::do_read_relocs): New function.
  6261. (Sized_incr_relobj::do_gc_process_relocs): New function.
  6262. (Sized_incr_relobj::do_scan_relocs): New function.
  6263. (Sized_incr_relobj::do_count_local_symbols): New function.
  6264. (Sized_incr_relobj::do_finalize_local_symbols): New function.
  6265. (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
  6266. (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
  6267. (Sized_incr_relobj::do_relocate): New function.
  6268. (Sized_incr_relobj::do_set_section_offset): New function.
  6269. (Sized_incr_dynobj::Sized_incr_dynobj): New function.
  6270. (Sized_incr_dynobj::do_read_symbols): New function.
  6271. (Sized_incr_dynobj::do_layout): New function.
  6272. (Sized_incr_dynobj::do_add_symbols): New function.
  6273. (Sized_incr_dynobj::do_should_include_member): New function.
  6274. (Sized_incr_dynobj::do_for_all_global_symbols): New function.
  6275. (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
  6276. (Sized_incr_dynobj::do_section_size): New function.
  6277. (Sized_incr_dynobj::do_section_name): New function.
  6278. (Sized_incr_dynobj::do_section_contents): New function.
  6279. (Sized_incr_dynobj::do_section_flags): New function.
  6280. (Sized_incr_dynobj::do_section_entsize): New function.
  6281. (Sized_incr_dynobj::do_section_address): New function.
  6282. (Sized_incr_dynobj::do_section_type): New function.
  6283. (Sized_incr_dynobj::do_section_link): New function.
  6284. (Sized_incr_dynobj::do_section_info): New function.
  6285. (Sized_incr_dynobj::do_section_addralign): New function.
  6286. (Sized_incr_dynobj::do_initialize_xindex): New function.
  6287. (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
  6288. (make_sized_incremental_object): New function.
  6289. (Incremental_library::copy_unused_symbols): New function.
  6290. (Incremental_library::do_for_all_unused_symbols): New function.
  6291. * incremental.h (enum Incremental_input_flags): New type.
  6292. (class Incremental_checker): Remove.
  6293. (Incremental_input_entry::Incremental_input_entry): Add argument
  6294. serial number.
  6295. (Incremental_input_entry::arg_serial): New function.
  6296. (Incremental_input_entry::set_is_in_system_directory): New function.
  6297. (Incremental_input_entry::is_in_system_directory): New function.
  6298. (Incremental_input_entry::arg_serial_): New data member.
  6299. (Incremental_input_entry::is_in_system_directory_): New data member.
  6300. (class Script_info): Move here from script.h.
  6301. (Script_info::Script_info): Add filename parameter.
  6302. (Script_info::filename): New function.
  6303. (Script_info::filename_): New data member.
  6304. (Incremental_script_entry::Incremental_script_entry): Add argument
  6305. serial number.
  6306. (Incremental_object_entry::Incremental_object_entry): Likewise.
  6307. (Incremental_object_entry::add_input_section): Build list of input
  6308. sections with map to original shndx.
  6309. (Incremental_object_entry::get_input_section_index): New function.
  6310. (Incremental_object_entry::shndx_): New data member.
  6311. (Incremental_object_entry::name_key_): Rename; adjust all refs.
  6312. (Incremental_object_entry::sh_size_): Rename; adjust all refs.
  6313. (Incremental_archive_entry::Incremental_archive_entry): Add argument
  6314. serial number.
  6315. (Incremental_inputs::report_archive_begin): Likewise.
  6316. (Incremental_inputs::report_object): Likewise.
  6317. (Incremental_inputs::report_script): Likewise.
  6318. (class Incremental_global_symbol_reader): New class.
  6319. (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
  6320. and store flags and input file type.
  6321. (Incremental_input_entry_reader::arg_serial): New function.
  6322. (Incremental_input_entry_reader::type): Extract type from flags.
  6323. (Incremental_input_entry_reader::is_in_system_directory): New function.
  6324. (Incremental_input_entry_reader::get_input_section_count): Call
  6325. accessor function for type.
  6326. (Incremental_input_entry_reader::get_symbol_offset): Call accessor
  6327. function for type; adjust size of global symbol entry.
  6328. (Incremental_input_entry_reader::get_global_symbol_count): Call
  6329. accessor function for type.
  6330. (Incremental_input_entry_reader::get_object_count): Likewise.
  6331. (Incremental_input_entry_reader::get_object_offset): Likewise.
  6332. (Incremental_input_entry_reader::get_member_count): Likewise.
  6333. (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
  6334. (Incremental_input_entry_reader::get_member_offset): Likewise.
  6335. (Incremental_input_entry_reader::get_unused_symbol): Likewise.
  6336. (Incremental_input_entry_reader::Global_symbol_info): Remove.
  6337. (Incremental_input_entry_reader::get_global_symbol_info): Remove.
  6338. (Incremental_input_entry_reader::get_global_symbol_reader): New
  6339. function.
  6340. (Incremental_input_entry_reader::get_output_symbol_index): New
  6341. function.
  6342. (Incremental_input_entry_reader::type_): Remove.
  6343. (Incremental_input_entry_reader::flags_): New data member.
  6344. (Incremental_inputs_reader::input_file_offset): New function.
  6345. (Incremental_inputs_reader::input_file_index): New function.
  6346. (Incremental_inputs_reader::input_file): Call input_file_offset.
  6347. (Incremental_inputs_reader::input_file_at_offset): New function.
  6348. (Incremental_relocs_reader::get_r_type): Reformat.
  6349. (Incremental_relocs_reader::get_r_shndx): Reformat.
  6350. (Incremental_relocs_reader::get_r_offset): Reformat.
  6351. (Incremental_relocs_reader::data): New function.
  6352. (Incremental_binary::Incremental_binary): Initialize new data members.
  6353. (Incremental_binary::check_inputs): Add cmdline parameter.
  6354. (Incremental_binary::file_is_unchanged): Remove.
  6355. (Input_reader::arg_serial): New function.
  6356. (Input_reader::get_unused_symbol_count): New function.
  6357. (Input_reader::get_unused_symbol): New function.
  6358. (Input_reader::do_arg_serial): New function.
  6359. (Input_reader::do_get_unused_symbol_count): New function.
  6360. (Input_reader::do_get_unused_symbol): New function.
  6361. (Incremental_binary::input_file_count): New function.
  6362. (Incremental_binary::get_input_reader): Change signature to use
  6363. index instead of filename.
  6364. (Incremental_binary::file_has_changed): New function.
  6365. (Incremental_binary::get_input_argument): New function.
  6366. (Incremental_binary::get_library): New function.
  6367. (Incremental_binary::get_script_info): New function.
  6368. (Incremental_binary::init_layout): New function.
  6369. (Incremental_binary::reserve_layout): New function.
  6370. (Incremental_binary::output_file): New function.
  6371. (Incremental_binary::do_check_inputs): New function.
  6372. (Incremental_binary::do_file_is_unchanged): Remove.
  6373. (Incremental_binary::do_file_has_changed): New function.
  6374. (Incremental_binary::do_init_layout): New function.
  6375. (Incremental_binary::do_reserve_layout): New function.
  6376. (Incremental_binary::do_input_file_count): New function.
  6377. (Incremental_binary::do_get_input_reader): Change signature.
  6378. (Incremental_binary::input_args_map_): New data member.
  6379. (Incremental_binary::library_map_): New data member.
  6380. (Incremental_binary::script_map_): New data member.
  6381. (Sized_incremental_binary::Sized_incremental_binary): Initialize
  6382. new data members.
  6383. (Sized_incremental_binary::output_section): New function.
  6384. (Sized_incremental_binary::inputs_reader): Add const.
  6385. (Sized_incremental_binary::symtab_reader): Add const.
  6386. (Sized_incremental_binary::relocs_reader): Add const.
  6387. (Sized_incremental_binary::got_plt_reader): Add const.
  6388. (Sized_incremental_binary::get_symtab_view): New function.
  6389. (Sized_incremental_binary::Inputs_reader): New typedef.
  6390. (Sized_incremental_binary::Input_entry_reader): New typedef.
  6391. (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
  6392. (Sized_incremental_binary::do_file_is_unchanged): Remove.
  6393. (Sized_incremental_binary::do_file_has_changed): New function.
  6394. (Sized_incremental_binary::do_init_layout): New function.
  6395. (Sized_incremental_binary::do_reserve_layout): New function.
  6396. (Sized_input_reader::Inputs_reader): Remove.
  6397. (Sized_input_reader::Input_entry_reader): Remove.
  6398. (Sized_input_reader::do_arg_serial): New function.
  6399. (Sized_input_reader::do_get_unused_symbol_count): New function.
  6400. (Sized_input_reader::do_get_unused_symbol): New function.
  6401. (Sized_incremental_binary::do_input_file_count): New function.
  6402. (Sized_incremental_binary::do_get_input_reader): Change signature;
  6403. use index instead of filename.
  6404. (Sized_incremental_binary::section_map_): New data member.
  6405. (Sized_incremental_binary::input_entry_readers_): New data member.
  6406. (class Sized_incr_relobj): New class.
  6407. (class Sized_incr_dynobj): New class.
  6408. (make_sized_incremental_object): New function.
  6409. (class Incremental_library): New class.
  6410. * layout.cc (Free_list::num_lists): New static data member.
  6411. (Free_list::num_nodes): New static data member.
  6412. (Free_list::num_removes): New static data member.
  6413. (Free_list::num_remove_visits): New static data member.
  6414. (Free_list::num_allocates): New static data member.
  6415. (Free_list::num_allocate_visits): New static data member.
  6416. (Free_list::init): New function.
  6417. (Free_list::remove): New function.
  6418. (Free_list::allocate): New function.
  6419. (Free_list::dump): New function.
  6420. (Free_list::print_stats): New function.
  6421. (Layout_task_runner::run): Resize output file for incremental updates.
  6422. (Layout::Layout): Initialize new data members.
  6423. (Layout::set_incremental_base): New function.
  6424. (Layout::init_fixed_output_section): New function.
  6425. (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
  6426. incremental updates.
  6427. (Layout::create_gold_note): Do not create gold note section for
  6428. incremental updates.
  6429. (Layout::set_segment_offsets): Do not recalculate RELRO alignment
  6430. for incremental updates.
  6431. (Layout::set_section_offsets): For incremental updates, allocate space
  6432. from free list.
  6433. (Layout::create_symtab_sections): Layout with offsets relative to
  6434. start of section; for incremental updates, allocate space from free
  6435. list.
  6436. (Layout::create_shdrs): For incremental updates, allocate space from
  6437. free list.
  6438. (Layout::finish_dynamic_section): For incremental updates, do not
  6439. check --as-needed (fixed in subsequent patch).
  6440. * layout.h (class Free_list): New class.
  6441. (Layout::set_incremental_base): New function.
  6442. (Layout::incremental_base): New function.
  6443. (Layout::init_fixed_output_section): New function.
  6444. (Layout::allocate): New function.
  6445. (Layout::incremental_base_): New data member.
  6446. (Layout::free_list_): New data member.
  6447. * main.cc (main): Print Free_list statistics.
  6448. * object.cc (Relobj::finalize_incremental_relocs): Add
  6449. clear_counts parameter; clear counts only when clear_counts is set.
  6450. (Sized_relobj::Sized_relobj): Initialize new base class.
  6451. (Sized_relobj::do_layout): Don't report special sections.
  6452. (Sized_relobj::do_for_all_local_got_entries): New function.
  6453. (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
  6454. symtab_off to all symbol table offsets.
  6455. (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
  6456. * object.h (class Got_offset_list): Move to top of file.
  6457. (Object::Object): Allow case where input_file == NULL.
  6458. (Object::~Object): Likewise.
  6459. (Object::input_file): Assert that input_file != NULL.
  6460. (Object::lock): Allow case where input_file == NULL.
  6461. (Object::unlock): Likewise.
  6462. (Object::is_locked): Likewise.
  6463. (Object::token): Likewise.
  6464. (Object::release): Likewise.
  6465. (Object::is_incremental): New function.
  6466. (Object::get_mtime): New function.
  6467. (Object::for_all_local_got_entries): New function.
  6468. (Object::clear_view_cache_marks): Allow case where input_file == NULL.
  6469. (Object::set_is_in_system_directory): New function.
  6470. (Object::is_in_system_directory): New function.
  6471. (Object::do_is_incremental): New function.
  6472. (Object::do_get_mtime): New function.
  6473. (Object::do_for_all_local_got_entries): New function.
  6474. (Object::is_in_system_directory_): New data member.
  6475. (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
  6476. (class Sized_relobj_base): New class.
  6477. (class Sized_relobj): Derive from Sized_relobj_base.
  6478. (class Sized_relobj::Symbols): Redeclare from base class.
  6479. (class Sized_relobj::local_got_offset_list): Remove.
  6480. (class Sized_relobj::Output_sections): Redeclare from base class.
  6481. (class Sized_relobj::do_for_all_local_got_entries): New function.
  6482. (class Sized_relobj::write_local_symbols): Add offset parameter.
  6483. (class Sized_relobj::local_symbol_offset_): Update comment.
  6484. (class Sized_relobj::local_dynsym_offset_): Update comment.
  6485. * options.cc (Input_arguments::add_file): Remove const.
  6486. * options.h (Input_file_argument::Input_file_argument):
  6487. Initialize arg_serial_ (all constructors).
  6488. (Input_file_argument::set_arg_serial): New function.
  6489. (Input_file_argument::arg_serial): New function.
  6490. (Input_file_argument::arg_serial_): New data member.
  6491. (Input_arguments::Input_arguments): Initialize file_count_.
  6492. (Input_arguments::add_file): Remove const.
  6493. (Input_arguments::number_of_input_files): New function.
  6494. (Input_arguments::file_count_): New data member.
  6495. (Command_line::number_of_input_files): Call
  6496. Input_arguments::number_of_input_files.
  6497. * output.cc (Output_segment_headers::Output_segment_headers):
  6498. Set current size.
  6499. (Output_section::Input_section::current_data_size): New function.
  6500. (Output_section::Output_section): Initialize new data members.
  6501. (Output_section::add_input_section): Don't do merge sections for
  6502. an incremental link; allocate space from free list for an
  6503. incremental update.
  6504. (Output_section::add_output_section_data): Allocate space from
  6505. free list for an incremental update.
  6506. (Output_section::update_data_size): New function.
  6507. (Output_section::set_fixed_layout): New function.
  6508. (Output_section::reserve): New function.
  6509. (Output_segment::set_section_addresses): Remove const.
  6510. (Output_segment::set_section_list_addresses): Remove const; allocate
  6511. space from free list for an incremental update.
  6512. (Output_segment::set_offset): Adjust size of RELRO segment for an
  6513. incremental update.
  6514. * output.h (Output_data::current_data_size): Move here from
  6515. child classes.
  6516. (Output_data::pre_finalize_data_size): New function.
  6517. (Output_data::update_data_size): New function.
  6518. (Output_section_headers::update_data_size): new function.
  6519. (Output_section_data_build::current_data_size): Move to Output_data.
  6520. (Output_data_strtab::update_data_size): New function.
  6521. (Output_section::current_data_size): Move to Output_data.
  6522. (Output_section::set_fixed_layout): New function.
  6523. (Output_section::has_fixed_layout): New function.
  6524. (Output_section::reserve): New function.
  6525. (Output_section::update_data_size): New function.
  6526. (Output_section::has_fixed_layout_): New data member.
  6527. (Output_section::free_list_): New data member.
  6528. (Output_segment::set_section_addresses): Remove const.
  6529. (Output_segment::set_section_list_addresses): Remove const.
  6530. * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
  6531. New function.
  6532. * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
  6533. New function.
  6534. * readsyms.cc (Read_symbols::do_read_symbols): Add library
  6535. parameter when calling Add_symbols constructor; store argument
  6536. serial number for members of a lib group.
  6537. (Add_symbols::locks): Allow case where token == NULL.
  6538. (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
  6539. (Read_member::~Read_member): New function.
  6540. (Read_member::is_runnable): New function.
  6541. (Read_member::locks): New function.
  6542. (Read_member::run): New function.
  6543. (Check_script::~Check_script): New function.
  6544. (Check_script::is_runnable): New function.
  6545. (Check_script::locks): New function.
  6546. (Check_script::run): New function.
  6547. (Check_library::~Check_library): New function.
  6548. (Check_library::is_runnable): New function.
  6549. (Check_library::locks): New function.
  6550. (Check_library::run): New function.
  6551. * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
  6552. (Add_symbols::library_): New data member.
  6553. (class Read_member): New class.
  6554. (class Check_script): New class.
  6555. (class Check_library): New class.
  6556. * reloc.cc (Read_relocs::is_runnable): Allow case where
  6557. token == NULL.
  6558. (Read_relocs::locks): Likewise.
  6559. (Scan_relocs::locks): Likewise.
  6560. (Relocate_task::locks): Likewise.
  6561. (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
  6562. to clear counters.
  6563. (Sized_relobj::incremental_relocs_scan): Fix comment.
  6564. (Sized_relobj::do_relocate): Pass output file offset to
  6565. write_local_symbols.
  6566. (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
  6567. from class declaration.
  6568. * script.cc (read_input_script): Allocate Script_info; pass
  6569. argument serial number to report_script.
  6570. * script.h (class Script_info): Move to incremental.h.
  6571. * symtab.cc (Symbol_table::add_from_incrobj): New function.
  6572. * symtab.h (Symbol_table::add_from_incrobj): New function.
  6573. (Symbol_table::set_file_offset): New function.
  6574. 2011-04-05 Cary Coutant <ccoutant@google.com>
  6575. * incremental-dump.cc (dump_incremental_inputs): Change signature
  6576. to take a Sized_incremental_binary; change caller. Use readers
  6577. in Sized_incremental_binary.
  6578. * incremental.cc
  6579. (Sized_incremental_binary::find_incremental_inputs_sections):
  6580. Rename do_find_incremental_inputs_sections to this.
  6581. (Sized_incremental_binary::setup_readers): New function.
  6582. (Sized_incremental_binary::do_check_inputs): Check
  6583. has_incremental_info_ flag; move setup code to setup_readers;
  6584. use input readers.
  6585. (Sized_incremental_binary::do_file_is_unchanged): New function.
  6586. (Sized_incremental_binary::do_get_input_reader): New function.
  6587. * incremental.h (class Incremental_binary): Move to end of file.
  6588. (Incremental_binary::file_is_unchanged): New function.
  6589. (Incremental_binary::do_file_is_unchanged): New function.
  6590. (Incremental_binary::Input_reader): New class.
  6591. (Incremental_binary::get_input_reader): New function.
  6592. (class Sized_incremental_binary): Move to end of file.
  6593. (Sized_incremental_binary::Sized_incremental_binary): Setup the
  6594. input section reader classes.
  6595. (Sized_incremental_binary::has_incremental_info): New function.
  6596. (Sized_incremental_binary::inputs_reader): New function.
  6597. (Sized_incremental_binary::symtab_reader): New function.
  6598. (Sized_incremental_binary::relocs_reader): New function.
  6599. (Sized_incremental_binary::got_plt_reader): New function.
  6600. (Sized_incremental_binary::do_file_is_unchanged): New function.
  6601. (Sized_incremental_binary::Sized_input_reader): New class.
  6602. (Sized_incremental_binary::get_input_reader): New function.
  6603. (Sized_incremental_binary::find_incremental_inputs_sections):
  6604. Rename do_find_incremental_inputs_sections to this.
  6605. (Sized_incremental_binary::setup_readers): New function.
  6606. (Sized_incremental_binary::has_incremental_info_): New data member.
  6607. (Sized_incremental_binary::inputs_reader_): New data member.
  6608. (Sized_incremental_binary::symtab_reader_): New data member.
  6609. (Sized_incremental_binary::relocs_reader_): New data member.
  6610. (Sized_incremental_binary::got_plt_reader_): New data member.
  6611. (Sized_incremental_binary::current_input_file_): New data member.
  6612. 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
  6613. PR gold/12640
  6614. * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
  6615. violation.
  6616. 2011-03-30 Cary Coutant <ccoutant@google.com>
  6617. * archive.cc (Archive::include_member): Adjust call to report_object.
  6618. (Add_archive_symbols::run): Add script_info to call to
  6619. report_archive_begin.
  6620. (Lib_group::include_member): Adjust call to report_object.
  6621. (Add_lib_group_symbols::run): Adjust call to report_object.
  6622. * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
  6623. blocks. Add object count for script input files.
  6624. * incremental.cc (Incremental_inputs::report_archive_begin): Add
  6625. script_info parameter; change all callers.
  6626. (Incremental_inputs::report_object): Add script_info parameter;
  6627. change all callers.
  6628. (Incremental_inputs::report_script): Store backpointer to
  6629. incremental info entry.
  6630. (Output_section_incremental_inputs::set_final_data_size): Record
  6631. additional information for scripts.
  6632. (Output_section_incremental_inputs::write_info_blocks): Likewise.
  6633. * incremental.h (Incremental_script_entry::add_object): New function.
  6634. (Incremental_script_entry::get_object_count): New function.
  6635. (Incremental_script_entry::get_object): New function.
  6636. (Incremental_script_entry::objects_): New data member; adjust
  6637. constructor.
  6638. (Incremental_inputs::report_archive_begin): Add script_info parameter.
  6639. (Incremental_inputs::report_object): Add script_info parameter.
  6640. (Incremental_inputs_reader::get_object_count): New function.
  6641. (Incremental_inputs_reader::get_object_offset): New function.
  6642. * options.cc (Input_arguments::add_file): Return reference to
  6643. new input argument.
  6644. * options.h (Input_argument::set_script_info): New function.
  6645. (Input_argument::script_info): New function.
  6646. (Input_argument::script_info_): New data member; adjust all
  6647. constructors.
  6648. (Input_file_group::add_file): Return reference to new input argument.
  6649. (Input_file_lib::add_file): Likewise.
  6650. (Input_arguments::add_file): Likewise.
  6651. * readsyms.cc (Add_symbols::run): Adjust call to report_object.
  6652. * script.cc (Parser_closure::Parser_closure): Add script_info
  6653. parameter; adjust all callers.
  6654. (Parser_closure::script_info): New function.
  6655. (Parser_closure::script_info_): New data member.
  6656. (read_input_script): Report scripts earlier to incremental info.
  6657. (script_add_file): Set script_info in Input_argument.
  6658. (script_add_library): Likewise.
  6659. * script.h (Script_options::Script_info): Rewrite class.
  6660. 2011-03-29 Cary Coutant <ccoutant@google.com>
  6661. * archive.cc (Library_base::should_include_member): Move
  6662. method here from class Archive.
  6663. (Archive::Archive): Initialize base class.
  6664. (Archive::should_include_member): Move to base class.
  6665. (Archive::do_for_all_unused_symbols): New function.
  6666. (Add_archive_symbols::run): Remove redundant access to
  6667. incremental_inputs.
  6668. (Lib_group::Lib_group): Initialize base class.
  6669. (Lib_group::do_filename): New function.
  6670. (Lib_group::include_member): Pass pointer to Lib_group to
  6671. report_object.
  6672. (Lib_group::do_for_all_unused_symbols): New function.
  6673. (Add_lib_group_symbols::run): Report archive information for
  6674. incremental links.
  6675. * archive.h (class Library_base): New base class.
  6676. (class Archive): Derive from Library_base.
  6677. (Archive::filename): Move to base class.
  6678. (Archive::set_incremental_info): Likewise.
  6679. (Archive::incremental_info): Likewise.
  6680. (Archive::Should_include): Likewise.
  6681. (Archive::should_include_member): Likewise.
  6682. (Archive::Armap_entry): Remove.
  6683. (Archive::Unused_symbol_iterator): Remove.
  6684. (Archive::unused_symbols_begin): Remove.
  6685. (Archive::unused_symbols_end): Remove.
  6686. (Archive::do_filename): New function.
  6687. (Archive::do_get_mtime): New function.
  6688. (Archive::do_for_all_unused_symbols): New function.
  6689. (Archive::task_): Move to base class.
  6690. (Archive::incremental_info_): Likewise.
  6691. (class Lib_group): Derive from Library_base.
  6692. (Lib_group::do_filename): New function.
  6693. (Lib_group::do_get_mtime): New function.
  6694. (Lib_group::do_for_all_unused_symbols): New function.
  6695. (Lib_group::task_): Move to base class.
  6696. * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
  6697. function.
  6698. * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
  6699. function.
  6700. * incremental.cc (Incremental_inputs::report_archive_begin):
  6701. Use Library_base; call library's get_mtime; add incremental inputs
  6702. entry before members.
  6703. (class Unused_symbol_visitor): New class.
  6704. (Incremental_inputs::report_archive_end): Use Library_base; use
  6705. visitor class to record unused symbols; don't add incremental inputs
  6706. entry after members.
  6707. (Incremental_inputs::report_object): Use Library_base.
  6708. * incremental.h
  6709. (Incremental_archive_entry::Incremental_archive_entry): Remove
  6710. unused Archive parameter.
  6711. (Incremental_inputs::report_archive_begin): Use Library_base.
  6712. (Incremental_inputs::report_archive_end): Likewise.
  6713. (Incremental_inputs::report_object): Likewise.
  6714. * object.cc (Sized_relobj::do_for_all_global_symbols): New
  6715. function.
  6716. * object.h (Object::for_all_global_symbols): New function.
  6717. (Object::do_for_all_global_symbols): New function.
  6718. (Sized_relobj::do_for_all_global_symbols): New function.
  6719. * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
  6720. function.
  6721. * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
  6722. function.
  6723. 2011-03-27 Ian Lance Taylor <iant@google.com>
  6724. * archive.cc (Archive::interpret_header): Return -1 if something
  6725. goes wrong. Change callers accordingly.
  6726. 2011-03-25 Cary Coutant <ccoutant@google.com>
  6727. * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
  6728. * testsuite/Makefile.in: Regenerate.
  6729. 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
  6730. * plugin.cc (get_view): New.
  6731. (Plugin::load): Pass get_view to the plugin.
  6732. (Plugin_manager::get_view): New.
  6733. 2011-03-21 Ian Lance Taylor <iant@google.com>
  6734. * testsuite/final_layout.sh: Rewrite to not use dc.
  6735. * testsuite/relro_test.sh: Fail if dc is not present.
  6736. 2011-03-21 Sriraman Tallam <tmsriram@google.com>
  6737. * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
  6738. Change == to -eq.
  6739. * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
  6740. * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
  6741. Change == to -eq.
  6742. * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
  6743. * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
  6744. 2011-03-14 Ian Lance Taylor <iant@google.com>
  6745. * script-sections.cc (Sort_output_sections::script_compare):
  6746. Rename from is_before, change return type.
  6747. (Sort_output_sections::operator()): Adjust accordingly.
  6748. 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
  6749. PR gold/12572
  6750. * testsuite/odr_violation2.cc: Add comment to make all error line
  6751. numbers double digits.
  6752. * testsuite/debug_msg.sh: Adjust expected errors.
  6753. 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
  6754. * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
  6755. but mark earlier ones as non-canonical
  6756. (offset_to_iterator): Update search target and example
  6757. (do_addr2line): Return extra lines in a vector*
  6758. (format_file_lineno): Extract from do_addr2line
  6759. (one_addr2line): Add vector* out-param
  6760. * dwarf_reader.h (Offset_to_lineno_entry): New field recording
  6761. when a lineno entry appeared last for its instruction
  6762. (Dwarf_line_info): Add vector* out-param
  6763. * object.cc (Relocate_info): Pass NULL for the vector* out-param
  6764. * symtab.cc (Odr_violation_compare): Include the lineno in the
  6765. comparison again.
  6766. (linenos_from_loc): New. Combine the canonical line for an
  6767. address with its other lines.
  6768. (True_if_intersect): New. Helper functor to make
  6769. std::set_intersection a query.
  6770. (detect_odr_violations): Compare sets of lines instead of just
  6771. one line for each function. This became less deterministic, but
  6772. has fewer false positives.
  6773. * symtab.h: Declarations.
  6774. * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
  6775. mix an optimized and non-optimized object in the same binary
  6776. (odr_violation2.so): Same.
  6777. * testsuite/Makefile.in: Regenerate from Makefile.am.
  6778. * testsuite/debug_msg.cc (main): Make OdrDerived classes.
  6779. * testsuite/debug_msg.sh: Update line numbers and add
  6780. assertions.
  6781. * testsuite/odr_violation1.cc: Use OdrDerived, in a
  6782. non-optimized context.
  6783. * testsuite/odr_violation2.cc: Make sure Ordering::operator()
  6784. isn't inlined, and use OdrDerived in an optimized context.
  6785. * testsuite/odr_header1.h: Defines OdrDerived, where
  6786. optimization will change the
  6787. first-instruction-in-the-destructor's file and line number.
  6788. * testsuite/odr_header2.h: Defines OdrBase.
  6789. 2011-03-09 Ian Lance Taylor <iant@google.com>
  6790. * fileread.cc (File_read::clear_views): Don't delete the whole
  6791. file view.
  6792. 2011-03-08 Ian Lance Taylor <iant@google.com>
  6793. PR gold/12525
  6794. * fileread.cc: #include <climits>.
  6795. (GOLD_IOV_MAX): Define.
  6796. (File_read::read_multiple): Limit number of entries by iov_max.
  6797. * fileread.h (class File_read): Always set max_readv_entries to
  6798. 128.
  6799. 2011-03-07 Ian Lance Taylor <iant@google.com>
  6800. PR gold/12525
  6801. * options.h (class General_options): Add -dy and -dn.
  6802. 2011-03-02 Cary Coutant <ccoutant@google.com>
  6803. * testsuite/script_test_9.t: Add TLS segment.
  6804. 2011-03-02 Simon Baldwin <simonb@google.com>
  6805. * configure.ac: Add check for gnu_indirect_function support in
  6806. the toolchain building binutils.
  6807. * configure: Rebuild.
  6808. 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
  6809. * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
  6810. plugin only symbols.
  6811. (Symbol_table::sized_finalize_symbol) Mark symbol only present
  6812. in plugin files as not needed in the symbol table.
  6813. 2011-02-11 Sriraman Tallam <tmsriram@google.com>
  6814. * output.cc (Output_section::add_input_section): Delay fill
  6815. generation for section ordering.
  6816. 2011-02-09 Ian Lance Taylor <iant@google.com>
  6817. PR gold/12316
  6818. * object.h (class Sized_relobj): Remove clear_local_symbols.
  6819. * reloc.cc (Sized_relobj::do_relocate): Don't call
  6820. clear_local_symbols.
  6821. 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
  6822. * plugin.cc (is_visible_from_outside): Return true for symbols
  6823. in the -u option.
  6824. 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
  6825. * symtab.cc (Odr_violation_compare::operator()): Sort by just the
  6826. filename.
  6827. 2011-02-02 Sriraman Tallam <tmsriram@google.com>
  6828. * icf.h (is_section_foldable_candidate): Change type of parameter
  6829. to std::string.
  6830. * icf.cc (Icf::find_identical_sections): Change type of local variable
  6831. section_name to be std::string.
  6832. (is_function_ctor_or_dtor): Change type of parameter to std::string.
  6833. 2011-01-25 Ian Lance Taylor <iant@google.com>
  6834. * script.cc (script_add_extern): Rewrite to use
  6835. add_symbol_reference.
  6836. 2011-01-25 Doug Kwan <dougkwan@google.com>
  6837. * icf.cc (get_section_contents): Always lock section's object.
  6838. 2011-01-24 Ian Lance Taylor <iant@google.com>
  6839. * options.h (class General_options): Accept
  6840. --no-detect-odr-violations.
  6841. 2011-01-24 Ian Lance Taylor <iant@google.com>
  6842. * version.cc (version_string): Bump to 1.11.
  6843. 2011-01-24 Ian Lance Taylor <iant@google.com>
  6844. * plugin.cc (class Plugin_rescan): Define new class.
  6845. (Plugin_manager::claim_file): Set any_claimed_.
  6846. (Plugin_manager::save_archive): New function.
  6847. (Plugin_manager::save_input_group): New function.
  6848. (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
  6849. necessary.
  6850. (Plugin_manager::new_undefined_symbol): New function.
  6851. (Plugin_manager::rescan): New function.
  6852. (Plugin_manager::rescannable_defines): New function.
  6853. (Plugin_manager::add_input_file): Set any_added_.
  6854. * plugin.h (class Plugin_manager): define new fields rescannable_,
  6855. undefined_symbols_, any_claimed_, and any_added_. Declare
  6856. Plugin_rescan as friend. Declare new functions.
  6857. (Plugin_manager::Rescannable): Define type.
  6858. (Plugin_manager::Rescannable_list): Define type.
  6859. (Plugin_manager::Undefined_symbol_list): Define type.
  6860. (Plugin_manager::Plugin_manager): Initialize new fields.
  6861. * archive.cc (Archive::defines_symbol): New function.
  6862. (Add_archive_symbols::run): Pass archive to plugins if any.
  6863. * archive.h (class Archive): Declare defines_symbol.
  6864. * readsyms.cc (Input_group::~Input_group): New function.
  6865. (Finish_group::run): Pass input_group to plugins if any.
  6866. * readsyms.h (class Input_group): Declare destructor.
  6867. * symtab.cc (add_from_object): Pass undefined symbol to plugins if
  6868. any.
  6869. 2011-01-10 Ian Lance Taylor <iant@google.com>
  6870. * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
  6871. section as relro.
  6872. (Layout::set_segment_offsets): Reset increase_relro before calling
  6873. set_section_addresses a second time.
  6874. 2011-01-04 Cary Coutant <ccoutant@google.com>
  6875. * script-sections.cc (Sort_output_sections::operator()): Sort TLS
  6876. sections before NOBITS sections.
  6877. 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
  6878. * version.cc (print_version): Update copyright to 2011.
  6879. 2010-12-23 Cary Coutant <ccoutant@google.com>
  6880. * output.h (Output_data_reloc::add_output_section): Pass OD instead
  6881. of OS to this->add. Add OD parameter to second form of the function.
  6882. 2010-12-20 Ian Lance Taylor <iant@google.com>
  6883. * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
  6884. second of two consecutive entries with same offset.
  6885. 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  6886. * testsuite/Makefile.am (ifuncmain2static_LDADD)
  6887. (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
  6888. (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
  6889. to avoid unneeded links against $(LDADD).
  6890. * testsuite/Makefile.in: Regenerate.
  6891. 2010-12-15 Ian Lance Taylor <iant@google.com>
  6892. PR gold/12324
  6893. * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
  6894. for R_X86_64_32 and R_X86_64_PC32.
  6895. * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
  6896. ver_matching_def_pic.o.
  6897. (ver_matching_def_pic.o): New target.
  6898. 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  6899. * fileread.cc (file_counts_lock, file_counts_initialize_lock)
  6900. (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
  6901. Move definition before File_read::View member definitions.
  6902. (File_read::View::~View): Initialize and hold lock before
  6903. updating current_mapped_bytes.
  6904. 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  6905. * dwarf_reader.cc: Remove outdated comment.
  6906. * gold-threads.cc: Fix typo in error message.
  6907. * archive.cc: Fix typos in comments.
  6908. * archive.h: Likewise.
  6909. * arm-reloc-property.cc: Likewise.
  6910. * arm-reloc-property.h: Likewise.
  6911. * arm-reloc.def: Likewise.
  6912. * arm.cc: Likewise.
  6913. * attributes.h: Likewise.
  6914. * cref.cc: Likewise.
  6915. * ehframe.cc: Likewise.
  6916. * fileread.h: Likewise.
  6917. * gold.h: Likewise.
  6918. * i386.cc: Likewise.
  6919. * icf.cc: Likewise.
  6920. * incremental.h: Likewise.
  6921. * int_encoding.cc: Likewise.
  6922. * layout.h: Likewise.
  6923. * main.cc: Likewise.
  6924. * merge.h: Likewise.
  6925. * object.cc: Likewise.
  6926. * object.h: Likewise.
  6927. * options.cc: Likewise.
  6928. * readsyms.cc: Likewise.
  6929. * reduced_debug_output.cc: Likewise.
  6930. * reloc.cc: Likewise.
  6931. * script-sections.cc: Likewise.
  6932. * sparc.cc: Likewise.
  6933. * symtab.h: Likewise.
  6934. * target-reloc.h: Likewise.
  6935. * target.cc: Likewise.
  6936. * target.h: Likewise.
  6937. * timer.cc: Likewise.
  6938. * timer.h: Likewise.
  6939. * x86_64.cc: Likewise.
  6940. 2010-12-09 Cary Coutant <ccoutant@google.com>
  6941. * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
  6942. stack.
  6943. * layout.h (Layout::layout_gnu_stack): Add pointer to Object
  6944. parameter; change all callers.
  6945. * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
  6946. * options.h (warn_execstack): New option.
  6947. 2010-12-07 Doug Kwan <dougkwan@google.com>
  6948. * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
  6949. like function call relocations.
  6950. 2010-12-07 Ian Lance Taylor <iant@google.com>
  6951. * archive.cc (Archive::get_elf_object_for_member): Permit
  6952. punconfigured to be NULL.
  6953. (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
  6954. (Archive::include_member): Pass NULL to get_elf_object_for_member
  6955. if we searched for the archive and this is the first included
  6956. object.
  6957. 2010-12-01 Ian Lance Taylor <iant@google.com>
  6958. * dwarf_reader.h (class Sized_dwarf_line_info): Add
  6959. track_relocs_type_ field.
  6960. * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
  6961. Set track_relocs_type_.
  6962. (Sized_dwarf_line_info::process_one_opcode): Ignore the section
  6963. contents when using RELA relocs.
  6964. (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
  6965. reloc_map_.
  6966. * reloc.cc (Track_relocs::next_addend): New function.
  6967. * reloc.h (class Track_relocs): Declare next_addend.
  6968. 2010-12-01 Ian Lance Taylor <iant@google.com>
  6969. * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
  6970. virtual destructor.
  6971. 2010-12-01 Ian Lance Taylor <iant@google.com>
  6972. * README: Update compilers known to work and fail.
  6973. 2010-11-23 Matthias Klose <doko@ubuntu.com>
  6974. * configure.in: For --enable-gold, handle value `default' instead of
  6975. `both*'. Always install ld as ld.bfd, install as ld if gold is
  6976. not the default.
  6977. * configure: Regenerate.
  6978. 2010-11-18 Doug Kwan <dougkwan@google.com>
  6979. * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
  6980. and right_alignment to be zero. Store result alignment only if it is
  6981. greater than existing alignment.
  6982. 2010-11-16 Cary Coutant <ccoutant@google.com>
  6983. PR gold/12220
  6984. * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
  6985. Check for ".zdebug_line".
  6986. 2010-11-16 Doug Kwan <dougkwan@google.com>
  6987. Cary Coutant <ccoutant@google.com>
  6988. * output.h (Output_segment::set_section_addresses): Pass increase_relro
  6989. by reference; adjust all callers.
  6990. * output.cc (Output_segment::set_section_addresses): Adjust references
  6991. to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
  6992. list is empty.
  6993. (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
  6994. end at page boundary.
  6995. 2010-11-16 Cary Coutant <ccoutant@google.com>
  6996. PR gold/12220
  6997. * layout.cc (Layout::choose_output_section): Transform names of
  6998. compressed sections even when using a script with a SECTIONS clause.
  6999. (Layout::output_section_name): Remove code to transform
  7000. compressed debug section names.
  7001. * output.cc (Output_section::add_input_section): Use uncompressed
  7002. section size when tracking input sections.
  7003. 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
  7004. * symtab.h (Symbol::NON_PIC_REF): Remove.
  7005. (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
  7006. (Symbol::FUNCTION_CALL): Renumber. Reword comment.
  7007. (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
  7008. (Symbol::use_plt_offset): Take a flags argument and pass it
  7009. directly to needs_dynamic_reloc. Restrict check for undefined
  7010. weak symbols to function calls.
  7011. * arm.cc (Target_arm::Scan::get_reference_flags): New function.
  7012. (Target_arm::Scan::global): Use it.
  7013. (Target_arm::Scan::scan_reloc_for_stub): Likewise.
  7014. (Target_arm::Relocate::relocate): Likewise.
  7015. (Target_arm::Relocate::should_apply_static_reloc): Replace flags
  7016. parameter with an r_type parameter. Use get_reference_flags
  7017. to get the flags.
  7018. (Target_arm::Relocate::relocate): Update accordingly.
  7019. * i386.cc (Target_i386::Scan::get_reference_flags): New function.
  7020. (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
  7021. (Target_i386::Scan::global): Likewise.
  7022. (Target_i386::Relocate::relocate): Likewise.
  7023. (Target_i386::Relocate::should_apply_static_reloc): Replace flags
  7024. parameter with an r_type parameter. Use get_reference_flags
  7025. to get the flags.
  7026. (Target_i386::Relocate::relocate): Update accordingly.
  7027. * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
  7028. (Target_powerpc::Scan::global): Use it.
  7029. (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
  7030. (Target_powerpc::Relocate::relocate): Likewise.
  7031. * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
  7032. (Target_sparc::Scan::global): Use it.
  7033. (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
  7034. (Target_sparc::Relocate::relocate): Likewise.
  7035. * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
  7036. (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
  7037. (Target_x86_64::Scan::global): Likewise.
  7038. (Target_x86_64::Relocate::relocate): Likewise.
  7039. 2010-11-08 Doug Kwan <dougkwan@google.com>
  7040. Cary Coutant <ccoutant@google.com>
  7041. * arm.cc (Arm_exidx_merge_section::build_contents): New method.
  7042. (Arm_exidx_merge_section::section_contents_): New data member.
  7043. (Arm_input_section::Arm_input_section): Initialize original_contents_.
  7044. (Arm_input_section::~Arm_input_section): De-allocate memory.
  7045. (Arm_input_section::original_contents_): New data member.
  7046. (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
  7047. in parameters instead of calling Object::section_contents without
  7048. locking.
  7049. (Arm_output_section::group_section): New parameter TASK. Pass it
  7050. to callees that need locking objects.
  7051. (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
  7052. to lock EXIDX input sections. Fix a formatting issue. Call
  7053. Arm_exidx_merged_section::build_contents to create merged section
  7054. contents.
  7055. (Arm_output_section::create_stub_group): New parameter TASK. Use it
  7056. to lock object of stub table owner.
  7057. (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
  7058. TEXT_SIZE to initialize data member TEXT_SIZE_.
  7059. (Arm_exidx_input_section::addralign): Fix typo in comment.
  7060. (Arm_exidx_input_section::text_size): New method.
  7061. (Target_arm::do_relax): New parameter TASK. Pass it to callees
  7062. that require locking objects. Lock objects before scanning for stubs
  7063. and updating local symbols.
  7064. (Arm_input_section<big_endian>::init): Copy contents of original
  7065. input section.
  7066. (Arm_input_section<big_endian>::do_write): Use saved contents of
  7067. original input section instead of calling Object::section_contents
  7068. without locking.
  7069. (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
  7070. size without calling Object::section_size().
  7071. (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
  7072. for size. Allocate a buffer for merged EXIDX entries.
  7073. (Arm_exidx_merged_section::build_contents): New method.
  7074. (Arm_exidx_merged_section::do_write): Move merge section contents
  7075. building code to Arm_exidx_merged_section::build_contetns. Write
  7076. out contetns in buffer instead of building it on the fly.
  7077. (Arm_relobj::make_exidx_input_section): Also pass text section size
  7078. to Arm_exidx_input_section constructor.
  7079. (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
  7080. (Arm_dynobj::do_read_symbols): Fix memory leak.
  7081. * layout.cc (Layout::finalize): Pass TASK to Target::relax().
  7082. * target.h: (class Task): Add forward declaration.
  7083. (Target::relax): Add new parameter TASK and pass it to
  7084. Target::do_relax().
  7085. (Target::do_relax):: New parameter TASK. Fix a formatting issue.
  7086. 2010-11-05 Cary Coutant <ccoutant@google.com>
  7087. PR gold/10708
  7088. * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
  7089. object when reading from the file.
  7090. * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
  7091. second layout pass.
  7092. * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
  7093. when reading section contents.
  7094. (get_section_contents): Likewise.
  7095. (icf::find_identical_sections): Likewise.
  7096. * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
  7097. object when reading from the file.
  7098. * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
  7099. the object when doing deferred section layout.
  7100. 2010-11-03 Nick Clifton <nickc@redhat.com>
  7101. PR gold/12001
  7102. * script.h (class Symbol_assignment: name): New member. Returns
  7103. the name of the symbol.
  7104. * scrfipt.cc (Script_options::is_pending_assignment): New member.
  7105. Returns true if the given symbol name is on the list of
  7106. assignments wating to be processed.
  7107. * archive.cc (should_incldue_member): If the symbol is undefined,
  7108. check to see if it is on the list of symbols pending assignment.
  7109. 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
  7110. * script-sections.cc (Script_sections::find_memory_region): Check
  7111. for a NULL output section pointer.
  7112. 2010-10-29 Doug Kwan <dougkwan@google.com>
  7113. * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
  7114. Output_section::add_relaxed_input_section.
  7115. * output.cc (Output_section::add_relaxed_input_section): Add new
  7116. arguments LAYOUT and NAME. Set section order index.
  7117. (Output_section::convert_input_sections_in_list_to_relaxed_sections):
  7118. Copy section order index.
  7119. * output.h (Output_section::add_relaxed_input_section): Add new
  7120. arguments LAYOUT and NAME.
  7121. 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  7122. * testsuite/Makefile.am: Move gcctestdir/ld rule to
  7123. NATIVE_OR_CROSS_LINKER.
  7124. * testsuite/Makefile.in: Regenerate.
  7125. 2010-10-20 Doug Kwan <dougkwan@google.com>
  7126. * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
  7127. without SHF_LINK_ORDER flags.
  7128. * layout.cc (Layout::choose_output_section): Do not filter
  7129. SHF_LINK_ORDER flag in a relocatable link.
  7130. 2010-10-17 Cary Coutant <ccoutant@google.com>
  7131. * output.h (Output_segment::set_section_addresses): Change function
  7132. signature. Update all callers.
  7133. * output.cc (Output_segment::is_first_section_relro): Ignore TLS
  7134. sections.
  7135. (Output_segment::set_section_addresses): Align after last TLS
  7136. section. Add padding before last relro section instead of after.
  7137. 2010-10-17 Doug Kwan <dougkwan@google.com>
  7138. * gold/arm.cc (Target_arm::got_section): Use correct order and set
  7139. GOT output section to be writable.
  7140. 2010-10-14 Cary Coutant <ccoutant@google.com>
  7141. * debug.h (DEBUG_INCREMENTAL): New flag.
  7142. (debug_string_to_enum): Add DEBUG_INCREMENTAL).
  7143. * gold.cc (queue_initial_tasks): Check parameters for incremental link
  7144. mode.
  7145. * incremental.cc (report_command_line): Ignore all forms of
  7146. --incremental.
  7147. * layout.cc (Layout::Layout): Check parameters for incremental link
  7148. mode.
  7149. * options.cc (General_options::parse_incremental): New function.
  7150. (General_options::parse_no_incremental): New function.
  7151. (General_options::parse_incremental_full): New function.
  7152. (General_options::parse_incremental_update): New function.
  7153. (General_options::incremental_mode_): New data member.
  7154. (General_options::finalize): Check incremental_mode_.
  7155. * options.h (General_options): Update help text for --incremental.
  7156. Add --no-incremental, --incremental-full, --incremental-update.
  7157. (General_options::Incremental_mode): New enum type.
  7158. (General_options::incremental_mode): New function.
  7159. (General_options::incremental_mode_): New data member.
  7160. * parameters.cc (Parameters::incremental_mode_): New data member.
  7161. (Parameters::set_options): Set incremental_mode_.
  7162. (Parameters::set_incremental_full): New function.
  7163. (Parameters::incremental): New function.
  7164. (Parameters::incremental_update): New function.
  7165. (set_parameters_incremental_full): New function.
  7166. * parameters.h (Parameters::set_incremental_full): New function.
  7167. (Parameters::incremental): New function.
  7168. (Parameters::incremental_update): New function.
  7169. (Parameters::incremental_mode_): New data member.
  7170. (set_parameters_incremental_full): New function.
  7171. * plugin.cc (Plugin_manager::add_input_file): Check parameters for
  7172. incremental link mode.
  7173. * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
  7174. (Sized_relobj::do_relocate_sections): Likewise.
  7175. * testsuite/Makefile.am (incremental_test): Use --incremental-full
  7176. option.
  7177. * testsuite/Makefile.in: Regenerate.
  7178. * testsuite/incremental_test.sh: Filter all forms of --incremental.
  7179. 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  7180. * script-sections.h (class Script_sections): Make
  7181. Sections_elements typedef public.
  7182. * script-sections.cc (class Sort_output_sections): Add elements_
  7183. field. Add constructor which sets it; change all callers.
  7184. (Sort_output_sections::is_before): New function.
  7185. (Sort_output_sections::operator()): Call is_before.
  7186. * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
  7187. conditional.
  7188. * testsuite/script_test_10.sh: New test. Test script section
  7189. order.
  7190. * testsuite/script_test_10.t: Likewise.
  7191. * testsuite/script_test_10.s: Likewise.
  7192. * testsuite/Makefile.am: Wrap the cross linker tests and the
  7193. common tests into NATIVE_OR_CROSS_LINKER.
  7194. (check_SCRIPTS): Add script_test_10.sh.
  7195. (check_DATA): Add script_test_10.stdout.
  7196. (script_test_10.o, script_test_10): New targets.
  7197. (script_test_10.stdout): New target.
  7198. * configure, testsuite/Makefile.in: Regenerate.
  7199. 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  7200. * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
  7201. error for the deprecated relocations.
  7202. (Target_arm::Scan::global): Likewise.
  7203. (Target_arm::Relocate::relocate): Likewise.
  7204. 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
  7205. * fileread.cc (Input_file::find_file): Initialize *found_name
  7206. and *namep when using the fallback search for case 4.
  7207. 2010-10-11 Cary Coutant <ccoutant@google.com>
  7208. * options.h (class General_options): Redefine -z lazy as an alias for
  7209. the negation of -z now.
  7210. 2010-10-11 Ian Lance Taylor <iant@google.com>
  7211. * resolve.cc (symbol_to_bits): Report the value of the unsupported
  7212. binding.
  7213. 2010-10-06 Nick Clifton <nickc@redhat.com>
  7214. * script-sections.cc(class Memory_region): Remove
  7215. current_lma_offset_ field. Rename current_vma_offset_ to
  7216. current_offset_. Add last_section_ field.
  7217. (Memory_region::get_current_vma_address): Rename to
  7218. get_current_address.
  7219. (Memory_region::get_current_lma_address): Delete.
  7220. (Memory_region::increment_vma_offset): Rename to
  7221. increment_offset.
  7222. (Memory_region::increment_lma_offset): Delete.
  7223. (Memory_region::attributes_compatible): New method. Returns
  7224. true if the provided section is compatible with the region.
  7225. (Memory_region::get_last_section): New method. Returns the last
  7226. section to use the region.
  7227. (Memory_region::set_last_section): New method. Stores the last
  7228. section to use the region.
  7229. (Script_sections::block_in_region): New method. Returns true if
  7230. a block of memory is contained within a region.
  7231. (Script_sections::find_memory_region): New method. Locates a
  7232. memory region to be used to set a VMA or LMA address.
  7233. (Output_section_definition::set_section_addresses): Add code to
  7234. check for addresses set by memory regions.
  7235. (Output_segment::set_section_addresses): Remove memory region
  7236. walking code.
  7237. (Script_sections::create_segment): Add a warning if a header
  7238. segment is created outside of any region.
  7239. * script-sections.h (class Script_sections): Add prototypes for
  7240. find_memory_region and block_in_region methods.
  7241. * testsuite/memory_test.s: Use .long instead of .word.
  7242. * testsuite/memory_test.t: Add some more output sections.
  7243. * testsuite/memory_test.sh: Update expected output.
  7244. 2010-10-02 Doug Kwan <dougkwan@google.com>
  7245. * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
  7246. defintion to symtab.h
  7247. * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
  7248. declaration to defintion.
  7249. 2010-10-01 Nick Clifton <nickc@redhat.com>
  7250. * expression.cc (eval): Replace dummy argument with NULL.
  7251. (eval_maybe_dot): Check for a NULL result section pointer.
  7252. (Symbol_expression::value): Likewise.
  7253. (Dot_expression::value): Likewise.
  7254. (BINARY_EXPRESSION): Likewise.
  7255. (Max_expression::value): Likewise.
  7256. (Min_expression::value): Likewise.
  7257. (Absolute_expression::value): Likewise.
  7258. (Addr_expression::value_from_output_section): Likewise.
  7259. (Loaddddr_expression::value_from_output_section): Likewise.
  7260. (Segment_start_expression::value): Likewise.
  7261. * script-sections.cc
  7262. (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
  7263. argument with NULL.
  7264. (Sections_elememt_dot_assignment::set_section_addresses):
  7265. Likewise.
  7266. (Output_data_expression::do_write_to_buffer): Likewise.
  7267. (Output_section_definition::finalize_symbols): Likewise.
  7268. (Output_section_definition::set_section_addresses): Likewise.
  7269. 2010-09-30 Doug Kwan <dougkwan@google.com>
  7270. * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
  7271. 2010-09-28 Sriraman Tallam <tmsriram@google.com>
  7272. * target.h (Target::can_icf_inline_merge_sections): New virtual
  7273. function.
  7274. * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
  7275. virtual function.
  7276. * i386.cc (Target_i386::can_icf_inline_merge_sections): New
  7277. virtual function.
  7278. * icf.cc (get_section_contents): Inline merge sections only when
  7279. target allows it.
  7280. 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  7281. * configure: Regenerate.
  7282. 2010-09-17 Ian Lance Taylor <iant@google.com>
  7283. * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
  7284. * testsuite/Makefile.am (memory_test.o): New target.
  7285. (memory_test): Depend on memory_test.o, gcctestdir/ld, and
  7286. memory_test.t.
  7287. * testsuite/Makefile.in: Rebuild.
  7288. 2010-09-17 Doug Kwan <dougkwan@google.com>
  7289. * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
  7290. defintion if relocation uses GOT entries of the symbol.
  7291. * testsuite/icf_safe_test.sh: Fix test.
  7292. * testsuite/icf_safe_so_test.sh: Fix test.
  7293. 2010-09-16 Cary Coutant <ccoutant@google.com>
  7294. * script_sections.cc (class Memory_region): Remove "NULL" from
  7295. vector initializations.
  7296. 2010-09-15 Cary Coutant <ccoutant@google.com>
  7297. * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
  7298. Resolve forwarding symbols.
  7299. 2010-09-15 Doug Kwan <dougkwan@google.com>
  7300. * gold/testsuite/script_test_3.t: Add ARM special sections.
  7301. * gold/testsuite/script_test_4.t: Same.
  7302. * gold/testsuite/script_test_5.t: Same.
  7303. * gold/testsuite/script_test_6.t: Same.
  7304. * gold/testsuite/script_test_7.t: Same.
  7305. * gold/testsuite/script_test_7.t: Same.
  7306. * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
  7307. 2010-09-14 Cary Coutant <ccoutant@google.com>
  7308. * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
  7309. (Target_x86_64::Relocate::relocate_tls): Replace check for
  7310. saw_tls_block_reloc_ with test for executable section.
  7311. 2010-09-12 Cary Coutant <ccoutant@google.com>
  7312. * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
  7313. position-independent executables to shared libraries need dynamic
  7314. relocations.
  7315. (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
  7316. position-independent executables.
  7317. * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
  7318. * testsuite/Makefile.in: Regenerate.
  7319. 2010-09-10 Nick Clifton <nickc@redhat.com>
  7320. PR gold/11997
  7321. * testsuite/memory_test.t: Discard any sections that are not
  7322. needed.
  7323. 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
  7324. PR gold/11996
  7325. * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
  7326. "This::" to work around a bug in gcc 4.2.
  7327. * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
  7328. 2010-09-09 Rafael Espindola <espindola@google.com>
  7329. * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
  7330. sections with different PF_X flags in the same segment.
  7331. (Layout::find_first_load_seg): Search all segments to find the first
  7332. one.
  7333. * options.h (rosegment): New.
  7334. 2010-09-08 Rafael Espindola <espindola@google.com>
  7335. * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
  7336. 2010-09-08 Doug Kwan <dougkwan@google.com>
  7337. * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
  7338. (Arm_relobj::do_relocate_sections): Add new parameter for output
  7339. file to match the parent.
  7340. (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
  7341. of local symbols instead of input values. Update code to track
  7342. changes in gold::relocate_section.
  7343. * object.cc (Sized_relobj::compute_final_local_value): New methods.
  7344. (Sized_relobj::compute_final_local_value_internal): New methods.
  7345. (Sized_relobj::do_finalize_local_symbols): Move code from loop
  7346. body into private version of Sized_relobj::compute_final_local_value.
  7347. Call the inline method.
  7348. * object.h (Symbol_value::Symbol_value): Define destructor. Free
  7349. merged symbol value if there is one.
  7350. (Symbol_value::has_output_value): New method defintiion.
  7351. (Sized_relobj::Compute_final_local_value_status): New enum type.
  7352. (Sized_relobj::compute_final_local_value): New methods.
  7353. (Sized_relobj::compute_final_local_value_internal): New methods.
  7354. * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
  7355. and arm_cortex_a8.sh.
  7356. (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
  7357. arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
  7358. New tests.
  7359. * Makefile.in: Regenerate.
  7360. * testsuite/arm_bl_out_of_range.s: Update test.
  7361. * testsuite/thumb_bl_out_of_range.s: Ditto.
  7362. * testsuite/thumb_blx_out_of_range.s: Ditto.
  7363. * testsuite/arm_branch_out_of_range.sh: New file.
  7364. * testsuite/arm_cortex_a8.sh: Ditto.
  7365. * testsuite/arm_cortex_a8_b.s: Ditto.
  7366. * testsuite/arm_cortex_a8_b_cond.s: Ditto.
  7367. * testsuite/arm_cortex_a8_b_local.s: Ditto.
  7368. * testsuite/arm_cortex_a8_bl.s: Ditto.
  7369. * testsuite/arm_cortex_a8_blx.s: Ditto.
  7370. * testsuite/arm_cortex_a8_local.s: Ditto.
  7371. * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
  7372. * testsuite/thumb_bl_out_of_range_local.s: Ditto.
  7373. 2010-09-08 Rafael Espindola <espindola@google.com>
  7374. * Makefile.am (memory_test.stdout): Run readelf with -W.
  7375. * Makefile.in: Regenerate.
  7376. * testsuite/memory_test.sh: Make the regexps accept both 32 and
  7377. 64 bit output.
  7378. 2010-09-08 Rafael Espindola <espindola@google.com>
  7379. * script-sections.cc (Script_sections::add_memory_region): Convert
  7380. field precision to int.
  7381. * script.cc (script_set_section_region, script_set_section_region):
  7382. Convert field precision to int.
  7383. 2010-09-08 Rafael Espindola <espindola@google.com>
  7384. * arm.cc (do_finalize_sections): Create the __exidx_start and
  7385. __exdix_end symbols even when the section is missing.
  7386. 2010-09-08 Nick Clifton <nickc@redhat.com>
  7387. * README: Remove claim that MEMORY is not supported.
  7388. * expression.cc (script_exp_function_origin)
  7389. (script_exp_function_length): Move from here to ...
  7390. * script.cc: ... here.
  7391. (script_set_section_region, script_add_memory)
  7392. (script_parse_memory_attr, script_include_directive): New
  7393. functions.
  7394. * script-sections.cc
  7395. (class Memory_region): New class.
  7396. (class Output_section_definition): Add set_memory_region,
  7397. set_section_vma, set_section_lma and get_section_name methods.
  7398. (class Script_Sections): Add add_memory_region,
  7399. find_memory_region, find_memory_region_origin,
  7400. find_memory_region_length and set_memory_region methods.
  7401. Have set_section_addresses method walk the list of set memory
  7402. regions.
  7403. Extend the print methos to display memory regions.
  7404. * script-sections.h: Add prototypes for new methods.
  7405. Add enum for MEMORY region attributes.
  7406. * yyscript.y: Add support for parsing MEMORY regions.
  7407. * script-c.h: Add prototypes for new functions.
  7408. * testsuite/Makefile.am: Add test of MEMORY region functionality.
  7409. * testsuite/Makefile.in: Regenerate.
  7410. * testsuite/memory_test.sh: New script.
  7411. * testsuite/memory_test.s: New assembler source file.
  7412. * testsuite/memory_test.t: New linker script.
  7413. 2010-08-27 Doug Kwan <dougkwan@google.com>
  7414. * gold/resolve.cc (Symbol_table::should_override): Let a weak
  7415. reference override an existing dynamic weak reference.
  7416. * testsuite/Makefile.am: Add new test dyn_weak_ref.
  7417. * testsuite/Makefile.in: Regenerate.
  7418. * testsuite/dyn_weak_ref.sh: New file.
  7419. * testsuite/dyn_weak_ref_1.c: Ditto.
  7420. * testsuite/dyn_weak_ref_2.c: Ditto.
  7421. 2010-08-27 Ian Lance Taylor <iant@google.com>
  7422. * incremental.h (class Incremental_input_entry): Add virtual
  7423. destructor.
  7424. 2010-08-27 Ian Lance Taylor <iant@google.com>
  7425. * testsuite/start_lib_test_3.c: Mark t3 as used.
  7426. 2010-08-27 Nick Clifton <nickc@redhat.com>
  7427. * options.cc (version_script): Fix small typo in previous
  7428. whitespace tidyup.
  7429. 2010-08-25 Nick Clifton <nickc@redhat.com>
  7430. * archive.cc: Formatting fixes: Remove whitespace between
  7431. typename and following asterisk. Remove whitespace between
  7432. function name and opening parenthesis.
  7433. * archive.h: Likewise.
  7434. * arm.cc: Likewise.
  7435. * attributes.cc: Likewise.
  7436. * attributes.h: Likewise.
  7437. * common.cc: Likewise.
  7438. * copy-relocs.cc: Likewise.
  7439. * dirsearch.h: Likewise.
  7440. * dynobj.cc: Likewise.
  7441. * ehframe.cc: Likewise.
  7442. * ehframe.h: Likewise.
  7443. * expression.cc: Likewise.
  7444. * fileread.cc: Likewise.
  7445. * fileread.h: Likewise.
  7446. * gc.h: Likewise.
  7447. * gold-threads.cc: Likewise.
  7448. * gold.cc: Likewise.
  7449. * i386.cc: Likewise.
  7450. * icf.h: Likewise.
  7451. * incremental-dump.cc: Likewise.
  7452. * incremental.cc: Likewise.
  7453. * layout.cc: Likewise.
  7454. * layout.h: Likewise.
  7455. * main.cc: Likewise.
  7456. * merge.cc: Likewise.
  7457. * merge.h: Likewise.
  7458. * object.cc: Likewise.
  7459. * object.h: Likewise.
  7460. * options.cc: Likewise.
  7461. * options.h: Likewise.
  7462. * output.cc: Likewise.
  7463. * output.h: Likewise.
  7464. * plugin.cc: Likewise.
  7465. * plugin.h: Likewise.
  7466. * powerpc.cc: Likewise.
  7467. * reloc.cc: Likewise.
  7468. * script-c.h: Likewise.
  7469. * script-sections.cc: Likewise.
  7470. * script.cc: Likewise.
  7471. * stringpool.cc: Likewise.
  7472. * symtab.cc: Likewise.
  7473. * symtab.h: Likewise.
  7474. * target.cc: Likewise.
  7475. * timer.cc: Likewise.
  7476. * timer.h: Likewise.
  7477. * version.cc: Likewise.
  7478. * x86_64.cc: Likewise.
  7479. 2010-08-24 Nick Clifton <nickc@redhat.com>
  7480. PR 11899
  7481. * layout.cc (segment_precedes): Sort segments by their physical
  7482. addresses, if they have been set.
  7483. 2010-08-23 Cary Coutant <ccoutant@google.com>
  7484. * archive.cc (Lib_group::add_symbols): Lock object before deleting its
  7485. symbols data.
  7486. (Lib_group::include_member): Unlock object after deleting its
  7487. symbols data.
  7488. * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
  7489. the bug fixed here.
  7490. 2010-08-19 Neil Vachharajani <nvachhar@google.com>
  7491. Cary Coutant <ccoutant@google.com>
  7492. * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
  7493. constructor, and set_blocker.
  7494. * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
  7495. readsyms_blocker_.
  7496. * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
  7497. this->this_blocker_ to Add_lib_group_symbols::set_blocker.
  7498. * testsuite/Makefile.am (start_lib_test): New test case.
  7499. * testsuite/Makefile.in: Regenerate.
  7500. * testsuite/start_lib_test_main.c: New file.
  7501. * testsuite/start_lib_test_1.c: New file.
  7502. * testsuite/start_lib_test_2.c: New file.
  7503. * testsuite/start_lib_test_3.c: New file.
  7504. 2010-08-19 Ian Lance Taylor <iant@google.com>
  7505. * Makefile.in: Rebuild with automake 1.11.1.
  7506. * aclocal.m4: Likewise.
  7507. * testsuite/Makefile.in: Likewise.
  7508. 2010-08-19 Ian Lance Taylor <iant@google.com>
  7509. PR 10893
  7510. * i386.cc (class Output_data_plt_i386): Update declarations.
  7511. Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
  7512. local_ifuncs_ fields.
  7513. (Target_i386::do_plt_section_for_global): New function.
  7514. (Target_i386::do_plt_section_for_local): New function.
  7515. (Output_data_plt_i386::Output_data_plt_i386): Add symtab
  7516. parameter; change all callers. Initialize global_ifuncs_ and
  7517. local_ifuncs_. If doing a static link define __rel_iplt_start and
  7518. __rel_iplt_end.
  7519. (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
  7520. (Output_data_plt_i386::add_local_ifunc_entry): New function.
  7521. (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
  7522. symbols.
  7523. (Target_i386::make_plt_section): New function, broken out of
  7524. make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
  7525. (Target_i386::make_plt_entry): Call make_plt_section.
  7526. (Target_i386::make_local_ifunc_plt_entry): New function.
  7527. (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
  7528. (Target_i386::Scan::local): Handle IFUNC symbols. Add
  7529. R_386_IRELATIVE to switch.
  7530. (Target_i386::Scan::global): Likewise.
  7531. (Target_i386::Relocate::relocate): Likewise.
  7532. (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
  7533. switch.
  7534. * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
  7535. (Target_x86_64::do_plt_section_for_global): New function.
  7536. (Target_x86_64::do_plt_section_for_local): New function.
  7537. (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
  7538. parameter; change all callers. If doing a static link define
  7539. __rela_iplt_start and __rela_iplt_end.
  7540. (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
  7541. (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
  7542. (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
  7543. to point to .plt.
  7544. (Target_x86_64::make_local_ifunc_plt_entry): New function.
  7545. (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
  7546. switch.
  7547. (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
  7548. (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
  7549. R_X86_64_IRELATIVE to switch.
  7550. (Target_x86_64::Scan::global): Likewise.
  7551. (Target_x86_64::Relocate::relocate): Likewise.
  7552. (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
  7553. switch.
  7554. * target.h (class Target): Add plt_section_for_global and
  7555. plt_section_for_local functions. Add do_plt_section_for_global
  7556. and do_plt_section_for_local virtual functions.
  7557. * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
  7558. clarifying comments.
  7559. (Symbol::use_plt_offset): Handle IFUNC symbol.
  7560. * object.cc (Sized_relobj::Sized_relobj): Initialize
  7561. local_plt_offsets_.
  7562. (Sized_relobj::local_has_plt_offset): New function.
  7563. (Sized_relobj::local_plt_offset): New function.
  7564. (Sized_relobj::set_local_plt_offset): New function.
  7565. (Sized_relobj::do_count): Handle IFUNC symbol.
  7566. * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
  7567. a bit away from input_shndx_ field. Add set_is_func_symbol and
  7568. is_ifunc_symbol functions.
  7569. (class Sized_relobj): Update declarations. Remove Tls_got_entry
  7570. and Local_tls_got_offsets. Define Local_plt_offsets. Add
  7571. local_plt_offsets_ field.
  7572. (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
  7573. * output.h (class Output_section_data): Add non-const
  7574. output_section function.
  7575. (class Output_data_got): Update declarations.
  7576. (class Output_data_got::Got_entry): Add use_plt_offset_ field.
  7577. Add use_plt_offset parameter to global and local constructors.
  7578. Change all callers. Change local_sym_index_ field to 31 bits.
  7579. Change GSYM_CODE and CONSTANT_CODE accordingly.
  7580. * output.cc (Output_data_reloc_base::do_adjust_output_section): If
  7581. doing a static link don't set sh_link field.
  7582. (Output_data_got::Got_entry::write): Use PLT offset if
  7583. appropriate.
  7584. (Output_data_got::add_global_plt): New function.
  7585. (Output_data_got::add_local_plt): New function.
  7586. * target-reloc.h (relocate_section): Handle IFUNC symbol.
  7587. * defstd.cc (in_section): Remove entries for __rel_iplt_start,
  7588. __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
  7589. * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
  7590. * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
  7591. IFUNC conditional.
  7592. * testsuite/ifunc-sel.h: New file.
  7593. * testsuite/ifuncmain1.c: New file.
  7594. * testsuite/ifuncmain1vis.c: New file.
  7595. * testsuite/ifuncmod1.c: New file.
  7596. * testsuite/ifuncdep2.c: New file.
  7597. * testsuite/ifuncmain2.c: New file.
  7598. * testsuite/ifuncmain3.c: New file.
  7599. * testsuite/ifuncmod3.c: New file.
  7600. * testsuite/ifuncmain4.c: New file.
  7601. * testsuite/ifuncmain5.c: New file.
  7602. * testsuite/ifuncmod5.c: New file.
  7603. * testsuite/ifuncmain6pie.c: New file.
  7604. * testsuite/ifuncmod6.c: New file.
  7605. * testsuite/ifuncmain7.c: New file.
  7606. * configure, testsuite/Makefile.in: Rebuild.
  7607. 2010-08-18 Ian Lance Taylor <iant@google.com>
  7608. * incremental.cc
  7609. (Output_section_incremental_inputs::write_input_files): Add cast
  7610. to avoid signed/unsigned comparison warning.
  7611. (Output_section_incremental_inputs::write_info_blocks): Likewise.
  7612. 2010-08-12 Cary Coutant <ccoutant@google.com>
  7613. * common.cc (Sort_commons::operator()): Remove unnecessary code.
  7614. 2010-08-13 Ian Lance Taylor <iant@google.com>
  7615. * testsuite/incremental_test_1.c: Add prototype to avoid warning.
  7616. 2010-08-12 Cary Coutant <ccoutant@google.com>
  7617. Doug Kwan <dougkwan@google.com>
  7618. * resolve.cc (Symbol_table::should_override): When a weak dynamic
  7619. defintion overrides non-weak undef, remember that the original undef
  7620. is not weak.
  7621. * symtab.cc (Symbol_table::sized_write_global): For undef without
  7622. an original weak binding, set binding to global in output.
  7623. * testsuite/Makefile.am: Add new test strong_ref_weak_def.
  7624. * testsuite/Makefile.in: Regenerate.
  7625. * testsuite/strong_ref_weak_def.sh: New file.
  7626. * testsuite/strong_ref_weak_def_1.c: Ditto.
  7627. * testsuite/strong_ref_weak_def_2.c: Ditto.
  7628. 2010-08-12 Cary Coutant <ccoutant@google.com>
  7629. * testsuite/incremental_test.sh: Rewrite.
  7630. * testsuite/incremental_test_1.c: Rewrite.
  7631. * testsuite/incremental_test_2.c: Rewrite.
  7632. 2010-08-12 Cary Coutant <ccoutant@google.com>
  7633. * arm.cc (Target_arm::got_size): Add const.
  7634. (Target_arm::got_entry_count): New function.
  7635. (Target_arm::plt_entry_count): New function.
  7636. (Target_arm::first_plt_entry_offset): New function.
  7637. (Target_arm::plt_entry_size): New function.
  7638. (Output_data_plt_arm::entry_count): New function.
  7639. (Output_data_plt_arm::first_plt_entry_offset): New function.
  7640. (Output_data_plt_arm::get_plt_entry_size): New function.
  7641. * i386.cc (Target_i386::got_size): Add const.
  7642. (Target_i386::got_entry_count): New function.
  7643. (Target_i386::plt_entry_count): New function.
  7644. (Target_i386::first_plt_entry_offset): New function.
  7645. (Target_i386::plt_entry_size): New function.
  7646. (Output_data_plt_i386::entry_count): New function.
  7647. (Output_data_plt_i386::first_plt_entry_offset): New function.
  7648. (Output_data_plt_i386::get_plt_entry_size): New function.
  7649. * incremental-dump.cc (dump_incremental_inputs): Adjust call to
  7650. find_incremental_inputs_sections. Dump incremental_got_plt section.
  7651. * incremental.cc: Include target.h.
  7652. (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
  7653. parameter. Adjust all callers. Find incremental_got_plt section.
  7654. (Incremental_inputs::create_data_sections): Create incremental_got_plt
  7655. section.
  7656. (Output_section_incremental_inputs::set_final_data_size): Calculate
  7657. size of incremental_got_plt section.
  7658. (Output_section_incremental_inputs::do_write): Write the
  7659. incremental_got_plt section.
  7660. (Got_plt_view_info): New struct.
  7661. (Local_got_offset_visitor): New class.
  7662. (Global_got_offset_visitor): New class.
  7663. (Global_symbol_visitor_got_plt): New class.
  7664. (Output_section_incremental_inputs::write_got_plt): New function.
  7665. * incremental.h (Incremental_binary::find_incremental_inputs_sections):
  7666. Add parameter. Adjust all callers.
  7667. (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
  7668. (Incremental_inputs::got_plt_section): New function.
  7669. (Incremental_inputs::got_plt_section_): New data member.
  7670. (Incremental_got_plt_reader): New class.
  7671. * layout.cc (Layout::create_incremental_info_sections): Add the
  7672. incremental_got_plt section.
  7673. * object.h (Got_offset_list::get_list): New function.
  7674. (Got offset_list::for_all_got_offsets): New function.
  7675. (Sized_relobj::local_got_offset_list): New function.
  7676. * powerpc.cc (Target_powerpc::got_size): Add const.
  7677. (Target_powerpc::got_entry_count): New function.
  7678. (Target_powerpc::plt_entry_count): New function.
  7679. (Target_powerpc::first_plt_entry_offset): New function.
  7680. (Target_powerpc::plt_entry_size): New function.
  7681. (Output_data_plt_powerpc::entry_count): New function.
  7682. (Output_data_plt_powerpc::first_plt_entry_offset): New function.
  7683. (Output_data_plt_powerpc::get_plt_entry_size): New function.
  7684. * sparc.cc (Target_sparc::got_size): Add const.
  7685. (Target_sparc::got_entry_count): New function.
  7686. (Target_sparc::plt_entry_count): New function.
  7687. (Target_sparc::first_plt_entry_offset): New function.
  7688. (Target_sparc::plt_entry_size): New function.
  7689. (Output_data_plt_sparc::entry_count): New function.
  7690. (Output_data_plt_sparc::first_plt_entry_offset): New function.
  7691. (Output_data_plt_sparc::get_plt_entry_size): New function.
  7692. * symtab.h (Symbol::got_offset_list): New function.
  7693. (Symbol_table::for_all_symbols): New function.
  7694. * target.h (Sized_target::got_entry_count): New function.
  7695. (Sized_target::plt_entry_count): New function.
  7696. (Sized_target::plt_entry_size): New function.
  7697. * x86_64.cc (Target_x86_64::got_size): Add const.
  7698. (Target_x86_64::got_entry_count): New function.
  7699. (Target_x86_64::plt_entry_count): New function.
  7700. (Target_x86_64::first_plt_entry_offset): New function.
  7701. (Target_x86_64::plt_entry_size): New function.
  7702. (Output_data_plt_x86_64::entry_count): New function.
  7703. (Output_data_plt_x86_64::first_plt_entry_offset): New function.
  7704. (Output_data_plt_x86_64::get_plt_entry_size): New function.
  7705. 2010-08-12 Cary Coutant <ccoutant@google.com>
  7706. * archive.cc: Include incremental.h.
  7707. (Archive::Archive): Initialize incremental_info_.
  7708. (Archive::include_member): Record archive members in incremental info.
  7709. (Add_archive_symbols::run): Record begin and end of an archive in
  7710. incremental info.
  7711. (Lib_group::include_member): Record objects in incremental info.
  7712. * archive.h (Incremental_archive_entry): Forward declaration.
  7713. (Archive::set_incremental_info): New member function.
  7714. (Archive::incremental_info): New member function.
  7715. (Archive::Unused_symbol_iterator): New class.
  7716. (Archive::unused_symbols_begin): New member function.
  7717. (Archive::unused_symbols_end): New member function.
  7718. (Archive::incremental_info_): New data member.
  7719. * incremental-dump.cc (find_input_containing_global): New function.
  7720. (dump_incremental_inputs): Dump new incremental info sections.
  7721. * incremental.cc: Include symtab.h.
  7722. (Output_section_incremental_inputs): New class.
  7723. (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
  7724. new incremental info sections.
  7725. (Sized_incremental_binary::do_check_inputs): Likewise.
  7726. (Incremental_inputs::report_archive): Remove.
  7727. (Incremental_inputs::report_archive_begin): New function.
  7728. (Incremental_inputs::report_archive_end): New function.
  7729. (Incremental_inputs::report_object): New function.
  7730. (Incremental_inputs::finalize_inputs): Remove.
  7731. (Incremental_inputs::report_input_section): New function.
  7732. (Incremental_inputs::report_script): Rewrite.
  7733. (Incremental_inputs::finalize): Do nothing but finalize string table.
  7734. (Incremental_inputs::create_incremental_inputs_section_data): Remove.
  7735. (Incremental_inputs::sized_create_inputs_section_data): Remove.
  7736. (Incremental_inputs::create_data_sections): New function.
  7737. (Incremental_inputs::relocs_entsize): New function.
  7738. (Output_section_incremental_inputs::set_final_data_size): New function.
  7739. (Output_section_incremental_inputs::do_write): New function.
  7740. (Output_section_incremental_inputs::write_header): New function.
  7741. (Output_section_incremental_inputs::write_input_files): New function.
  7742. (Output_section_incremental_inputs::write_info_blocks): New function.
  7743. (Output_section_incremental_inputs::write_symtab): New function.
  7744. * incremental.h (Incremental_script_entry): Forward declaration.
  7745. (Incremental_object_entry): Forward declaration.
  7746. (Incremental_archive_entry): Forward declaration.
  7747. (Incremental_inputs): Forward declaration.
  7748. (Incremental_inputs_header_data): Remove.
  7749. (Incremental_inputs_header): Remove.
  7750. (Incremental_inputs_header_write): Remove.
  7751. (Incremental_inputs_entry_data): Remove.
  7752. (Incremental_inputs_entry): Remove.
  7753. (Incremental_inputs_entry_write): Remove.
  7754. (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
  7755. (Incremental_binary::find_incremental_inputs_sections): Add parameters.
  7756. (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
  7757. (Sized_ncremental_binary::do_find_incremental_inputs_sections):
  7758. Likewise.
  7759. (Incremental_input_entry): New class.
  7760. (Incremental_script_entry): New class.
  7761. (Incremental_object_entry): New class.
  7762. (Incremental_archive_entry): New class.
  7763. (Incremental_inputs::Incremental_inputs): Initialize new data members.
  7764. (Incremental_inputs::report_inputs): Remove.
  7765. (Incremental_inputs::report_archive): Remove.
  7766. (Incremental_inputs::report_archive_begin): New function.
  7767. (Incremental_inputs::report_archive_end): New function.
  7768. (Incremental_inputs::report_object): Change prototype.
  7769. (Incremental_inputs::report_input_section): New function.
  7770. (Incremental_inputs::report_script): Change prototype.
  7771. (Incremental_inputs::get_reloc_count): New function.
  7772. (Incremental_inputs::set_reloc_count): New function.
  7773. (Incremental_inputs::create_data_sections): New function.
  7774. (Incremental_inputs::create_incremental_inputs_section_data): Remove.
  7775. (Incremental_inputs::inputs_section): New function.
  7776. (Incremental_inputs::symtab_section): New function.
  7777. (Incremental_inputs::relocs_section): New function.
  7778. (Incremental_inputs::get_stringpool): Add const.
  7779. (Incremental_inputs::command_line): Add const.
  7780. (Incremental_inputs::inputs): Remove.
  7781. (Incremental_inputs::command_line_key): New function.
  7782. (Incremental_inputs::input_file_count): New function.
  7783. (Incremental_inputs::input_files): New function.
  7784. (Incremental_inputs::relocs_entsize): New function.
  7785. (Incremental_inputs::sized_create_inputs_section_data): Remove.
  7786. (Incremental_inputs::finalize_inputs): Remove.
  7787. (Incremental_inputs::Input_info): Remove.
  7788. (Incremental_inputs::lock_): Remove.
  7789. (Incremental_inputs::inputs_): Change type.
  7790. (Incremental_inputs::inputs_map_): Remove.
  7791. (Incremental_inputs::current_object_entry_): New data member.
  7792. (Incremental_inputs::inputs_section_): New data member.
  7793. (Incremental_inputs::symtab_section_): New data member.
  7794. (Incremental_inputs::relocs_section_): New data member.
  7795. (Incremental_inputs::reloc_count_): New data member.
  7796. (Incremental_inputs_reader): New class.
  7797. (Incremental_symtab_reader): New class.
  7798. (Incremental_relocs_reader): New class.
  7799. * layout.cc (Layout::finalize): Move finalization of incremental info
  7800. and creation of incremental info sections to follow finalization of
  7801. symbol table. Set offsets for postprocessing sections.
  7802. (Layout::create_incremental_info_sections): Call
  7803. Incremental_inputs::create_data_sections. Add incremental symtab
  7804. and relocs sections. Set sh_entsize and sh_link fields. Arrange for
  7805. sections to layout after input sections.
  7806. * layout.h (struct Timespec): Forward declaration.
  7807. (Layout::incremental_inputs): Add const.
  7808. (Layout::create_incremental_info_sections): Add parameter.
  7809. * main.cc (main): Remove call to Incremental_inputs::report_inputs.
  7810. * object.cc: Include incremental.h.
  7811. (Relobj::finalize_incremental_relocs): New function.
  7812. (Sized_relobj::do_layout): Record input sections in incremental info.
  7813. * object.h (Object::output_section): New function.
  7814. (Object::output_section_offset): Moved from Relobj.
  7815. (Object::get_incremental_reloc_base): New function.
  7816. (Object::get_incremental_reloc_count): New function.
  7817. (Object::do_output_section): New function.
  7818. (Object::do_output_section_offset): Moved from Relobj.
  7819. (Object::do_get_incremental_reloc_base): New function.
  7820. (Object::do_get_incremental_reloc_count): New function.
  7821. (Object::Object): Initialize new data members.
  7822. (Relobj::output_section): Renamed do_output_section and moved to
  7823. protected.
  7824. (Relobj::output_section_offset): Moved to Object.
  7825. (Relobj::do_get_incremental_reloc_base): New function.
  7826. (Relobj::do_get_incremental_reloc_count): New function.
  7827. (Relobj::allocate_incremental_reloc_counts): New function.
  7828. (Relobj::count_incremental_reloc): New function.
  7829. (Relobj::finalize_incremental_relocs): New function.
  7830. (Relobj::next_incremental_reloc_index): New function.
  7831. (Relobj::reloc_counts_): New data member.
  7832. (Relobj::reloc_bases_): New data member.
  7833. (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
  7834. (Sized_relobj::relocate_sections): Add parameter. Change all callers.
  7835. (Sized_relobj::incremental_relocs_scan): New function.
  7836. (Sized_relobj::incremental_relocs_scan_reltype): New function.
  7837. (Sized_relobj::incremental_relocs_write): New function.
  7838. (Sized_relobj::incremental_relocs_write_reltype): New function.
  7839. * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
  7840. incremental link.
  7841. * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
  7842. archives and object files elsewhere.
  7843. (Add_symbols::run): Report object files here.
  7844. (Finish_group::run): Report end of archive at end of group.
  7845. * reloc.cc: Include layout.h, incremental.h.
  7846. (Sized_relobj::do_read_relocs): Need relocations for incremental link.
  7847. (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
  7848. (Sized_relobj::incremental_relocs_scan): New function.
  7849. (Sized_relobj::incremental_relocs_scan_reltype): New function.
  7850. (Sized_relobj::do_relocate_sections): Write incremental relocations.
  7851. (Sized_relobj::incremental_relocs_write): New function.
  7852. (Sized_relobj::incremental_relocs_write_reltype): New function.
  7853. * script.cc (read_input_script): Rewrite test for incremental link.
  7854. Change call to Incremental_inputs::report_script.
  7855. * symtab.h (Symbol_table::first_global_index): New function.
  7856. (Symbol_table::output_count): New function.
  7857. 2010-08-12 Doug Kwan <dougkwan@google.com>
  7858. * arm.cc (Target_arm::merge_object_attributes): Check command line
  7859. options --no-wchar-size-warning and --no-enum-size-warning.
  7860. * options.h (General_options): Add ld-compatible options
  7861. --no-enum-size-warning and --no-wchar-size-warning.
  7862. 2010-08-04 Ian Lance Taylor <iant@google.com>
  7863. * x86_64.cc (Target_x86_64::Scan::local): Use
  7864. R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
  7865. R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
  7866. (Target_x86_64::Scan::global): Likewise.
  7867. (Target_x86_64::Relocate::relocate): Likewise.
  7868. (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
  7869. Likewise.
  7870. 2010-08-03 Cary Coutant <ccoutant@google.com>
  7871. * merge.cc (Output_merge_string::do_add_input_section): Count strings
  7872. to reserve space in merged_strings vector. Keep total input size
  7873. for stats.
  7874. (Output_merge_string::do_print_merge_stats): Print total input size.
  7875. * merge.h (Output_merge_string): Add input_size_ field.
  7876. * stringpool.cc (Stringpool_template::string_length): Move
  7877. implementations out of Stringpool_template class and place in
  7878. stringpool.h.
  7879. * stringpool.h (string_length): Move out of Stringpool_template.
  7880. 2010-08-03 Ian Lance Taylor <iant@google.com>
  7881. PR 11712
  7882. * layout.cc (relaxation_loop_body): If address of load segment is
  7883. set, adjust address to include headers if possible.
  7884. 2010-08-03 Ian Lance Taylor <iant@google.com>
  7885. * version.cc (version_string): Bump to 1.10.
  7886. 2010-08-03 Ian Lance Taylor <iant@google.com>
  7887. PR 11805
  7888. * layout.h (enum Output_section_order): Define.
  7889. (class Layout): Update declarations.
  7890. * layout.cc (Layout::get_output_section): Add order parameter.
  7891. Remove is_interp, is_dynamic_linker_section, is_last_relro, and
  7892. is_first_non_relro parameters. Change all callers.
  7893. (Layout::choose_output_section): Likewise.
  7894. (Layout::add_output_section_data): Likewise.
  7895. (Layout::make_output_section): Likewise. Set order.
  7896. (Layout::default_section_order): New function.
  7897. (Layout::layout_eh_frame): Call add_output_section_to_nonload.
  7898. * output.cc (Output_section::Output_section): Initialize order_.
  7899. Don't initialize deleted fields.
  7900. (Output_segment::Output_segment): Don't initialize deleted
  7901. fields.
  7902. (Output_segment::add_output_section_to_load): New function
  7903. replacing add_output_section. Change all callers to call this or
  7904. add_output_section_to_nonload.
  7905. (Output_segment::add_output_section_to_nonload): New function.
  7906. (Output_segment::remove_output_section): Rewrite.
  7907. (Output_segment::add_initial_output_data): Likewise.
  7908. (Output_segment::has_any_data_sections): Likewise.
  7909. (Output_segment::is_first_section_relro): Likewise.
  7910. (Output_segment::maximum_alignment): Likewise.
  7911. (Output_segment::has_dynamic_reloc): New function replacing
  7912. dynamic_reloc_count. Change all callers.
  7913. (Output_segment::has_dynamic_reloc_list): New function replacing
  7914. dynamic_reloc_count_list. Change all callers.
  7915. (Output_segment::set_section_addresses): Rewrite.
  7916. (Output_segment::set_offset): Rewrite.
  7917. (Output_segment::find_first_and_last_list): Remove.
  7918. (Output_segment::set_tls_offsets): Rewrite.
  7919. (Output_segment::first_section_load_address): Likewise.
  7920. (Output_segment::output_section_count): Likewise.
  7921. (Output_segment::section_with_lowest_load_address): Likewise.
  7922. (Output_segment::write_section_headers): Likewise.
  7923. (Output_segment::print_sections_to_map): Likewise.
  7924. * output.h (class Output_data): Remove dynamic_reloc_count_
  7925. field. Add has_dynamic_reloc_ field. Make bools into bitfields.
  7926. (Output_data::add_dynamic_reloc): Rewrite.
  7927. (Output_data::has_dynamic_reloc): New function.
  7928. (Output_data::dynamic_reloc_count): Remove.
  7929. (class Output_section): Add order_ field. Remvoe is_relro_local_,
  7930. is_last_relro_, is_first_non_relro_, is_interp_,
  7931. is_dynamic_linker_section_ fields. Add order and set_order
  7932. functions. Remove is_relro_local, set_is_relro_local,
  7933. is_last_relro, set_is_last_relro, is_first_non_relro,
  7934. set_is_first_non_relro functions, is_interp, set_is_interp,
  7935. is_dynamic_linker_section, and set_is_dynamic_linker_section
  7936. functions.
  7937. (class Output_segment): Change Output_data_list from std::list to
  7938. std:;vector. Add output_lists_ field. Remove output_data_ and
  7939. output_bss_ fields. Update declarations.
  7940. 2010-08-02 Ian Lance Taylor <iant@google.com>
  7941. * arm.cc (Target_arm::gc_process_relocs): Use typename.
  7942. * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
  7943. * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
  7944. 2010-08-02 Ian Lance Taylor <iant@google.com>
  7945. PR 11855
  7946. * script.cc (Script_options::Script_options): Initialize
  7947. symbol_definitions_ and symbol_references_.
  7948. (Script_options::add_symbol_assignment): Update
  7949. symbol_definitions_ and symbol_references_.
  7950. (Script_options::add_symbol_reference): New function.
  7951. (script_symbol): New function.
  7952. * script.h (class Script_options): Add symbol_definitions_ and
  7953. symbol_references_ fields.
  7954. (Script_options::referenced_const_iterator): New type.
  7955. (Script_options::referenced_begin): New function.
  7956. (Script_options::referenced_end): New function.
  7957. (Script_options::is_referenced): New function.
  7958. (Script_options::any_unreferenced): New function.
  7959. * script-c.h (script_symbol): Declare.
  7960. * yyscript.y (exp): Call script_symbol.
  7961. * symtab.cc: Include "script.h".
  7962. (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
  7963. Change all callers. Check symbols referenced by scripts.
  7964. (Symbol_table::add_undefined_symbols_from_command_line): Add
  7965. layout parameter. Change all callers.
  7966. (Symbol_table::do_add_undefined_symbols_from_command_line):
  7967. Likewise. Break out loop body. Check symbols referenced by
  7968. scripts.
  7969. (Symbol_table::add_undefined_symbol_from_command_line): New
  7970. function broken out of
  7971. do_add_undefined_symbols_from_command_line.
  7972. * symtab.h (class Symbol_table): Update declarations.
  7973. * archive.cc: Include "layout.h".
  7974. (Archive::should_include_member): Add layout parameter. Change
  7975. all callers. Check for symbol mentioned in expression.
  7976. * archive.h (class Archive): Update declaration.
  7977. * object.cc (Sized_relobj::do_should_include_member): Add layout
  7978. parameter.
  7979. * object.h (Object::should_include_member): Add layout parameter.
  7980. Change all callers.
  7981. (Object::do_should_include_member): Add layout parameter.
  7982. (class Sized_relobj): Update declaration.
  7983. * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
  7984. parameter.
  7985. * dynobj.h (class Sized_dynobj): Update declaration.
  7986. * plugin.cc (Sized_pluginobj::do_should_include_member): Add
  7987. layout parameter.
  7988. * plugin.h (class Sized_pluginobj): Update declaration.
  7989. 2010-08-02 Ian Lance Taylor <iant@google.com>
  7990. PR 11866
  7991. * output.cc (Output_segment::set_offset): Search for the first and
  7992. last sections rather than assuming that the list is in order.
  7993. (Output_segment::find_first_and_last_list): New function.
  7994. * output.h (class Output_segment): Update declarations.
  7995. * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
  7996. (relro_strip_test_SOURCES): New variable.
  7997. (relro_strip_test_DEPENDENCIES): New variable.
  7998. (relro_strip_test_LDFLAGS): New variable.
  7999. (relro_strip_test_LDADD): New variable.
  8000. (relro_strip_test.so): New target.
  8001. 2010-08-02 Ian Lance Taylor <iant@google.com>
  8002. * i386.cc (class Target_i386): Add got_tlsdesc_ field.
  8003. (Target_i386::Target_i386):: Initialize got_tlsdesc_.
  8004. (Target_i386::got_tlsdesc_section): New function.
  8005. (Target_i386::got_section): Create space for GOT entries for
  8006. TLSDESC relocations.
  8007. (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
  8008. R_386_TLS_GOTDESC.
  8009. (Target_i386::Scan::global): Likewise.
  8010. (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
  8011. using TLSDESC GOT.
  8012. * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
  8013. (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
  8014. (Target_x86_64::got_tlsdesc_section): New function.
  8015. (Target_x86_64::got_section): Create space for GOT entries for
  8016. TLSDESC relocations.
  8017. (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
  8018. R_386_TLS_GOTDESC.
  8019. (Target_x86_64::Scan::global): Likewise.
  8020. (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
  8021. using TLSDESC GOT.
  8022. 2010-08-02 Ian Lance Taylor <iant@google.com>
  8023. * testsuite/final_layout.sh: Use dc to convert from hex to
  8024. decimal.
  8025. 2010-07-29 Sriraman Tallam <tmsriram@google.com>
  8026. * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
  8027. paramter to the call to gold::gc_process_relocs.
  8028. * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
  8029. paramter to the call to gold::gc_process_relocs.
  8030. * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
  8031. parameter to the call to gold::gc_process_relocs.
  8032. * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
  8033. template parameter to the call to gold::gc_process_relocs.
  8034. * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
  8035. paramter to the call to gold::gc_process_relocs.
  8036. * gc.h (get_embedded_addend_size): New function.
  8037. (gc_process_relocs): Save the size of the reloc for use by ICF.
  8038. * icf.cc (get_section_contents): Get the addend from the text section
  8039. for SHT_REL relocation sections.
  8040. * icf.h (Icf::Reloc_addend_size_info): New typedef.
  8041. (Icf::Reloc_info): Add new member reloc_addend_size_info.
  8042. * int_encoding.h (read_from_pointer): New overloaded function.
  8043. * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
  8044. * testsuite/icf_sht_rel_addend_test.sh: New file.
  8045. * testsuite/icf_sht_rel_addend_test_1.cc: New file.
  8046. * testsuite/icf_sht_rel_addend_test_2.cc: New file.
  8047. 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  8048. * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
  8049. * Makefile.in: Regenerate.
  8050. * testsuite/Makefile.in: Regenerate.
  8051. 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
  8052. * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
  8053. * gold/testsuite/debug_msg.cc: Likewise.
  8054. * gold/testsuite/odr_violation1.cc
  8055. * gold/testsuite/odr_violation2.cc
  8056. 2010-07-21 Cary Coutant <ccoutant@google.com>
  8057. * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
  8058. string, and length fields.
  8059. (Output_merge_string::Merged_strings_list): New type.
  8060. (Output_merge_string::Merged_strings_lists): New typedef.
  8061. (Output_merge_string): Replace merged_strings_ with
  8062. merged_strings_lists_.
  8063. * merge.cc (Output_merge_string::do_add_input_section): Allocate new
  8064. Merged_strings_list per input object and section. Don't store pointer
  8065. to the string. Don't store length with each merged string entry.
  8066. (Output_merge_string::finalize_merged_data): Loop over list of merged
  8067. strings lists. Recompute length of each merged string.
  8068. 2010-07-15 Cary Coutant <ccoutant@google.com>
  8069. * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
  8070. here.
  8071. 2010-07-14 Ian Lance Taylor <iant@google.com>
  8072. * descriptors.cc (Descriptors::open): Report correct name in error
  8073. message.
  8074. 2010-07-13 Doug Kwan <dougkwan@google.com>
  8075. * arm.cc (Arm_input_section::Arm_input_section): For a
  8076. SHT_ARM_EXIDX section, always keeps the input sections.
  8077. (Arm_input_section::set_exidx_section_link): New method.
  8078. (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
  8079. has_errors_ to false.
  8080. (Arm_exidx_input_section::has_errors,
  8081. Arm_exidx_input_section::set_has_errors): New methods.
  8082. (Arm_exidx_input_section::has_errors_): New data member.
  8083. (Arm_relobj::get_exidx_shndx_list): New method.
  8084. (Arm_output_section::append_text_sections_to_list): Do not skip
  8085. section without SHF_EXECINSTR.
  8086. (Arm_output_section::fix_exidx_coverage): Skip input sections with
  8087. errors.
  8088. (Arm_relobj::make_exidx_input_section): Add new parameter for text
  8089. section header. Make error messages more verbose. Check for
  8090. a non-executable section linked to an EXIDX section.
  8091. (Arm_relobj::do_read_symbols): Remove error checking, which has been
  8092. moved to Arm_relobj::make_exidx_input_section. Add an assertion to
  8093. check that there is no deferred EXIDX section if we exit early.
  8094. Instead of not making an EXIDX section in case of an error, make one
  8095. and set the has_errors flag of it.
  8096. (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
  8097. in a relocatable link.
  8098. (Target_arm::do_relax): Look for the EXIDX output section instead of
  8099. assuming that it is called .ARM.exidx.
  8100. (Target_arm::fix_exidx_coverage): Add a new parameter for input
  8101. section list. Do not check for SHF_EXECINSTR section flags but
  8102. skip any input section with errors.
  8103. * output.cc (Output_section::Output_section): Initialize
  8104. always_keeps_input_sections_ to false.
  8105. (Output_section::add_input_section): Check for
  8106. always_keeps_input_sections_.
  8107. * output.h (Output_section::always_keeps_input_sections,
  8108. Output_section::set_always_keeps_input_sections): New methods.
  8109. (Output_section::always_keeps_input_sections): New data member.
  8110. 2010-07-13 Rafael Espindola <espindola@google.com>
  8111. * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
  8112. * fileread.h (Input_file): Add try_extra_search_path and find_file.
  8113. 2010-07-13 Philip Herron <herron.philip@googlemail.com>
  8114. Ian Lance Taylor <iant@google.com>
  8115. * output.h (Output_section_lookup_maps::add_merge_section):
  8116. Correct check of whether value was inserted.
  8117. (Output_section_lookup_maps::add_merge_input_section): Likewise.
  8118. (Output_section_lookup_maps::add_relaxed_input_section):
  8119. Likewise.
  8120. * arm.cc (Target_arm::got_section): Remove used local os.
  8121. * i386.cc (Target_i386::got_section): Likewise.
  8122. * x86_64.cc (Target_x86_64::got_section): Likewise.
  8123. * sparc.cc (Target_sparc::got_section): Likewise.
  8124. (Target_sparc::relocate): Remove unused local have_got_offset.
  8125. * powerpc.cc (Target_powerpc::relocate): Likewise.
  8126. 2010-07-13 Ian Lance Taylor <iant@google.com>
  8127. * compressed_output.cc (zlib_decompress): Fix signature in
  8128. !HAVE_ZLIB_H case.
  8129. * archive.cc (Archive::include_member): Unlock an external member
  8130. of a thin archive. Don't bother to delete an object we know is
  8131. NULL.
  8132. 2010-07-12 Cary Coutant <ccoutant@google.com>
  8133. * compressed_output.cc (zlib_decompress): New function.
  8134. (get_uncompressed_size): New function.
  8135. (decompress_input_section): New function.
  8136. * compressed_output.h (get_uncompressed_size): New function.
  8137. (decompress_input_section): New function.
  8138. * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
  8139. Handle compressed debug sections.
  8140. * layout.cc (is_compressed_debug_section): New function.
  8141. (Layout::output_section_name): Map compressed section names to
  8142. canonical names.
  8143. * layout.h (is_compressed_debug_section): New function.
  8144. (is_debug_info_section): Recognize compressed debug sections.
  8145. * merge.cc: Include compressed_output.h.
  8146. (Output_merge_data::do_add_input_section): Handle compressed
  8147. debug sections.
  8148. (Output_merge_string::do_add_input_section): Handle compressed
  8149. debug sections.
  8150. * object.cc: Include compressed_output.h.
  8151. (Sized_relobj::Sized_relobj): Initialize new data members.
  8152. (build_compressed_section_map): New function.
  8153. (Sized_relobj::do_read_symbols): Handle compressed debug sections.
  8154. * object.h (Object::section_is_compressed): New method.
  8155. (Object::do_section_is_compressed): New method.
  8156. (Sized_relobj::Compressed_section_map): New type.
  8157. (Sized_relobj::do_section_is_compressed): New method.
  8158. (Sized_relobj::compressed_sections_): New data member.
  8159. * output.cc (Output_section::add_input_section): Handle compressed
  8160. debug sections.
  8161. * reloc.cc: Include compressed_output.h.
  8162. (Sized_relobj::write_sections): Handle compressed debug sections.
  8163. 2010-07-08 Cary Coutant <ccoutant@google.com>
  8164. * resolve.cc (Symbol_table::resolve): Remember whether undef was
  8165. weak when resolving to a dynamic def.
  8166. (Symbol_table::should_override): Add adjust_dyndef flag; set it
  8167. for weak undef/dynamic def cases. Adjust callers.
  8168. * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
  8169. undef_binding_weak_.
  8170. (Symbol_table::sized_write_globals): Adjust symbol binding.
  8171. (Symbol_table::sized_write_symbol): Add binding parameter.
  8172. * symtab.h (Symbol::set_undef_binding): New method.
  8173. (Symbol::is_undef_binding_weak): New method.
  8174. (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
  8175. (Symbol_table::should_override): Add new parameter.
  8176. (Symbol_table::sized_write_symbol): Add new parameter.
  8177. * testsuite/weak_undef_file1.cc: Add new test case.
  8178. * testsuite/weak_undef_file2.cc: Fix header comment.
  8179. * testsuite/weak_undef_test.cc: Add new test case.
  8180. 2010-06-29 Doug Kwan <dougkwan@google.com>
  8181. * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
  8182. Initialize USE_SYMBOL_.
  8183. * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
  8184. definition.
  8185. (Arm_reloc_property::uses_symbol_): New data member declaration.
  8186. * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
  8187. uses symbol value and symbol is undefined but not weakly undefined.
  8188. 2010-06-28 Rafael Espindola <espindola@google.com>
  8189. * plugin.cc (Plugin::load): Use dlerror.
  8190. 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
  8191. * symtab.cc (detect_odr_violations): When reporting an ODR
  8192. violation, report an object where the symbol is defined.
  8193. 2010-06-25 Doug Kwan <dougkwan@google.com>
  8194. * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
  8195. (Target_arm::section_may_have_icf_unsafe_pointers): New method
  8196. definition.
  8197. (Target_arm::Scan::local_reloc_may_be_function_pointer,
  8198. Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
  8199. target hook to detect function points.
  8200. (Target_arm::Scan::possible_function_pointer_reloc): New method.
  8201. * icf.h (Icf::check_section_for_function_pointers): Change type of
  8202. parameter SECTION_NAME to const reference to std::string. Use
  8203. target hook to determine if section may have unsafe pointers.
  8204. * target.h (Target::section_may_have_icf_unsafe_pointers): New
  8205. method definition.
  8206. 2010-06-21 Rafael Espindola <espindola@google.com>
  8207. * fileread.cc (Input_file::find_fie): New
  8208. (Input_file::open): Use Input_file::find_fie.
  8209. * fileread.h (Input_file::find_fie): New
  8210. * plugin.cc (set_extra_library_path): New.
  8211. (Plugin::load): Add set_extra_library_path to the transfer vector.
  8212. (Plugin_manager::set_extra_library_path): New.
  8213. (Plugin_manager::add_input_file): Use the extra search path if set.
  8214. (set_extra_library_path(): New.
  8215. * plugin.h (Plugin_manager): Add set_extra_library_path and
  8216. extra_search_path_.
  8217. 2010-06-19 Cary Coutant <ccoutant@google.com>
  8218. * layout.cc (gdb_sections): Add .debug_types.
  8219. (lines_only_debug_sections): Likewise.
  8220. 2010-06-18 Rafael Espindola <espindola@google.com>
  8221. * plugin.cc (add_input_file,add_input_library)
  8222. (Plugin_manager::add_input_file): Make filename arguments const.
  8223. * plugin.h (Plugin_manager::add_input_file): Make filename arguments
  8224. const.
  8225. 2010-06-16 Doug Kwan <dougkwan@google.com>
  8226. * arm.cc (Target_arm::do_finalize_sections): Do not emit an
  8227. .ARM.attributes section if we have not merged any input
  8228. attributes sections.
  8229. 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  8230. * arm.cc: Allow combining objects with no EABI version
  8231. information.
  8232. 2010-06-15 Rafael Espindola <espindola@google.com>
  8233. * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
  8234. 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  8235. * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
  8236. (struct iovec): Correct !HAVE_READV definition.
  8237. 2010-06-10 Cary Coutant <ccoutant@google.com>
  8238. * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
  8239. (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
  8240. reloc sections.
  8241. * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
  8242. PR 11683
  8243. * symtab.h (Symbol::is_placeholder): New member function.
  8244. * target-reloc.h (relocate_section): Check for placeholder symbols.
  8245. * testsuite/Makefile.am (plugin_test_8): New test.
  8246. (plugin_test_9): New test.
  8247. * testsuite/Makefile.in: Regenerate.
  8248. 2010-06-09 Nick Clifton <nickc@redhat.com>
  8249. * yyscript.y (input_list_element): Allow strings prefixed with
  8250. the '-' character. Treat these as libraries.
  8251. * script.cc (script_add_library): New function. Adds a library
  8252. specified by "-l<name>" found in an input script.
  8253. * script-c.h: Add prototype for script_add_library.
  8254. 2010-06-07 Doug Kwan <dougkwan@google.com>
  8255. * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
  8256. Restrict stub-group size to be within long conditional branch
  8257. range when working around cortex-A8 erratum.
  8258. 2010-06-07 Damien Diederen <dd@crosstwine.com>
  8259. * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
  8260. #ifdef typo.
  8261. 2010-06-03 Sriraman Tallam <tmsriram@google.com>
  8262. PR gold/11658
  8263. * output.cc
  8264. (Output_section::Input_section_sort_entry::compare_section_ordering):
  8265. Change to return non-zero correctly.
  8266. (Output_section::Input_section_sort_section_order_index_compare
  8267. ::operator()): Change to fix ambiguity in comparisons.
  8268. 2010-06-01 Sriraman Tallam <tmsriram@google.com>
  8269. * gold.h (is_wildcard_string): New function.
  8270. * layout.cc (Layout::layout): Pass this pointer to add_input_section.
  8271. (Layout::layout_eh_frame): Ditto.
  8272. (Layout::find_section_order_index): New method.
  8273. (Layout::read_layout_from_file): New method.
  8274. * layout.h (Layout::find_section_order_index): New method.
  8275. (Layout::read_layout_from_file): New method.
  8276. (Layout::input_section_position_): New private member.
  8277. (Layout::input_section_glob_): New private member.
  8278. * main.cc (main): Call read_layout_from_file here.
  8279. * options.h (--section-ordering-file): New option.
  8280. * output.cc (Output_section::input_section_order_specified_): New
  8281. member.
  8282. (Output_section::Output_section): Initialize new member.
  8283. (Output_section::add_input_section): Add new parameter.
  8284. Keep input sections when --section-ordering-file is used.
  8285. (Output_section::set_final_data_size): Sort input sections when
  8286. section ordering file is specified.
  8287. (Output_section::Input_section_sort_entry): Add new parameter.
  8288. Check sorting type.
  8289. (Output_section::Input_section_sort_entry::compare_section_ordering):
  8290. New method.
  8291. (Output_section::Input_section_sort_compare::operator()): Change to
  8292. consider section_order_index.
  8293. (Output_section::Input_section_sort_init_fini_compare::operator()):
  8294. Change to consider section_order_index.
  8295. (Output_section::Input_section_sort_section_order_index_compare
  8296. ::operator()): New method.
  8297. (Output_section::sort_attached_input_sections): Change to sort
  8298. according to section order when specified.
  8299. (Output_section::add_input_section<32, true>): Add new parameter.
  8300. (Output_section::add_input_section<64, true>): Add new parameter.
  8301. (Output_section::add_input_section<32, false>): Add new parameter.
  8302. (Output_section::add_input_section<64, false>): Add new parameter.
  8303. * output.h (Output_section::add_input_section): Add new parameter.
  8304. (Output_section::input_section_order_specified): New
  8305. method.
  8306. (Output_section::set_input_section_order_specified): New method.
  8307. (Input_section::Input_section): Initialize section_order_index_.
  8308. (Input_section::section_order_index): New method.
  8309. (Input_section::set_section_order_index): New method.
  8310. (Input_section::section_order_index_): New member.
  8311. (Input_section::Input_section_sort_section_order_index_compare): New
  8312. struct.
  8313. (Output_section::input_section_order_specified_): New member.
  8314. * script-sections.cc (is_wildcard_string): Delete and move modified
  8315. method to gold.h.
  8316. (Output_section_element_input::Output_section_element_input): Modify
  8317. call to is_wildcard_string.
  8318. (Output_section_element_input::Input_section_pattern
  8319. ::Input_section_pattern): Ditto.
  8320. (Output_section_element_input::Output_section_element_input): Ditto.
  8321. * testsuite/Makefile.am (final_layout): New test case.
  8322. * testsuite/Makefile.in: Regenerate.
  8323. * testsuite/final_layout.cc: New file.
  8324. * testsuite/final_layout.sh: New file.
  8325. 2010-06-01 Rafael Espindola <espindola@google.com>
  8326. * plugin.cc (Plugin::load): Pass the output name to the plugin.
  8327. 2010-06-01 Rafael Espindola <espindola@google.com>
  8328. * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
  8329. visibility of symbols.
  8330. 2010-05-27 Doug Kwan <dougkwan@google.com>
  8331. * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
  8332. from start of output section instead of address for a local symbol
  8333. in a merged or relaxed section when doing a relocatable link.
  8334. 2010-05-26 Rafael Espindola <espindola@google.com>
  8335. PR 11604
  8336. * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
  8337. adding sections the garbage collector removed.
  8338. * gold/testsuite/Makefile.am: Add test.
  8339. * gold/testsuite/Makefile.in: Regenerate.
  8340. * gold/testsuite/plugin_test_7.sh: New.
  8341. * gold/testsuite/plugin_test_7_1.c: New.
  8342. * gold/testsuite/plugin_test_7_2.c: New.
  8343. 2010-05-26 Rafael Espindola <espindola@google.com>
  8344. * script-sections.cc (Output_section_definition::set_section_addresses):
  8345. Check for --section-start.
  8346. 2010-05-26 Doug Kwan <dougkwan@google.com>
  8347. * arm.cc (Arm_scan_relocatable_relocs): New class.
  8348. (Target_arm::relocate_special_relocatable): New method.
  8349. (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
  8350. (Arm_relocate_functions::thumb_branch_common): Same.
  8351. (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
  8352. instead of Default_scan_relocatable_relocs.
  8353. * target-reloc.h (relocate_for_relocatable): Let target handle
  8354. relocation strategy Relocatable_relocs::RELOC_SPECIAL.
  8355. * target.h (Sized_target::relocate_special_relocatable): New method.
  8356. 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  8357. * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
  8358. 2010-05-23 Doug Kwan <dougkwan@google.com>
  8359. * arm.cc (Arm_input_section::do_output_offset): Use convert_types
  8360. instead of a cast.
  8361. (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
  8362. with a direct branch, not a conditional branch, to a stub.
  8363. * merge.cc (Output_merge_base::record_input_section): New method
  8364. defintion.
  8365. (Output_merge_data::do_add_input_section): Record input section if
  8366. keeps-input-sections flag is set.
  8367. (Output_merge_string::do_add_input_section): Ditto.
  8368. * merge.h (Output_merge_base::Output_merge_base): Initialize new data
  8369. members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
  8370. INPUT_SECTIONS_.
  8371. (Output_merge_base::keeps_input_sections,
  8372. Output_merge_base::set_keeps_input_sections,
  8373. Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
  8374. method definitions.
  8375. (Output_merge_base::Input_sections): New type declaration.
  8376. (Output_merge_base::input_sections_begin,
  8377. Output_merge_base::input_sections_end,
  8378. Output_merge_base::do_set_keeps_input_sections): New method definitions.
  8379. (Output_merge_base::bool keeps_input_sections_,
  8380. Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
  8381. Output_merge_base::input_sections_): New data members.
  8382. (Output_merge_data::do_set_keeps_input_sections): New method
  8383. defintion.
  8384. (Output_merge_string::do_set_keeps_input_sections): Ditto.
  8385. * output.cc (Output_section::Input_section::relobj): Move method
  8386. defintion from class declaration to here and handle merge sections.
  8387. (Output_section::Input_section::shndx): Ditto.
  8388. (Output_section::Output_section): Remove initializations of removed
  8389. data members and initialize new data member LOOKUP_MAPS_.
  8390. (Output_section::add_input_section): Set keeps-input-sections flag
  8391. for a newly created merge output section as appropriate. Adjust code
  8392. to use Output_section_lookup_maps class.
  8393. (Output_section::add_relaxed_input_section): Adjst code for lookup
  8394. maps code refactoring.
  8395. (Output_section::add_merge_input_section): Add a new parameter
  8396. KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
  8397. class. If adding input section to a newly created merge output
  8398. section fails, remove the new merge section.
  8399. (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
  8400. Adjust code for use of the Output_section_lookup_maps class.
  8401. (Output_section::find_merge_section): Ditto.
  8402. (Output_section::build_lookup_maps): New method defintion.
  8403. (Output_section::find_relaxed_input_section): Adjust code to use
  8404. Output_section_lookup_maps class.
  8405. (Output_section::get_input_sections): Export merge sections. Adjust
  8406. code to use Output_section_lookup_maps class.
  8407. (Output_section:::add_script_input_section): Adjust code to use
  8408. Output_section_lookup_maps class. Update lookup maps for merge
  8409. sections also.
  8410. (Output_section::discard_states): Use Output_section_lookup_maps.
  8411. (Output_section::restore_states): Same.
  8412. * output.h (Merge_section_properties): Move class defintion out of
  8413. Output_section.
  8414. (Output_section_lookup_maps): New class.
  8415. (Output_section::Input_section::is_merge_section): New method
  8416. defintion.
  8417. (Output_section::Input_section::relobj): Move defintion out of class
  8418. defintion. Declare method only.
  8419. (Output_section::Input_section::shndx): Ditto.
  8420. (Output_section::Input_section::output_merge_base): New method defintion.
  8421. (Output_section::Input_section::u2_.pomb): New union field.
  8422. (Output_section::Merge_section_by_properties_map,
  8423. Output_section::Output_section_data_by_input_section_map,
  8424. Output_section::Ouptut_relaxed_input_section_by_input_section_map):
  8425. Remove types.
  8426. (Output_section::add_merge_input_section): Add new parameter
  8427. KEEPS_INPUT_SECTIONS.
  8428. (Output_section::build_lookup_maps): New method declaration.
  8429. (Output_section::merge_section_map_,
  8430. Output_section::merge_section_by_properties_map_,
  8431. Output_section::relaxed_input_section_map_,
  8432. Output_section::is_relaxed_input_section_map_valid_): Remove data
  8433. members.
  8434. (Output_section::lookup_maps_): New data member.
  8435. 2010-05-21 Doug Kwan <dougkwan@google.com>
  8436. PR gold/11619
  8437. * arm.cc (Arm_input_section::do_output_offset): Add a cast to
  8438. avoid a compilation error.
  8439. 2010-05-19 Rafael Espindola <espindola@google.com>
  8440. * script-sections.cc (Output_section_definition::allocate_to_segment):
  8441. Update the phdrs_list even when the output section is NULL.
  8442. * testsuite/Makefile.am: Add test.
  8443. * testsuite/Makefile.in: Regenerate.
  8444. * testsuite/script_test_9.cc: New.
  8445. * testsuite/script_test_9.sh: New.
  8446. * testsuite/script_test_9.t: New.
  8447. 2010-05-19 Doug Kwan <dougkwan@google.com>
  8448. * arm.cc (Arm_input_section::original_size): New method.
  8449. (Arm_input_section::do_addralign): Add a cast.
  8450. (Arm_input_section::do_output_offset): Remove static cast.
  8451. (Arm_input_section::original_addralign,
  8452. Arm_input_section::original_size_): Change type to uint32_t.
  8453. (Arm_input_section::init): Add safe casts for section alignment
  8454. and size.
  8455. (Arm_input_section::set_final_data_size): Do not set address and
  8456. offset of stub table.
  8457. (Arm_output_section::fix_exidx_coverage): Change use of of
  8458. Output_section::Simple_input_section to that of
  8459. Output_section::Input_section.
  8460. (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
  8461. except for the first pass.
  8462. * output.cc (Output_section::get_input_sections): Change type of
  8463. input_sections to std::list<Input_section>.
  8464. (Output_section::add_script_input_section): Rename from
  8465. Output_section::add_simple_input_section. Change type of SIS
  8466. parameter from Simple_input_section to Input_section.
  8467. * output.h (Output_section::Simple_input_section): Remove class.
  8468. (Output_section::Input_section): Change class visibility to public.
  8469. (Output_section::Input_section::addralign): Use stored alignments
  8470. for special input sections if set.
  8471. (Output_section::Input_section::set_addralign): New method.
  8472. (Output_section::get_input_sections): Change parameter type from
  8473. list of Simple_input_section to list of Input_section.
  8474. (Output_section::add_script_input_section): Rename from
  8475. Output_section::add_simple_input_section. Change first parameter's
  8476. type from Simple_input_section to Input_section and remove the
  8477. second and third parameters.
  8478. * script-sections.cc (Input_section::Input_section_list): Change
  8479. type to list of Output_section::Input_section/
  8480. (Input_section_info::Input_section_info): Change parameter type of
  8481. INPUT_SECTION to Output_section::Input_section.
  8482. (Input_section_info::input_section): Change return type.
  8483. (Input_section_info::input_section_): Change type to
  8484. Output_section::Input_section.
  8485. (Output_section_element_input::set_section_addresses): Adjust code
  8486. to use Output_section::Input_section instead of
  8487. Output_section::Simple_input_section. Adjust code for renaming
  8488. of Output_section::add_simple_input_section.
  8489. (Orphan_output_section::set_section_addresses): Ditto.
  8490. 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  8491. * gold.h (Unordered_multimap, Unordered_map): Fix defines for
  8492. when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
  8493. 2010-05-18 Rafael Espindola <espindola@google.com>
  8494. * options.cc (General_options::finalize): Handle -nostdlib.
  8495. * options.h (nostdlib): New option.
  8496. * script.cc (script_add_search_dir): Handle -nostdlib.
  8497. 2010-05-12 Doug Kwan <dougkwan@google.com>
  8498. * arm.cc (Target_arm::do_finalize_sections): Create an empty
  8499. attributes section only if there no attributes section after merging.
  8500. (Target_arm::merge_object_attributes): Move value of
  8501. Tag_MPextension_use_legacy to that of Tag_MPextension_use.
  8502. Handle Tag_DIV_use and Tag_MPextension_use_legacy.
  8503. * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
  8504. (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
  8505. and arm_attr_merge_7.stdout.
  8506. (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
  8507. arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
  8508. arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
  8509. arm_attr_merge_7b.o): New rules.
  8510. (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
  8511. arm_attr_merge_7
  8512. * testsuite/Makefile.in: Regenerate.
  8513. * testsuite/arm_attr_merge.sh: New file.
  8514. * testsuite/arm_attr_merge_[67][ab].s: Same.
  8515. 2010-05-05 Nick Clifton <nickc@redhat.com>
  8516. * po/es.po: Updated Spanish translation.
  8517. 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
  8518. * Makefile.am (install-exec-local): Properly install gold as
  8519. default cross linker.
  8520. * Makefile.in: Regenerated.
  8521. 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
  8522. Nick Clifton <nickc@redhat.com>
  8523. * configure.ac (install_as_default): Define and set to false
  8524. unless --enable-gold or --enable-gold=both/gold has been
  8525. specified.
  8526. * configure: Regenerate.
  8527. * Makefile.am (install-exec-local): Install the executable as
  8528. 'ld.gold'. If install_as_default is true then also install it as
  8529. 'ld'.
  8530. * Makefile.in: Regenerated.
  8531. 2010-04-24 Ian Lance Taylor <iant@google.com>
  8532. * layout.cc (Layout::layout_reloc): In relocatable link don't
  8533. combine reloc sections for grouped sections.
  8534. 2010-04-23 Sriraman Tallam <tmsriram@google.com>
  8535. * gc.h (gc_process_relocs): Pass information on relocs pointing to
  8536. sections that are not ordinary to icf.
  8537. * icf.cc (get_section_contents): Handle relocation pointing to section
  8538. with no object or shndx information.
  8539. * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
  8540. * testsuite/Makefile.in: Regenerate.
  8541. * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
  8542. * testsuite/icf_virtual_function_folding_test.sh: Delete file.
  8543. 2010-04-22 Ian Lance Taylor <iant@google.com>
  8544. * expression.cc (Expression::Expression_eval_info): Add
  8545. result_alignment_pointer field.
  8546. (Expression::eval_with_dot): Add result_alignment_pointer
  8547. parameter. Change all callers.
  8548. (Expression::eval_maybe_dot): Likewise.
  8549. (class Binary_expression): Add alignment_pointer parameter to
  8550. left_value and right_value. Change all callers.
  8551. (BINARY_EXPRESSION): Set result alignment.
  8552. (class Trinary_expression): Add alignment_pointer parameter to
  8553. arg2_value and arg3_value. Change all callers.
  8554. (Trinary_cond::value): Set result alignment.
  8555. (Max_expression::value, Min_expression::value): Likewise.
  8556. (Align_expression::value): Likewise.
  8557. * script-sections.cc (class Sections_element): Add dot_alignment
  8558. parameter to set_section_addresses virtual function. Update
  8559. instantiations.
  8560. (class Output_section_element): Likewise.
  8561. (Script_sections::create_segments): Add dot_alignment parameter.
  8562. Change all callers.
  8563. (Script_sections::create_segments_from_phdrs_clause): Likewise.
  8564. (Script_sections::set_phdrs_clause_addresses): Likewise.
  8565. * script-sections.h: Update declarations.
  8566. * script.h: Update declarations.
  8567. * output.h (Output_segment::set_minimum_p_align): Don't decrease
  8568. min_p_align.
  8569. * testsuite/script_test_3.t: Set large alignment.
  8570. * testsuite/script_test_3.sh: Make sure that at least one LOAD
  8571. segment has expected alignment.
  8572. 2010-04-22 Nick Clifton <nickc@redhat.com>
  8573. * po/gold.pot: Updated by the Translation project.
  8574. * po/vi.po: Updated Vietnamese translation.
  8575. 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
  8576. * testsuite/Makefile.am (check_PROGRAMS): Add
  8577. icf_virtual_function_folding_test.
  8578. * testsuite/Makefile.in: Regenerated.
  8579. 2010-04-15 Andrew Haley <aph@redhat.com>
  8580. * options.h (merge_exidx_entries): New option.
  8581. * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
  8582. (class Arm_exidx_fixup::merge_exidx_entries_): New member.
  8583. (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
  8584. (Target_arm::merge_exidx_entries): New function.
  8585. (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
  8586. (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
  8587. to Arm_exidx_fixup constructor.
  8588. Add new arg, merge_exidx_entries.
  8589. (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
  8590. Arm_output_section::fix_exidx_coverage.
  8591. 2010-04-18 Sriraman Tallam <tmsriram@google.com>
  8592. * icf.cc (get_section_contents): Check for preemptible functions.
  8593. Ignore addend when appropriate.
  8594. * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
  8595. section folded.
  8596. (add_from_relobj): Check for section folded.
  8597. (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
  8598. * symtab.h (should_add_dynsym_entry): Add new parameter.
  8599. * target-reloc.h (scan_relocs): Check for section folded.
  8600. * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
  8601. Check reloc types for function pointers in shared objects.
  8602. * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
  8603. case.
  8604. (icf_preemptible_functions_test): New test case.
  8605. (icf_string_merge_test): New test case.
  8606. * testsuite.Makefile.in: Regenerate.
  8607. * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
  8608. bar_glob. Refactor code.
  8609. * testsuite/icf_preemptible_functions_test.cc: New file.
  8610. * testsuite/icf_preemptible_functions_test.sh: New file.
  8611. * testsuite/icf_string_merge_test.cc: New file.
  8612. * testsuite/icf_string_merge_test.sh: New file.
  8613. * testsuite/icf_virtual_function_folding_test.cc: New file.
  8614. * testsuite/icf_virtual_function_folding_test.sh: New file.
  8615. 2010-04-14 Doug Kwan <dougkwan@google.com>
  8616. * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
  8617. for local symbol recounting if we remove a section due to ICF.
  8618. * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
  8619. there are no regular objects in input.
  8620. 2010-04-13 Doug Kwan <dougkwan@google.com>
  8621. * arm.cc (Arm_input_section::set_final_data_size): Compute
  8622. accurate final data size instead of using current data size.
  8623. 2010-04-09 Doug Kwan <dougkwan@google.com>
  8624. * layout.cc (Layout::choose_output_section): Handle script section
  8625. types.
  8626. (Layout::make_output_section_for_script): Add section type parameter.
  8627. Handle script section types.
  8628. * layout.h (Layout::make_output_section_for_script): Add section
  8629. type parameter.
  8630. * output.cc (Output_section::Output_section): Initialize data member
  8631. is_noload_.
  8632. (Output_section::do_reset_address_and_file_offset): Do not set address
  8633. to 0 if section is a NOLOAD section.
  8634. * output.h (Output_section::is_noload): New method.
  8635. (Output_section::set_is_noload): Ditto.
  8636. (Output_section::is_noload_): New data member.
  8637. * script-c.h (Script_section_type): New enum type.
  8638. (struct Parser_output_section_header): Add new file section_type.
  8639. * script-sections.cc (Sections_element::output_section_name): Add
  8640. parameter for returning script section type.
  8641. (Output_section_definition::output_section_name): Ditto.
  8642. (Output_section_definition::section_type)P; New method.
  8643. (Output_section_definiton::script_section_type_name): Ditto.
  8644. (Output_section_definition::script_section_type_): New data member.
  8645. (Output_section_definition::Output_section_definition): Initialize
  8646. data member Output_section_definition::script_section_type_.
  8647. (Output_section_definition::create_sections): Pass script section type
  8648. to Layout::make_output_section_for_script.
  8649. (Output_section_definition::output_section_name): Return script
  8650. section type to caller.
  8651. (Output_section_definition::set_section_address): Do not advance
  8652. dot value and load address if section type is NOLOAD. Set address
  8653. of NOLOAD sections regardless of section flags.
  8654. (Output_section_definition::print): Print section type if it is
  8655. not SCRIPT_SECTION_TYPE_NONE.
  8656. (Output_section_definition::section_type): New method.
  8657. (Output_section_definition::script_section_type_name): Ditto.
  8658. (Script_sections::output_section_name): Add new parameter
  8659. PSECTION_TYPE for returning script section type. Pass it to
  8660. section elements. Handle discard sections.
  8661. (Sort_output_sections::operator()): Handle NOLOAD sections.
  8662. * script-sections.h (Script_sections::Section_type): New enum type.
  8663. (Script_sections::output_section_name): Add a new parameter for
  8664. returning script section type.
  8665. * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
  8666. INFO and NOLOAD.
  8667. * yyscript.y (union): Add new field SECTION_TYPE.
  8668. (COPY, DSECT, INFO, NOLOAD): New tokens.
  8669. (opt_address_and_section_type): Change type to output_section_header.
  8670. (section_type): New non-terminal
  8671. (section_header): Handle section type.
  8672. (opt_address_and_section_type): Return section type value.
  8673. 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
  8674. * testsuite/plugin_common_test_1.c (foo): Add prototype.
  8675. * testsuite/plugin_common_test_2.c (foo): Likewise.
  8676. 2010-04-08 Doug Kwan <dougkwan@google.com>
  8677. * merge.cc (Output_merge_data::set_final_data_size): Handle empty
  8678. Output_merge_data.
  8679. * output.cc (Output_section::add_merge_input_section): Simplify
  8680. code and return status of Output_merge_base::add_input_section.
  8681. Update merge section map only if Output_merge_base::add_input_section
  8682. returns true.
  8683. 2010-04-07 Doug Kwan <dougkwan@google.com>
  8684. * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
  8685. if section is marked as containing instructions but has no mapping
  8686. symbols.
  8687. (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
  8688. correct section index.
  8689. (Arm_relobj::find_linked_text_section): Ditto.
  8690. 2010-04-07 Cary Coutant <ccoutant@google.com>
  8691. * archive.cc (include_member): Destroy Read_symbols_data object before
  8692. releasing file.
  8693. * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
  8694. * object.h (Read_symbols_data::Read_symbols_data) New constructor.
  8695. (Read_symbols_data::~Read_symbols_data) New destructor.
  8696. (Section_relocs::Section_relocs) New constructor.
  8697. (Section_relocs::~Section_relocs) New destructor.
  8698. (Read_relocs_data::Read_relocs_data) New constructor.
  8699. (Read_relocs_data::~Read_relocs_data) New destructor.
  8700. * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
  8701. pointers to NULL after deleting.
  8702. 2010-04-07 Doug Kwan <dougkwan@google.com>
  8703. * arm.cc: Replace "endianity" with "endianness" in comments.
  8704. (Arm_exidx_cantunwind): Ditto.
  8705. (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
  8706. (Arm_relobj::merge_flags_and_attributes): New method.
  8707. (Arm_relobj::merge_flags_and_attributes_): New data member.
  8708. (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
  8709. (Arm_relobj::scan_sections_for_stubs): Ditto.
  8710. (Arm_relobj::do_read_symbols): Check to see if we really want to
  8711. merge processor-specific flags and attributes. Exit early if
  8712. an object is empty except for section names and the undefined symbol.
  8713. (Target_arm::do_finalize_sections): Move check for ELF format to
  8714. Arm_relobj::do_read_symbols. Merge processor specific flags and
  8715. attributes from a regular object only when we have determined that
  8716. it is aapropriate. Do not create an .ARM.attributes section in
  8717. output if there is no regular input object.
  8718. (Target_arm::merge_processor_specific_flags): Check
  8719. --warn-mismatch before printing any error.
  8720. (Target_arm::merge_object_attributes): Ditto.
  8721. * gold.cc (queue_middle_tasks): Handle the case in which there is
  8722. no regular object in input.
  8723. * options.cc (General_options::parse_EB): New method.
  8724. (General_options::parse_EL): Same.
  8725. (General_options::General_options): Initialize endianness_.
  8726. * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
  8727. New options.
  8728. (General_options::Endianness): New enum.
  8729. (General_options::endianness): New method.
  8730. (General_options::endianness_): New data member.
  8731. * parameters.cc (Parameters::set_options): Check target endianness.
  8732. (Parameters::set_target_once): Ditto.
  8733. (Parameters::check_target_endianness): New method.
  8734. (parameters_force_valid_target): If either -EL or -EB is specified,
  8735. use it to define endianness of default target.
  8736. * parameters.h (Parameters::check_target_endianness): New method
  8737. declaration.
  8738. * target.h (class Target): Change "endianity" to "endianness"
  8739. in comments.
  8740. 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  8741. * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
  8742. * configure: Regenerate.
  8743. * Makefile.in: Regenerate.
  8744. * testsuite/Makefile.in: Regenerate.
  8745. 2010-04-06 Cary Coutant <ccoutant@google.com>
  8746. gcc PR lto/42757
  8747. * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
  8748. prevailing definitions of common symbols.
  8749. * testsuite/plugin_test_6.sh: New test case.
  8750. * testsuite/plugin_common_test_1.c: New test case.
  8751. * testsuite/plugin_common_test_2.c: New test case.
  8752. * testsuite/Makefile.am (plugin_test_6): New test case.
  8753. * testsuite/Makefile.in: Regenerate.
  8754. 2010-04-06 Nick Clifton <nickc@redhat.com>
  8755. * po/vi.po: New Vietnamese translation.
  8756. 2010-03-30 Doug Kwan <dougkwan@google.com>
  8757. * arm.cc (Target_arm::using_thumb_only): Handle v6-M
  8758. 2010-03-25 Doug Kwan <dougkwan@google.com>
  8759. * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
  8760. to avoid a conversion warning on a 32-bit host.
  8761. 2010-03-24 Ian Lance Taylor <iant@google.com>
  8762. * testsuite/script_test_3.t: Add a TLS segment.
  8763. * testsuite/Makefile.am (check_PROGRAMS): Add
  8764. tls_phdrs_script_test.
  8765. (tls_phdrs_script_test_SOURCES): Define.
  8766. (tls_phdrs_script_test_DEPENDENCIES): Define.
  8767. (tls_phdrs_script_test_LDFLAGS): Define.
  8768. (tls_phdrs_script_test_LDADD): Define.
  8769. * testsuite/Makefile.in: Rebuild.
  8770. 2010-03-23 Cary Coutant <ccoutant@google.com>
  8771. * fileread.cc (find_or_make_view): Fix comment.
  8772. 2010-03-23 Ian Lance Taylor <iant@google.com>
  8773. * script-sections.cc (class Orphan_section_placement): Define
  8774. PLACE_TLS and PLACE_TLS_BSS.
  8775. (Orphan_section_placement::Orphan_section_placement): Initialize
  8776. new places.
  8777. (Orphan_section_placement::find_place): Handle SHF_TLS sections.
  8778. * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
  8779. (tls_script_test_SOURCES): Define.
  8780. (tls_script_test_DEPENDENCIES): Define.
  8781. (tls_script_test_LDFLAGS): Define.
  8782. (tls_script_test_LDADD): Define.
  8783. * testsuite/Makefile.in: Rebuild.
  8784. 2010-03-22 Doug Kwan <dougkwan@google.com>
  8785. * arm.cc (Arm_relocate_functions::abs8,
  8786. Arm_relocate_functions::abs16): Use correct check for overflow
  8787. specified in the ARM ELF specs.
  8788. (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
  8789. target of a BLX instruction specially.
  8790. (Reloc_stub::stub_type_for_reloc): Ditto.
  8791. (Relocate::relocate): Use symbolic names instead of numeric relocation
  8792. codes to report error.
  8793. (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
  8794. workaround.
  8795. * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
  8796. thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
  8797. thumb2_blx_out_of_range.stdout
  8798. (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
  8799. thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
  8800. (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
  8801. thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
  8802. thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
  8803. thumb2_blx_in_range, thumb2_blx_in_range.o,
  8804. thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
  8805. thumb2_blx_out_of_range.o): New rules.
  8806. (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
  8807. thumb2_blx_in_range and thumb2_blx_out_of_range.
  8808. * testsuite/Makefile.in: Regenerate.
  8809. * arm_branch_in_range.sh: Add tests for THUMB BLX.
  8810. * testsuite/thumb_blx_in_range.s: New file.
  8811. * testsuite/thumb_blx_out_of_range.s: New file.
  8812. 2010-03-22 Rafael Espindola <espindola@google.com>
  8813. * archive.cc (Should_include): Move to archive.h.
  8814. (should_include_member): Make it a member of Archive.
  8815. (Lib_group): New.
  8816. (Add_lib_group_symbols): New.
  8817. * archive.h: Include options.h.
  8818. (Archive_member): Moved from Archive.
  8819. (Should_include): Moved from archive.cc.
  8820. (Lib_group): New.
  8821. (Add_lib_group_symbols): New.
  8822. * dynobj.cc (do_should_include_member): New.
  8823. * dynobj.h (do_should_include_member): New.
  8824. * gold.cc (queue_initial_tasks): Update call to queue.
  8825. * main.cc (main): Print lib group stats.
  8826. * object.cc (do_should_include_member): New.
  8827. * object.h: Include archive.h.
  8828. (Object::should_include_member): New.
  8829. (Object::do_should_include_member): New.
  8830. (Sized_relobj::do_should_include_member): New.
  8831. * options.cc (General_options::parse_start_lib): New.
  8832. (General_options::parse_end_lib): New.
  8833. (Input_arguments::add_file): Handle lib groups.
  8834. (Input_arguments::start_group): Check we are not in a lib.
  8835. (Input_arguments::start_lib): New.
  8836. (Input_arguments::end_lib): New.
  8837. * options.h (General_options): Add start_lib and end_lib.
  8838. (Input_argument::lib_): New.
  8839. (Input_argument::lib): New.
  8840. (Input_argument::is_lib): New.
  8841. (Input_file_lib): New.
  8842. (Input_arguments::in_lib_): New.
  8843. (Input_arguments::in_lib): New.
  8844. (Input_arguments::start_lib): New.
  8845. (Input_arguments::end_lib_): New.
  8846. * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
  8847. in unused members as preempted.
  8848. (Sized_pluginobj::do_should_include_member): New.
  8849. * plugin.h (Sized_pluginobj::do_should_include_member): New.
  8850. * readsyms.cc (Read_symbols::locks): If we are just reading a member,
  8851. return the blocker.
  8852. (Read_symbols::do_whole_lib_group): New.
  8853. (Read_symbols::do_lib_group): New.
  8854. (Read_symbols::do_read_symbols): Handle lib groups.
  8855. (Read_symbols::get_name): Handle lib groups.
  8856. * readsyms.h (Read_symbols): Add an archive member pointer.
  8857. (Read_symbols::do_whole_lib_group): New.
  8858. (Read_symbols::do_lib_group): New.
  8859. (Read_symbols::member_): New.
  8860. * script.cc (read_input_script): Update call to queue_soon.
  8861. 2010-03-19 Doug Kwan <dougkwan@google.com>
  8862. * arm.cc (Stub_table::Stub_table): Initialize new data members
  8863. Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
  8864. (Stub_table::add_reloc_stub): Assign stub offset and update
  8865. Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
  8866. (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
  8867. New data members.
  8868. (Stub_table::update_data_size_and_addralign): Use
  8869. Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
  8870. instead of going over all reloc stubs.
  8871. (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
  8872. * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
  8873. Stringpool_template::offset_ to size of Stringpool_char.
  8874. (Stringpool_template::new_key_offset): Remove code to initialize
  8875. Stringpool_template::offset_.
  8876. * stringpool.h (Stringpool_template::set_no_zero_null): Set
  8877. Stringpool_template::offset_ to zero.
  8878. 2010-03-15 Doug Kwan <dougkwan@google.com>
  8879. * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
  8880. offset_.
  8881. (Stringpool_template::new_key_offset): New method.
  8882. (Stringpool_template::add_string): Assign offsets when adding new
  8883. strings.
  8884. (Stringpool_template::set_string_offsets): Do not set string offsets
  8885. when not optimizing.
  8886. * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
  8887. member size_.
  8888. (Chunked_vector::clear): Clear size_.
  8889. (Chunked_vector::reserve): Call reserve method of all Element_vectors.
  8890. (Chunked_vector::size): Return size_.
  8891. (Chunked_vector::push_back): Use size_ to find insert position.
  8892. (Chunked_vector::size_): New data member.
  8893. (Stringpool_template::set_no_zero_null): Assert string set is empty.
  8894. (Stringpool_template::new_key_offset): New method declaration.
  8895. (Stringpool_template::offset_): New data member.
  8896. 2010-03-15 Rafael Espindola <espindola@google.com>
  8897. * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
  8898. Add_symbols' constructor.
  8899. * readsyms.h (Add_symbols): Remove the input_group member.
  8900. 2010-03-10 Ian Lance Taylor <iant@google.com>
  8901. * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
  8902. target to ask whether a reference to a symbol requires a stack
  8903. split.
  8904. * target.h (Target::is_call_to_non_split): New function.
  8905. (Target::do_is_call_to_non_split): Declare virtual function.
  8906. * target.cc: Include "symtab.h".
  8907. (Target::do_is_call_to_non_split): New function.
  8908. * i386.cc (Target_i386::do_is_call_to_non_split): New function.
  8909. 2010-03-10 Cary Coutant <ccoutant@google.com>
  8910. * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
  8911. (File_read::open[1]): Remove initial mapping of whole_file_view_.
  8912. (File_read::open[2]): Add whole_file_view_ to list of views.
  8913. (File_read::make_view): Remove test of whole_file_view_.
  8914. (File_read::find_or_make_view): Create whole_file_view_ if
  8915. necessary.
  8916. (File_read::clear_views): Replace bool parameter with enum;
  8917. adjust all callers. Don't delete views with permanent data;
  8918. do delete cached views and views from archives if
  8919. --no-keep-files-mapped is set. Set whole_file_view_ to NULL
  8920. if clearing the corresponding view.
  8921. * fileread.h (File_read::Clear_views_mode): New enum.
  8922. (File_read::View::is_permanent_view): New method.
  8923. (File_read::clear_views): Replace bool parameter
  8924. with enum; adjust all callers.
  8925. * options.h (General_options): Change keep_files_mapped option;
  8926. add map_whole_files.
  8927. * readsyms.cc (Add_symbols::run): Delete sd_ object before
  8928. releasing the file.
  8929. * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
  8930. the file.
  8931. 2010-03-10 David S. Miller <davem@davemloft.net>
  8932. * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
  8933. 2010-03-09 Sriraman Tallam <tmsriram@google.com>
  8934. * icf.cc (get_section_contents): Add '@' marker after processing the
  8935. merge reloc.
  8936. 2010-03-08 Doug Kwan <dougkwan@google.com>
  8937. * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
  8938. due to a conversion warning.
  8939. (Arm_relobj::update_output_local_symbol_count): Check for local
  8940. symbol with unset output index.
  8941. 2010-03-05 Ian Lance Taylor <iant@google.com>
  8942. * options.h (class General_options): Add --spare-dynamic-tags.
  8943. * output.cc (Output_data_dynamic::set_final_data_size): Implement
  8944. --spare-dynamic-tags.
  8945. 2010-03-05 Ian Lance Taylor <iant@google.com>
  8946. * incremental.cc: Include "libiberty.h".
  8947. 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
  8948. * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
  8949. function, is_info_ member.
  8950. * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
  8951. (Versions::Versions): Update caller.
  8952. (Versions::define_base_version): Likewise.
  8953. (Versions::add_def): Likewise.
  8954. 2010-03-03 Sriraman Tallam <tmsriram@google.com>
  8955. * i386.cc (Target_i386::can_check_for_function_pointers): New function.
  8956. (Scan::possible_function_pointer_reloc): New function.
  8957. (Scan::local_reloc_may_be_function_pointer): Change to call
  8958. possible_function_pointer_reloc.
  8959. (Scan::global_reloc_may_be_function_pointer): Ditto.
  8960. * icf.h (Icf::check_section_for_function_pointers): Change to reject
  8961. relocations in ".data.rel.ro._ZTV" section.
  8962. * testsuite/icf_safe_so_test.sh: Change to pass i386.
  8963. * testsuite/icf_safe_so_test.cc: Ditto.
  8964. * testsuite/icf_safe_test.cc: Ditto.
  8965. * testsuite/icf_safe_test.sh: Ditto.
  8966. 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  8967. Ian Lance Taylor <iant@google.com>
  8968. * target-reloc.h (relocate_section): Check the symbol table index
  8969. for -1U before setting the local symbol index.
  8970. (scan_relocatable_relocs): If copying the relocation, record that
  8971. the local symbol is required.
  8972. * object.h (Symbol_value::is_output_symtab_index_set): New
  8973. function.
  8974. (Symbol_value::may_be_discarded_from_output_symtab): New
  8975. function.
  8976. (Symbol_value::has_output_symtab_entry): New function.
  8977. (Symbol_value::needs_output_symtab_entry): Remove.
  8978. (Symbol_value::output_symtab_index): Make sure the symbol index is
  8979. set.
  8980. (Symbol_value::set_output_symtab_index): Make sure the symbol
  8981. index is not set. Make sure the new index is valid.
  8982. (Symbol_value::set_must_have_output_symtab_entry): New function.
  8983. (Symbol_value::has_output_dynsym_entry): New function.
  8984. (Symbol_value::set_output_dynsym_index): Make sure the new index
  8985. is valid.
  8986. (Sized_relobj::set_must_have_output_symtab_entry): New function.
  8987. * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
  8988. local symbol if permitted.
  8989. (Sized_relobj::do_finalize_local_symbols): Call
  8990. is_output_symtab_index_set rather than needs_output_symtab_entry.
  8991. (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
  8992. rather than needs_output_symtab_entry. Call
  8993. has_output_dynsym_entry rather than needs_output_dynsym_entry.
  8994. * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
  8995. is_output_symtab_index_set rather than needs_output_symtab_entry.
  8996. * testsuite/discard_locals_relocatable_test.c: New file.
  8997. * testsuite/discard_locals_test.sh: Test -r.
  8998. * testsuite/Makefile.am (check_DATA): Add
  8999. discard_locals_relocatable_test1.syms,
  9000. discard_local_relocatable_test2.syms.
  9001. (MOSTLYCLEANFILES): Likewise. Also add
  9002. discard_locals_relocatable_test1.lout and
  9003. discard_locals_relocatable_test2.out.
  9004. (discard_locals_relocatable_test1.syms): New target.
  9005. (discard_locals_relocatable_test.o): New target.
  9006. (discard_locals_relocatable_test1.out): New target.
  9007. (discard_locals_relocatable_test2.syms): New target.
  9008. (discard_locals_relocatable_test2.out): New target.
  9009. (various): Add missing ../ld-new dependencies.
  9010. * testsuite/Makefile.in: Rebuild.
  9011. 2010-03-03 Nick Clifton <nickc@redhat.com>
  9012. * po/fi.po: New Finnish translation.
  9013. 2010-03-01 Doug Kwan <dougkwan@google.com>
  9014. * layout.cc (Layout::Layout): Force section types of .init_array*,
  9015. .preinit_array* and .fini_array* sections.
  9016. * output.cc (Output_section::Input_section_sort_entry::has_priority):
  9017. Fix check of return value of std::string::find.().
  9018. (Output_section::Input_section_sort_compare::operator()): Remove
  9019. comment about .init_array.
  9020. (Output_section::Input_section_sort_init_fini_compare::operator()):
  9021. New method.
  9022. (Output_section::sort_attached_input_sections): Handle .init_array
  9023. and .fini_array specially.
  9024. * output.h (Output_section::Inut_section_sort_compare): Update
  9025. comment.
  9026. (Output_section::Input_section_sort_init_fini_compare): New struct.
  9027. 2010-02-26 Doug Kwan <dougkwan@google.com>
  9028. * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
  9029. R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
  9030. * testsuite/debug_msg.sh: Avoid matching source line number for
  9031. use of global variable undef_int.
  9032. 2010-02-26 Doug Kwan <dougkwan@google.com>
  9033. * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
  9034. R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
  9035. (Target_arm::scan_reloc_section_for_stubs): Instead of calling
  9036. scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
  9037. * options.cc (General_options::General_options): Initialize member
  9038. fix_v4bx_.
  9039. * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
  9040. (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
  9041. and rm_no_fix_v4bx.stdout
  9042. (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
  9043. arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
  9044. arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
  9045. (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
  9046. and arm_no_fix_v4bx.
  9047. * Makefile.in: Regenerate.
  9048. * testsuite/arm_fix_v4bx.s: New file.
  9049. * testsuite/arm_fix_v4bx.sh: Ditto.
  9050. 2010-02-24 Doug Kwan <dougkwan@google.com>
  9051. * arm.cc (Target_arm::got_section): Make the .got section the first
  9052. non RELRO section in the data segment.
  9053. * testsuite/script_test_5.sh: Fix match patterns to avoid matching
  9054. suffixes of section names.
  9055. 2010-02-24 Doug Kwan <dougkwan@google.com>
  9056. * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
  9057. flags and attributes merging if an input file is a binary file.
  9058. * fileread.cc (Input_file::open): Record format of original file.
  9059. * fileread.h (Input_file::Format): New enum type.
  9060. (Input_file::Input_file): Initialize data member format_.
  9061. (Input_file::format): New method definition.
  9062. (Input_file::format_):: New data member.
  9063. 2010-02-24 Doug Kwan <dougkwan@google.com>
  9064. * arm.cc (Arm_output_data_got): New class.
  9065. (ARM_TCB_SIZE): New constant
  9066. (Target_arm): Use Arm_output_data_got instead of Output_data_got.
  9067. (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
  9068. If user uses a script with a SECTIONS clause, issue only a warning
  9069. for a misplaced EXIDX input section. Otherwise, issue an error.
  9070. (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
  9071. garbage collection.
  9072. (Target_arm::got_mode_index_entry): Handle static linking.
  9073. (Target_arm::Scan::local): Ditto.
  9074. (Target_arm::Scan::global): Ditto.
  9075. (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
  9076. all incorrectly implemented relocations.
  9077. (Target_arm::fix_exidx_coverage): Pass layout to
  9078. Arm_output_section::fix_exidx_coverage.
  9079. * layout.cc (Layout::section_name_mapping): Remove trailing dots
  9080. from ".ARM.exidx." and ".ARM.extab.".
  9081. 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9082. * arm.cc (Target_arm::do_finalize_sections): Create attribute
  9083. section if it does not already exist.
  9084. * attributes.cc (Attributes_section_data::Attributes_section_data):
  9085. Don't crash if size is zero.
  9086. 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9087. Ian Lance Taylor <iant@google.com>
  9088. * gold.cc (queue_middle_tasks): If no input files were opened,
  9089. exit.
  9090. * workqueue.h (Task_function::Task_function): Assert that there is
  9091. a blocker.
  9092. 2010-02-22 Doug Kwan <dougkwan@google.com>
  9093. * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
  9094. * icf.cc (get_section_contents): Cast snprintf arguments to long long
  9095. types to avoid warnings due to different uint64_t implementations
  9096. on different hosts.
  9097. 2010-02-21 Doug Kwan <dougkwan@google.com>
  9098. * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
  9099. handling of the maximum backward branch offset.
  9100. (Arm_relocate_functions::thumb_branch_common): Ditto.
  9101. * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
  9102. (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
  9103. thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
  9104. thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
  9105. (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
  9106. arm_bl_out_of_range.stdout, arm_bl_out_of_range,
  9107. arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
  9108. thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
  9109. thumb_bl_out_of_range thumb_bl_out_of_range.o,
  9110. thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
  9111. thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
  9112. thumb2_bl_out_of_range.o): New rules.
  9113. (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
  9114. thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
  9115. thumb2_bl_out_of_range
  9116. * testsuite/Makefile.in: Regenerate.
  9117. * testsuite/arm_bl_in_range.s: New file.
  9118. * testsuite/arm_bl_out_of_range.s: Ditto.
  9119. * testsuite/arm_branch_in_range.sh: Ditto.
  9120. * testsuite/arm_branch_range.t: Ditto.
  9121. * testsuite/thumb2_branch_range.t: Ditto.
  9122. * testsuite/thumb_bl_in_range.s: Ditto.
  9123. * testsuite/thumb_bl_out_of_range.s: Ditto.
  9124. * testsuite/thumb_branch_range.t: Ditto.
  9125. 2010-02-20 Sriraman Tallam <tmsriram@google.com>
  9126. * gc.h (gc_process_relocs): Change vectors to point to the new list.
  9127. Add reloc offset information.
  9128. * icf.cc (get_section_contents): Change iterators to point to the new
  9129. vectors. Add reloc offset information to the contents.
  9130. * icf.h (Icf::Sections_reachable_info): New typedef.
  9131. (Icf::Sections_reachable_list): New typedef.
  9132. (Icf::Offset_info): New typedef.
  9133. (Icf::Reloc_info): New struct typedef.
  9134. (Icf::Reloc_info_list): New typedef.
  9135. (Icf::symbol_reloc_list): Delete method.
  9136. (Icf::addend_reloc_list): Delete method.
  9137. (Icf::section_reloc_list): Delete method.
  9138. (Icf::reloc_info_list): New method.
  9139. (Icf::reloc_info_list_): New member.
  9140. 2010-02-19 Doug Kwan <dougkwan@google.com>
  9141. * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
  9142. R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
  9143. * arm.cc (Arm_relocation_functions): New forward declaration.
  9144. (Target_arm::Target_arm): Initialize new data members
  9145. got_mod_index_offset_ and tls_base_symbol_defined_.
  9146. (Target_arm::Relocate::relocate_tls): New method.
  9147. (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
  9148. Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
  9149. New methods.
  9150. (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
  9151. GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
  9152. (Target_arm::got_mod_index_offset_,
  9153. Target_arm::tls_base_symbol_defined_): New data members.
  9154. (Target_arm::Scan::local, Target::Scan::global,
  9155. Target_arm::Relocate::relocate): Handle 32-bit initial TLS
  9156. relocations.
  9157. 2010-02-18 Doug Kwan <dougkwan@google.com>
  9158. * arm.cc (Arm_relobj::find_linked_text_section): New method.
  9159. (Arm_relobj::make_exidx_input_section): Pass section index of linked
  9160. text section as a parameter becuase some broken tools may not set
  9161. the link in section header.
  9162. (Target_arm::has_got_section): New method.
  9163. (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
  9164. without any mapping symbol as data only. Remove warning.
  9165. (Arm_relobj::do_read_synbols): If an EXIDX input section has no
  9166. link in its section header, try to discover the link by inspecting the
  9167. REL31 relocation at the beginning of the section.
  9168. (Target_arm::Scan::check_non_pic): Report name of offending relocation
  9169. in error message.
  9170. (Target_arm::Scan::global): Treat any reference to the symbol
  9171. _GLOBAL_OFFSET_TABLE_ as a GOT access.
  9172. 2010-02-12 Sriraman Tallam <tmsriram@google.com>
  9173. * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
  9174. (Scan::global_reloc_may_be_function_pointer): New function.
  9175. * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
  9176. (Scan::global_reloc_may_be_function_pointer): New function.
  9177. * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
  9178. (Scan::global_reloc_may_be_function_pointer): New function.
  9179. * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
  9180. (Scan::global_reloc_may_be_function_pointer): New function.
  9181. * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
  9182. (Scan::global_reloc_may_be_function_pointer): New function.
  9183. (Scan::possible_function_pointer_reloc): New function.
  9184. (Target_x86_64::can_check_for_function_pointers): New function.
  9185. * gc.h (gc_process_relocs): Scan relocation types to determine if
  9186. function pointers were taken for targets that support it.
  9187. * icf.cc (Icf::find_identical_sections): Include functions for
  9188. folding in safe ICF whose pointer is not taken.
  9189. * icf.h (Secn_fptr_taken_set): New typedef.
  9190. (fptr_section_id_): New member.
  9191. (section_has_function_pointers): New function.
  9192. (set_section_has_function_pointers): New function.
  9193. (check_section_for_function_pointers): New function.
  9194. * options.h: Fix comment for safe ICF option.
  9195. * target.h (can_check_for_function_pointers): New function.
  9196. * testsuite/Makefile.am: Add icf_safe_so_test test case.
  9197. Modify icf_safe_test for X86-64.
  9198. * testsuite/Makefile.in: Regenerate.
  9199. * testsuite/icf_safe_so_test.cc: New file.
  9200. * testsuite/icf_safe_so_test.sh: New file.
  9201. * testsuite/icf_safe_test.cc (kept_func_3): New function.
  9202. (main): Change to take pointer to function kept_func_3.
  9203. * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
  9204. folding is done correctly for X86-64.
  9205. 2010-02-12 David S. Miller <davem@davemloft.net>
  9206. * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
  9207. is_symbolless parameter.
  9208. (Output_reloc<SHT_REL>::is_symbolless): New.
  9209. (Output_reloc<SHT_REL>::is_symbolless_): New.
  9210. (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
  9211. (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
  9212. (Output_reloc<SHT_RELA>::is_symbolless): New.
  9213. (Output_data_reloc::add_global): Handle is_symbolless.
  9214. (Output_data_reloc::add_global_relative): Likewise.
  9215. (Output_data_reloc::add_local): Likewise.
  9216. (Output_data_reloc::add_local_relative): Likewise.
  9217. (Output_data_reloc::add_symbolless_global_addend): New.
  9218. (Output_data_reloc::add_symbolless_local_addend): New.
  9219. * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
  9220. is_symbolless.
  9221. (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
  9222. instead of ->is_relative_
  9223. (Output_reloc::write): Likewise.
  9224. (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
  9225. (Output_reloc::write_rel): Simplify.
  9226. * sparc.cc (Target_sparc::Scan::local): Use
  9227. ->add_symbolless_local_addend as needed.
  9228. (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
  9229. needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
  9230. based upon relocation offset.
  9231. 2010-02-11 Doug Kwan <dougkwan@google.com>
  9232. * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
  9233. (Target_arm::Scan::global): Ditto. Also remove a comment before the
  9234. beginning of function.
  9235. (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
  9236. and MOVT_ABS relocations. Those are non issued in scanning. Fix
  9237. parameter is_32bit in calls to should_apply_static_reloc.
  9238. * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
  9239. (check_DATA): Add arm_abs_global.stdout.
  9240. (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
  9241. arm_abs_global.stdout): New rules.
  9242. (MOSTLLYCLEANFILES): Add arm_abs_global
  9243. * Makefile.in: Regenerate.
  9244. * testsuite/arm_abs_global.s: New file.
  9245. * testsuite/arm_abs_global.sh: Ditto.
  9246. * testsuite/arm_abs_lib.s: Ditto.
  9247. 2010-02-11 Ian Lance Taylor <iant@google.com>
  9248. * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
  9249. Read_relocs task.
  9250. (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
  9251. Allocate_commons_task first.
  9252. * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
  9253. task, rather than symtab_lock_.
  9254. (Gc_process_relocs::~Gc_process_relocs): New function.
  9255. (Gc_process_relocs::is_runnable): Check this_blocker_.
  9256. (Gc_process_relocs::locks): Use next_blocker_ rather than
  9257. blocker_.
  9258. (Scan_relocs::~Scan_relocs): New function.
  9259. (Scan_relocs::is_runnable): Check this_blocker_ rather than
  9260. symtab_lock_.
  9261. (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
  9262. next_blocker_.
  9263. * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
  9264. fields. Add this_blocker_ and next_blocker_ fields. Adjust
  9265. constructor accordingly.
  9266. (class Gc_process_relocs): Likewise.
  9267. (class Scan_relocs): Likewise.
  9268. * common.h (class Allocate_commons_task): Remove symtab_lock_
  9269. field, and corresponding constructor parameter.
  9270. * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
  9271. symtab_lock_.
  9272. (Allocate_commons_task::locks): Likewise.
  9273. 2010-02-11 Ian Lance Taylor <iant@google.com>
  9274. * gold-threads.h (class Once): Define.
  9275. (class Initialize_lock): Rewrite as child of Once.
  9276. * gold-threads.cc (class Once_initialize): Define.
  9277. (once_pointer_control): New static variable.
  9278. (once_pointer, once_arg): New static variables.
  9279. (c_run_once): New static function.
  9280. (Once::Once, Once::run_once, Once::internal_run): New functions.
  9281. (class Initialize_lock_once): Remove.
  9282. (initialize_lock_control): Remove.
  9283. (initialize_lock_pointer): Remove.
  9284. (initialize_lock_once): Remove.
  9285. (Initialize_lock::Initialize_lock): Move to gold-threads.h.
  9286. (Initialize_lock::initialize): Rewrite.
  9287. (Initialize_lock::do_run_once): New function.
  9288. * archive.cc (Archive::interpret_header): Only clear name if it is
  9289. not already empty.
  9290. * fileread.cc: Include "gold-threads.h"
  9291. (file_counts_lock): New static variable.
  9292. (file_counts_initialize_lock): Likewise.
  9293. (File_read::release): Only increment counts when using --stats.
  9294. Use a lock around the increment.
  9295. * parameters.cc (class Set_parameters_target_once): Define.
  9296. (set_parameters_target_once): New static variable.
  9297. (Parameters::Parameters): Move here from parameters.h.
  9298. (Parameters::set_target): Rewrite.
  9299. (Parameters::set_target_once): New function.
  9300. (Parameters::clear_target): Move here and rewrite.
  9301. * parameters.h (class Parameters): Update declarations. Add
  9302. set_parameters_target_once_ field.
  9303. (Parameters::Parameters): Move to parameters.cc.
  9304. (Parameters::clear_target): Likewise.
  9305. * readsyms.cc (Read_symbols::do_group): Create a Start_group
  9306. task.
  9307. (Start_group::~Start_group): New function.
  9308. (Start_group::is_runnable): New function.
  9309. (Start_group::locks, Start_group::run): New functions.
  9310. (Finish_group::run): Change saw_undefined to size_t.
  9311. * readsyms.h (class Start_group): Define.
  9312. (class Finish_group): Change saw_undefined_ field to size_t.
  9313. (Finish_group::Finish_group): Remove saw_undefined and
  9314. this_blocker parameters. Change all callers.
  9315. (Finish_group::set_saw_undefined): New function.
  9316. (Finish_group::set_blocker): New function.
  9317. * symtab.h (class Symbol_table): Change saw_undefined to return
  9318. size_t. Change saw_undefined_ field to size_t.
  9319. * target-select.cc (Set_target_once::do_run_once): New function.
  9320. (Target_selector::Target_selector): Initialize set_target_once_
  9321. field. Don't initialize lock_ and initialize_lock_ fields.
  9322. (Target_selector::instantiate_target): Rewrite.
  9323. (Target_selector::set_target): New function.
  9324. * target-select.h (class Set_target_once): Define.
  9325. (class Target_selector): Update declarations. Make
  9326. Set_target_once a friend. Remove lock_ and initialize_lock_
  9327. fields. Add set_target_once_ field.
  9328. 2010-02-10 Ian Lance Taylor <iant@google.com>
  9329. * dirsearch.cc (Dirsearch::initialize): Add all blockers before
  9330. queueing any tasks.
  9331. * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
  9332. (queue_middle_tasks): Add all blockers before queueing any tasks.
  9333. (queue_final_tasks): Likewise.
  9334. * token.h (Task_token::add_blockers): New function.
  9335. * object.h (Input_objects::number_of_relobjs): New function.
  9336. 2010-02-10 Ian Lance Taylor <iant@google.com>
  9337. * i386.cc (Relocate::relocate_tls): A local symbol is final if not
  9338. shared, not if not position independent.
  9339. * x86_64.cc (Relocate::relocate_tls): Likewise.
  9340. * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
  9341. (tls_pie_pic_test): New target.
  9342. * testsuite/Makefile.in: Rebuild.
  9343. * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
  9344. (tls_test_main_pie.o, tls_test_pie.o): New targets.
  9345. (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
  9346. * testsuite/Makefile.in: Rebuild.
  9347. 2010-02-09 David S. Miller <davem@davemloft.net>
  9348. * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
  9349. R_SPARC_RELATIVE using ->add_local_relative().
  9350. (Target_sparc::Scan::global): Likewise for ->add_global_relative().
  9351. * output.h (Output_data_dynamic::add_section_size): New method
  9352. that takes two Output_data objects.
  9353. (Output_data_dynamic::Dynamic_entry): Create storage for secondary
  9354. entry param. Handle it in initializers.
  9355. * output.cc (Output_data_dynamic::Dynamic_entry::write): For
  9356. DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
  9357. * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
  9358. arg.
  9359. * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
  9360. and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
  9361. * arm.cc (Target_arm::do_finalize_sections): Update to pass false
  9362. for dynrel_includes_plt.
  9363. * i386.cc (Target_i386::do_finalize_sections): Likewise.
  9364. * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
  9365. * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
  9366. before .rela.plt
  9367. (Target_sparc::do_finalize_sections): Update to pass true for
  9368. dynrel_includes_plt.
  9369. * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
  9370. output before .rela.plt
  9371. (Target_powerpc::do_finalize_sections): Update to pass true for
  9372. dynrel_includes_plt when 32-bit.
  9373. 2010-02-08 Doug Kwan <dougkwan@google.com>
  9374. * arm.cc (Arm_relobj::simple_input_section_output_address): New
  9375. method.
  9376. (Arm_relobj::section_needs_cortex_a8_stub_scanning,
  9377. Arm_relobj::scan_section_for_cortex_a8_stubs,
  9378. Arm_relobj::do_relocation_section): Instead of calling
  9379. Output_section::output_address, use faster
  9380. Arm_relobj::simple_input_section_output_address.
  9381. 2010-02-08 David S. Miller <davem@davemloft.net>
  9382. * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
  9383. unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
  9384. relocation helper function.
  9385. * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
  9386. just like R_SPARC_GOT{10,13,22}.
  9387. (Target_sparc::Scan::local): Likewise.
  9388. (Target_sparc::Relocate:relocate): Likewise.
  9389. 2010-02-06 Ian Lance Taylor <iant@google.com>
  9390. * configure.ac: Rewrite targetobjs duplicate removal code to use
  9391. only shell constructs.
  9392. * configure: Rebuild.
  9393. 2010-02-05 Doug Kwan <dougkwan@google.com>
  9394. PR 11247
  9395. * arm.cc (Arm_relobj::section_is_scannable): New method.
  9396. (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
  9397. (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
  9398. 2010-02-04 Doug Kwan <dougkwan@google.com>
  9399. PR 11247
  9400. * arm-reloc-property.cc (cstdio): Include.
  9401. * configure.ac (targetobjs): Remove duplicates.
  9402. * configure: Regenerate.
  9403. * resolve.cc (Symbol_table::resolve): Explicit instantiate both
  9404. big and little endian version for a given address size.
  9405. 2010-02-03 Doug Kwan <dougkwan@google.com>
  9406. * arm-reloc-property.cc
  9407. (Arm_reloc_property_table::reloc_name_in_error_message): New method
  9408. definition.
  9409. * arm-reloc-property.h
  9410. (Arm_reloc_property_table::get_implemented_static_reloc_property):
  9411. New method definition.
  9412. (Arm_reloc_property_table::reloc_name_in_error_message): New method
  9413. declaration.
  9414. * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
  9415. overflow to N.
  9416. (GOT_PREL): Change implemented to Y.
  9417. * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
  9418. (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
  9419. (Arm_relocate_functions::movw_abs_nc): Remove method.
  9420. (Arm_relocate_functions::movt_abs): Ditto.
  9421. (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
  9422. (Arm_relocate_functions::thm_movt_abs): Ditto.
  9423. (Arm_relocate_functions::movw_rel_nc): Ditto.
  9424. (Arm_relocate_functions::movw_rel): Ditto.
  9425. (Arm_relocate_functions::movt_rel): Ditto.
  9426. (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
  9427. (Arm_relocate_functions:thm_movw_rel): Ditto.
  9428. (Arm_relocate_functions:thm_movt_rel): Ditto.
  9429. (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
  9430. (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
  9431. New method definitions.
  9432. (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
  9433. (Arm_relocation_functions::arm_grp_ldr): Ditto.
  9434. (Arm_relocation_functions::arm_grp_ldrs): Ditto.
  9435. (Arm_relocation_functions::arm_grp_ldc): Ditto.
  9436. (Target_arm::Relocate::relocate): Check for non-static or
  9437. unimplemented relocation code and exit early. Change calls to
  9438. Target_arm::reloc_uses_thumb_bit and
  9439. Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
  9440. instead. Refactor code to handle similar relocations to increase
  9441. code sharing. Remove check for unsupported relocation code in switch
  9442. statement.
  9443. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
  9444. relocation property table to find out size. Change error message to
  9445. print out the name of a relocation code instead of the numeric value.
  9446. (Target_arm::scan_reloc_for_stub): Use relocation property table
  9447. instead of calling Target_arm::reloc_uses_thumb_bit().
  9448. 2010-02-02 Doug Kwan <dougkwan@google.com>
  9449. * arm.cc (Target_arm::relocate_section): Do view adjustment for all
  9450. types of relaxed input section.
  9451. 2010-02-02 Doug Kwan <dougkwan@google.com>
  9452. * Makefile.am (HFILES): Add arm-reloc-property.h.
  9453. (DEFFILES): New.
  9454. (TARGETSOURCES): Add arm-reloc-property.cc
  9455. (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
  9456. (libgold_a_SOURCES): $(DEFFILES)
  9457. * Makefile.in: Regenerate.
  9458. * arm-reloc-property.cc: New file.
  9459. * arm-reloc-property.h: New file.
  9460. * arm-reloc.def: New file.
  9461. * arm.cc: Update comments.
  9462. (arm-reloc-property.h): New included header.
  9463. (arm_reloc_property_table): New global variable.
  9464. (Target_arm::do_select_as_default_target): New method definition.
  9465. * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
  9466. arm-reloc-property to targ_extra_obj.
  9467. * parameters.cc (set_parameters_target): Call
  9468. Target::select_as_default_target().
  9469. * target.h (Target::select_as_default_target): New method definition.
  9470. (Target::do_select_as_default_target): Same.
  9471. 2010-02-01 Doug Kwan <dougkwan@google.com>
  9472. * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
  9473. first_output_text_section_.
  9474. (Arm_exidx_fixup::first_output_text_section): New method definition.
  9475. (Arm_exidx_fixup::first_output_text_section_): New data member.
  9476. (Arm_exidx_fixup::process_exidx_section): Record the first text
  9477. output section seen.
  9478. (Arm_output_section::fix_exidx_coverage): Set correct linked section
  9479. and entsize in output section header.
  9480. 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9481. * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
  9482. R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
  9483. (Arm_relocate_functions::thm_alu11): New Method.
  9484. (Arm_relocate_functions::thm_pc8): New Method.
  9485. (Arm_relocate_functions::thm_pc12): New Method.
  9486. (Target_arm::Scan::local): Handle the relocations.
  9487. (Target_arm::Scan::global): Likewise.
  9488. (Target_arm::Relocate::relocate): Likewise.
  9489. (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
  9490. 2010-01-29 Doug Kwan <dougkwan@google.com>
  9491. * arm.cc (Target_arm::Scan::global): General PLTs for the same set
  9492. of relocation types as ld.
  9493. 2010-01-29 Doug Kwan <dougkwan@google.com>
  9494. * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
  9495. to public.
  9496. (Arm_relocate_functions::thumb_branch_common): Ditto.
  9497. (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
  9498. Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
  9499. Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
  9500. Arm_relocate_functions::jump24): Remove.
  9501. (Target_arm::Relocate::relocate): Adjust code to call
  9502. Arm_relocation_functions::arm_branch_common and
  9503. Arm_relocation_functions::thumb_branch_common instead of their removed
  9504. wrappers. Merge switch-cases together to reduce source code size.
  9505. 2010-01-29 Doug Kwan <dougkwan@google.com>
  9506. * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
  9507. output_local_symbol_count_needs_update_.
  9508. (Arm_relobj::output_local_symbol_count_needs_update,
  9509. Arm_relobj::set_output_local_symbol_count_needs_update,
  9510. Arm_relobj::update_output_local_symbol_count): New methods.
  9511. (Arm_relobj::output_local_symbol_count_needs_update_): New data
  9512. member.
  9513. (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
  9514. of pointed function as in a R_ARM_PREL31 relocation.
  9515. (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
  9516. for output local symbol count updating.
  9517. (Target_arm::do_relax): Update output local symbol counts in objects
  9518. if necessary.
  9519. * object.h (Sized_relobj::set_output_local_symbol_count): New method.
  9520. 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9521. * arm.cc: Added support for the ARM relocations:
  9522. R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
  9523. R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
  9524. (Arm_relocate_functions::movw_rel_nc): Renamed (was
  9525. movw_prel_nc).
  9526. (Arm_relocate_functions::movw_rel): New method.
  9527. (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
  9528. (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
  9529. thm_movw_prel_nc).
  9530. (Arm_relocate_functions::thm_movw_rel): New method.
  9531. (Arm_relocate_functions::thm_movt_rel): Renamed (was
  9532. thm_movt_prel).
  9533. (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
  9534. relocations.
  9535. (Target_arm::Scan::global): Likewise.
  9536. (Target_arm::Relocate::relocate): Likewise.
  9537. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
  9538. Likewise.
  9539. 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9540. * arm.cc: Added support for ARM group relocations.
  9541. (Target_arm::reloc_needs_sym_origin): New method.
  9542. (Arm_relocate_functions::calc_grp_kn): New method.
  9543. (Arm_relocate_functions::calc_grp_residual): New method.
  9544. (Arm_relocate_functions::calc_grp_gn): New method.
  9545. (Arm_relocate_functions::arm_grp_alu): New Method.
  9546. (Arm_relocate_functions::arm_grp_ldr): New Method.
  9547. (Arm_relocate_functions::arm_grp_ldrs): New Method.
  9548. (Arm_relocate_functions::arm_grp_ldc): New Method.
  9549. (Target_arm::Scan::local): Handle the ARM group relocations.
  9550. (Target_arm::Scan::global): Likewise.
  9551. (Target_arm::Relocate::relocate): Likewise.
  9552. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
  9553. Likewise.
  9554. 2010-01-26 Doug Kwan <dougkwan@google.com>
  9555. * arm.cc (set): Include.
  9556. (class Arm_exidx_fixup): Change type of last_input_section_ to const
  9557. pointer type.
  9558. (Arm_output_section::Text_section_list): New type.
  9559. (Arm_output_section::append_text_sections_to_list): New method.
  9560. (Arm_output_section::fix_exidx_coverage): Ditto.
  9561. (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
  9562. (Arm_relobj::convert_input_section_to_relaxed_section): Use
  9563. Relobj::set_section_offset() instead of
  9564. Sized_relobj::invalidate_section_offset().
  9565. (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
  9566. parameter for section headers. Ignore relocation sections for
  9567. unallocated sections and EXIDX sections.
  9568. (Target_arm::fix_exidx_coverage): New method.
  9569. (Target_arm::output_section_address_less_than): New type.
  9570. (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
  9571. linked text section instead of the EXIDX section.
  9572. (Arm_output_section::create_stub_group): Add an assertion to check
  9573. that this is not an EXIDX output section.
  9574. (Arm_output_section::append_text_sections_to_list): New method.
  9575. (Arm_output_section::fix_exidx_coverage): Ditto.
  9576. (Arm_relobj::scan_sections_for_stubs): Adjust call to
  9577. Arm_relobj::section_needs_reloc_stub_scanning.
  9578. (Target_arm::do_relax): Fix EXIDX output section coverage in the
  9579. first pass.
  9580. (Target_arm::fix_exidx_coverage): New method.
  9581. * object.h (Relobj::set_output_section): New method.
  9582. (Sized_relobj::invalidate_section_offset): Remove method.
  9583. (Sized_relobj::do_invalidate_section_offset): Remove method.
  9584. (Sized_relobj::do_set_section_offset): Handle offset value -1.
  9585. 2010-01-25 Doug Kwan <dougkwan@google.com>
  9586. * arm.cc (Arm_exidx_merged_section::do_output_offset):
  9587. Fix warning due to signed and unsigned comparison on a 32-bit host.
  9588. 2010-01-22 Doug Kwan <dougkwan@google.com>
  9589. * arm.cc (Target_arm::do_relax): Record an output section for section
  9590. offset adjustment it contains any stub table that has changed.
  9591. * layout.cc (Layout::clean_up_after_relaxation): Adjust section
  9592. offsets in an output section if necessary.
  9593. * output.cc (Output_section::Output_section): Initialize
  9594. section_offsets_need_adjustments_.
  9595. (Output_section::add_input_section_for_script): Renamed to
  9596. Output_section::add_simple_input_section.
  9597. (Output_section::save_states): Add a comment.
  9598. (Output_section::discard_states): New method defintion.
  9599. (Output_section::adjust_section_offsets): Same.
  9600. * output.h (Output_section::add_input_section_for_script): Renamed to
  9601. Output_section::add_simple_input_section.
  9602. (Output_section::discard_states): New method declaration.
  9603. (Output_section::adjust_section_offsets): Same.
  9604. (Output_section::section_offsets_need_adjustment,
  9605. Output_section::set_section_offsets_need_adjustment): New method
  9606. definitions.
  9607. (Output_section::section_offsets_need_adjustment_): New data member.
  9608. * script-sections.cc
  9609. (Output_section_element_input::set_section_address): Adjust code for
  9610. renaming of Output_section::add_input_section_for_script.
  9611. (Orphan_output_section::set_section_address): Same.
  9612. 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9613. * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
  9614. Fix_v4bx enum values .
  9615. * gold/options.h (General_options): New option definitions.
  9616. (General_options::fix_v4bx): New method.
  9617. (General_options::Fix_v4bx): New enum.
  9618. * gold/options.cc (General_options::parse_fix_v4bx): New method.
  9619. (General_options::parse_fix_v4bx_interworking): New method.
  9620. 2010-01-22 Doug Kwan <dougkwan@google.com>
  9621. * arm.cc (Arm_exidx_fixup): New class.
  9622. 2010-01-21 Doug Kwan <dougkwan@google.com>
  9623. * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
  9624. classes.
  9625. (Arm_exidx_section_offset_map): New type.
  9626. 2010-01-21 Doug Kwan <dougkwan@google.com>
  9627. * arm.cc (Arm_exidx_input_section): New class.
  9628. (Arm_relobj::exidx_input_section_by_link,
  9629. Arm_relobj::exidx_input_section_by_shndx,
  9630. Arm_relobj::make_exidx_input_section): New methods.
  9631. (read_arm_attributes_section): Remove.
  9632. (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
  9633. information about them.
  9634. (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
  9635. to here.
  9636. 2010-01-20 Doug Kwan <dougkwan@google.com>
  9637. * arm.cc (Target_arm::Arm_input_section_map): Change key type from
  9638. Input_section_specifier to Section_id.
  9639. (Target_arm::new_arm_input_section: Adjust code for change of key
  9640. type.
  9641. (Target_arm::find_arm_input_section): Ditto.
  9642. * gc.h (object.h): Include for Section_id nand Section_id_hash.
  9643. (Section_id): Remove.
  9644. (Garbage_collection::Section_id_hash): Remove.
  9645. * icf.h (object.h): Include for Section_id nand Section_id_hash.
  9646. (Section_id): Remove.
  9647. (Icf::Section_id_hash): Remove.
  9648. * object.h (Section_id, Const_section_id, Section_id_hash,
  9649. Const_section_id_hash): New type definitions.
  9650. * output.cc (Output_section::add_relaxed_input_section): Change to
  9651. use Const_section_id instead of Input_section_specifier as key type.
  9652. (Output_section::add_merge_input_section): Ditto.
  9653. (Output_section::build_relaxation_map): Change to use Section_id
  9654. instead of Input_section_specifier as key type.
  9655. (Output_section::convert_input_sections_in_list_to_relaxed_sections):
  9656. Ditto.
  9657. (Output_section::convert_input_sections_to_relaxed_sections): Change
  9658. to use Const_section_id instead of Input_section_specifier as key type.
  9659. (Output_section::find_merge_section): Ditto.
  9660. (Output_section::find_relaxed_input_section): Ditto.
  9661. * output.h (Input_section_specifier): Remove class.
  9662. (Output_section::Output_section_data_by_input_section_map): Change
  9663. key type to Const_section_id.
  9664. (Output_section::Output_relaxed_input_section_by_input_section_map):
  9665. Ditto.
  9666. (Output_section::Relaxation_map): Change key type to Section_id.
  9667. 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9668. * gold/arm.cc: Added support for R_ARM_V4BX relocation
  9669. (class Arm_v4bx_stub): New class.
  9670. (DEF_STUBS): Updated definition to support v4_veneer_bx.
  9671. (Stub_factory::make_arm_v4bx_stub): New method.
  9672. (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
  9673. (Stub_table::empty): Handle v4bx stubs.
  9674. (Stub_table::add_arm_v4bx_stub): New method.
  9675. (Stub_table::find_arm_v4bx_stub): New method.
  9676. (Arm_relocate_functions::v4bx): New method.
  9677. (Target_arm::fix_v4bx): New method.
  9678. (Target_arm::Target_arm): Handle R_ARM_V4BX.
  9679. (Stub_table::relocate_stubs): Likewise.
  9680. (Stub_table::do_write): Likewise.
  9681. (Stub_table::update_data_size_and_addralign): Likewise.
  9682. (Stub_table::finalize_stubs): Likewise.
  9683. (Target_arm::Scan::local): Likewise.
  9684. (Target_arm::Scan::global): Likewise.
  9685. (Target_arm::do_finalize_sections): Likewise.
  9686. (Target_arm::Relocate::relocate): Likewise.
  9687. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
  9688. Likewise.
  9689. (Target_arm::scan_reloc_for_stub): Likewise.
  9690. (Target_arm::scan_reloc_section_for_stubs): Likewise.
  9691. 2010-01-19 Ian Lance Taylor <iant@google.com>
  9692. * output.cc (Output_section_headers::do_sized_write): Write large
  9693. segment count to sh_info field.
  9694. (Output_file_header::do_sized_write): For large segment count,
  9695. write PN_XNUM to e_phnum field.
  9696. 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  9697. * arm.cc (Arm_relocate_functions::thm_jump6): New function.
  9698. (Arm_relocate_functions::thm_jump8): New function.
  9699. (Arm_relocate_functions::thm_jump11): New function.
  9700. (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
  9701. R_ARM_THM_JUMP11.
  9702. (Target_arm::Scan::global): Likewise.
  9703. (Target_arm::Relocate::relocate): Likewise.
  9704. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
  9705. Likewise.
  9706. 2010-01-14 Doug Kwan <dougkwan@google.com>
  9707. * arm.cc (map, utility): Include headers.
  9708. (Target_arm::apply_cortex_a8_workaround): New method.
  9709. (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
  9710. (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
  9711. (Target_arm::Scan::global): R_ARM_THM_JUMP19.
  9712. (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
  9713. the --[no-]fix-cortex-a8 command line options.
  9714. (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
  9715. (Target_arm::relocate_stub): Use addend in instruction template.
  9716. * options.h (DEFINE_bool): Set the user-set flag.
  9717. (General_options): Add --[no-]-fix-cortex options.
  9718. * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
  9719. : Update fast look-up map after conversion.
  9720. 2010-01-14 Sriraman Tallam <tmsriram@google.com>
  9721. * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
  9722. in the first pass of do_layout.
  9723. 2010-01-13 Doug Kwan <dougkwan@google.com>
  9724. * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
  9725. Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
  9726. apparent compiler problem of not folding static constant integral
  9727. data members of elfcpp::Elf_sizes<32>.
  9728. 2010-01-13 Doug Kwan <dougkwan@google.com>
  9729. * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
  9730. Arm_relobj::section_needs_cortex_a8_stub_scanning,
  9731. Arm_relobj::scan_section_for_cortex_a8_erratum,
  9732. Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
  9733. (Arm_relobj::scan_sections_for_stubs): Move code deciding what
  9734. sections to scan for relocation stubs into a new method
  9735. Arm_relobj::section_needs_reloc_stub_scanning. Handle both
  9736. relocation and Cortex-A8 stub scanning.
  9737. (Target_arm::do_relax): Force stubs to be after stubbed sections
  9738. if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
  9739. the beginning of a new relaxation pass. Update a comment.
  9740. (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
  9741. 2010-01-12 Ian Lance Taylor <iant@google.com>
  9742. * target-reloc.h (visibility_error): New inline function.
  9743. (relocate_section): Call visibility_error.
  9744. * testsuite/Makefile.am (check_DATA): Add protected_3.err.
  9745. (MOSTLYCLEANFILES): Likewise.
  9746. (protected_4_pic.o, protected_3.err): New targets.
  9747. * testsuite/protected_4.cc: New file.
  9748. 2010-01-12 Doug Kwan <dougkwan@google.com>
  9749. * arm.cc (Cortex_a8_reloc): New class.
  9750. (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
  9751. and cortex_a8_relocs_info_.
  9752. (Target_arm::fix_cortex_a8): New method definition.
  9753. (Target_arm::Cortex_a8_relocs_info): New type.
  9754. (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
  9755. New data member declarations.
  9756. (Target_arm::scan_reloc_for_stub): Record information about
  9757. relocations for THUMB branches that might be exempted from the
  9758. Cortex-A8 workaround.
  9759. (Target_arm::do_relax): Clear all Cortex-A8 relocation information
  9760. at the beginning of a relaxation pass.
  9761. 2010-01-12 Doug Kwan <dougkwan@google.com>
  9762. * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
  9763. (Arm_relobj::Mapping_symbol_position,
  9764. Arm_reloj::Mapping_symbol_position_less,
  9765. Arm_relobj::Mapping_symbols_info): New types.
  9766. (Target_arm::is_mapping_symbol_name): New method definition.
  9767. (Arm_relobj::do_count_local_symbols): Save information about mapping
  9768. symbols.
  9769. 2010-01-11 Doug Kwan <dougkwan@google.com>
  9770. * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
  9771. Arm_relocate_functions::thumb32_branch_upper,
  9772. Arm_relocate_functions::thumb32_branch_lower,
  9773. Arm_relocate_functions::thumb32_cond_branch_offset,
  9774. Arm_relocate_functions::thumb32_cond_branch_upper,
  9775. Arm_relocate_functions::thumb32_cond_branch_lower,
  9776. Arm_relocate_functions::thm_jump19): New methods to handle THUMB
  9777. branch offset encoding.
  9778. (Arm_relocate_functions::thumb_branch_common): Use new branch
  9779. offset encoding methods to avoid code duplication.
  9780. (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
  9781. (Stub_addend_reader::operator()): Use new branch encoding method
  9782. to avoid code duplication.
  9783. 2010-01-11 Doug Kwan <dougkwan@google.com>
  9784. * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
  9785. (Target_arm::do_finalize_sections): Define special EXIDX section
  9786. symbols only if referenced.
  9787. * gc.h (Garbage_collection::add_reference): New method.
  9788. (gc_process_relocs): Use Garbage_collection::add_reference to avoid
  9789. code duplication.
  9790. 2010-01-11 Ian Lance Taylor <iant@google.com>
  9791. * script.cc (Version_script_info::build_expression_list_lookup):
  9792. Change complaing about duplicate wildcard match from error to
  9793. warning.
  9794. * script.cc (class Lazy_demangler): Recreate--revert part of patch
  9795. of 2009-12-30.
  9796. (Version_script_info::Version_script_info): Initialize globs_,
  9797. default_version_, default_is_global_, and exact_. Don't
  9798. initialize globals_ or locals_.
  9799. (Version_script_info::build_lookup_tables): Build local symbols
  9800. first.
  9801. (Version_script_info::unquote): New function.
  9802. (Version_script_info::add_exact_match): New function.
  9803. (Version_script_info::build_expression_list_lookup): Remove lookup
  9804. parameter. Add is_global parameter. Change all callers. Handle
  9805. wildcard pattern specially. Unquote pattern. Call
  9806. add_exact_match.
  9807. (Version_script_info::get_name_to_match): New function.
  9808. (Version_script_info::get_symbol_version): New function.
  9809. (Version_script_info::get_symbol_version_helper): Remove.
  9810. (Version_script_info::check_unmatched_names): Call unquote.
  9811. * script.h (class Version_script_info): Change get_symbol_version
  9812. to be non-inline and add is_global parameter; change all callers.
  9813. Rewrite symbol_is_local. Update declarations. Define struct
  9814. Version_tree_match, Exact, Globs. Don't define struct Lookup.
  9815. Remove globals_ and locals_ members. Add exact_, globs_,
  9816. default_version_, is_global_.
  9817. (Version_script_info::Glob): Remove pattern, add expression and
  9818. is_global. Update constructor. Change all callers.
  9819. * dynobj.cc (Versions::finalize): Mark the version symbol as the
  9820. default version.
  9821. (Versions::symbol_section_contents): If a symbol is undefined, or
  9822. defined in a dynamic object, set the version index to
  9823. VER_NDX_LOCAL.
  9824. * symtab.cc (Symbol_table::add_from_relobj): Don't call
  9825. symbol_is_local.
  9826. (Symbol_table::add_from_pluginobj): Likewise.
  9827. * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
  9828. 2010-01-11 Doug Kwan <dougkwan@google.com>
  9829. * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
  9830. (incremental_dump_LDADD): Add linking option for libintl.
  9831. * Makefile.in: Regenerate.
  9832. 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
  9833. PR gold/11144
  9834. * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
  9835. instead of -Ds.
  9836. * testsuite/Makefile.in: Regenerated.
  9837. 2010-01-10 Doug Kwan <dougkwan@google.com>
  9838. * options.h (DEFINE_var): Use parentheses around argument varname__
  9839. in macro body to avoid any unintended subsequent substitutions.
  9840. 2010-01-10 Ian Lance Taylor <iant@google.com>
  9841. * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
  9842. candidates before doing symbol resolution.
  9843. * resolve.cc (Symbol_table::resolve): Add symbols to the list of
  9844. ODR candidates if only one is weak.
  9845. 2010-01-08 Ian Lance Taylor <iant@google.com>
  9846. * script.cc (Version_script_info::build_expression_list_lookup):
  9847. Don't warn about ambiguous version, just record the ambiguity.
  9848. (Version_script_info::get_symbol_version_helper): Give error if
  9849. version is ambiguous.
  9850. 2010-01-08 Doug Kwan <dougkwan@google.com>
  9851. * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
  9852. prev_data_size_ and prev_addralign_. Remove initializer for
  9853. deleted data member has_been_changed_.
  9854. (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
  9855. to determine if the table is empty.
  9856. (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
  9857. Remove.
  9858. (Stub_table::add_reloc_stub): Define method in class definition
  9859. instead of just declaring it there.
  9860. (Stub_table::add_cortex_a8_stub): New method definition.
  9861. (Stub_table::update_data_size_and_addralign): Ditto.
  9862. (Stub_table::finalize_stubs): Ditto.
  9863. (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
  9864. (Stub_table::do_addralign_): Return address alignment in the
  9865. (Stub_table::do_reset_address_and_file_offset): Define method in
  9866. class definition instead of declaring it there. Set current data
  9867. size to be the data size of the previous pass.
  9868. (Stub_table::set_final_data_size): Use current data size as the
  9869. final data size.
  9870. (Stub_table::relocate_stub): Change parameter type of stub from
  9871. Reloc_stub pointer to Stub pointer.
  9872. (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
  9873. (Stub_table::Cortex_a8_stub_list): New typedef.
  9874. (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
  9875. Stub_table::prev_addralign_): New data member.
  9876. (Arm_relobj::Arm_relobj): Initialize data member
  9877. section_has_cortex_a8_workaround_.
  9878. (Arm_relobj::section_has_cortex_a8_workaround,
  9879. Arm_relobj::mark_section_for_cortex_a8_workaround): New method
  9880. definitions.
  9881. (Arm_relobj::section_has_cortex_a8_workaround_): New data member
  9882. declarations.
  9883. (Target_arm::relocate_stub): Change parameter type of stub from
  9884. Reloc_stub pointer to Stub pointer.
  9885. (Insn_template::size, Insn_template::alignment): Handle
  9886. THUMB16_SPECIAL_TYPE.
  9887. (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
  9888. Stub_table::update_data_size_and_addralign,
  9889. Stub_table::apply_cortex_a8_workaround_to_address_range): New method
  9890. definitions.
  9891. (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
  9892. (Stub_table::do_write): Ditto.
  9893. (Target_arm::do_relax): Adjust code for changes in Stub_table.
  9894. 2010-01-08 Ian Lance Taylor <iant@google.com>
  9895. PR 11108
  9896. * symtab.h (class Symbol): Remove fields is_target_special_ and
  9897. has_plt_offset_. Add field is_defined_in_discarded_section_.
  9898. (Symbol::is_defined_in_discarded_section): New function.
  9899. (Symbol::set_is_defined_in_discarded_section): New function.
  9900. (Symbol::has_plt_offset): Rewrite.
  9901. (Symbol::set_plt_offset): Verify that new offset is not -1U.
  9902. * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
  9903. Don't initialize is_target_special_ or has_plt_offset_.
  9904. Initialize is_defined_in_discarded_section_.
  9905. (Symbol_table::add_from_relobj): If appropriate, set
  9906. is_defined_in_discarded_section.
  9907. * resolve.cc (Symbol::override_base_with_special): Don't test
  9908. is_target_special_. Change has_plt_offset_ to has_plt_offset().
  9909. * target-reloc.h (relocate_section): Do special handling for
  9910. symbols defined in discarded sections for global symbols as well
  9911. as local symbols.
  9912. 2010-01-08 Ian Lance Taylor <iant@google.com>
  9913. * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
  9914. the SHT_SYMTAB case.
  9915. 2010-01-08 Ian Lance Taylor <iant@google.com>
  9916. * object.cc (Sized_relobj::do_layout): Don't get confused if
  9917. layout_eh_frame returns NULL.
  9918. 2010-01-08 Ian Lance Taylor <iant@google.com>
  9919. PR 11084
  9920. * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
  9921. dynamic symbol table, use the normal symbol table.
  9922. (Sized_dynobj::do_read_symbols): Remove assertion about type of
  9923. symbol table.
  9924. 2010-01-08 Ian Lance Taylor <iant@google.com>
  9925. PR 11072
  9926. * layout.cc (Layout::include_section): Remove .gnu_debuglink
  9927. sections.
  9928. 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
  9929. * version.cc (print_version): Change to "Copyright 2010".
  9930. 2010-01-08 Ian Lance Taylor <iant@google.com>
  9931. PR 10287
  9932. PR 11063
  9933. * i386.cc (class Target_i386): Change return type of plt_section
  9934. to be non-const.
  9935. (class Output_data_plt_i386): Add tls_desc_rel_ field.
  9936. (Output_data_plt_i386::Output_data_plt_i386): Initialize
  9937. tls_desc_rel_ field.
  9938. (Output_data_plt_i386::rel_tls_desc): New function.
  9939. (Target_i386::rel_tls_desc_section): New function.
  9940. (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
  9941. (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
  9942. R_386_TLS_DESC reloc in rel_tls_desc_section.
  9943. * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
  9944. Define struct Tlsdesc_info.
  9945. (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
  9946. (Target_x86_64::do_reloc_symbol_index): New function.
  9947. (Target_x86_64::add_tlsdesc_info): New function.
  9948. (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
  9949. (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
  9950. tlsdesc_rel_ field.
  9951. (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
  9952. all callers.
  9953. (Output_data_plt_x86_64::rela_tlsdesc): New function.
  9954. (Target_x86_64::rela_tlsdesc_section): New function.
  9955. (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
  9956. handling.
  9957. (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
  9958. (Target_x86_64::do_reloc_addend): New function.
  9959. R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
  9960. * output.h (class Output_reloc) [SHT_REL]: Add new constructor
  9961. declarations. Define TARGET_CODE. Add arg field to u1_ union.
  9962. (Output_reloc::type): New function.
  9963. (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
  9964. (Output_reloc::is_target_specific): New function.
  9965. (Output_reloc::target_arg): New function.
  9966. (class Output_reloc) [SHT_RELA]: Add four new constructors for
  9967. absolute relocs and target specific relocs.
  9968. (class Output_data_reloc) [SHT_REL]: Add add_absolute and
  9969. add_target_specific.
  9970. (class Output_data_reloc) [SHT_RELA]: Likewise.
  9971. * output.cc (Output_reloc::Output_reloc): Add four new versions
  9972. for absolute relocs and target specific relocs.
  9973. (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
  9974. (Output_reloc::get_symbol_index): Likewise.
  9975. (Output_reloc::local_section_offset): Check that local_sym_index_
  9976. is not TARGET_CODE or 0.
  9977. (Output_reloc::symbol_value): Likewise.
  9978. (Output_reloc::write) [SHT_RELA]: Call target for target specific
  9979. reloc.
  9980. * target.h (class Target): Add reloc_symbol_index and reloc_addend
  9981. functions. Add do_reloc_symbol_index and do_reloc_addend virtual
  9982. functions.
  9983. * layout.cc (add_target_dynamic_tags): Use output section for
  9984. DT_PLTRELSZ and DT_JMPREL.
  9985. 2010-01-07 Ian Lance Taylor <iant@google.com>
  9986. PR 11061
  9987. * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
  9988. function.
  9989. (class Output_data_reloc_generic): Define.
  9990. (class Output_data_reloc_base): Change base class to
  9991. Output_data_reloc_generic. Change add() method to call
  9992. bump_relative_reloc_count for a relative reloc. Remove
  9993. sort_relocs_ field.
  9994. * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
  9995. to sort_relocs().
  9996. * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
  9997. Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
  9998. appropriate.
  9999. * layout.h (class Layout): Update declaration.
  10000. 2010-01-07 Ian Lance Taylor <iant@google.com>
  10001. * output.h (class Output_data): Add const version of
  10002. output_section and do_output_section.
  10003. (class Output_section_data): Add const version of
  10004. do_output_section.
  10005. (class Output_section): Likewise.
  10006. * layout.cc (Layout::add_target_dynamic_tags): New function.
  10007. * layout.h (class Layout): Update declarations.
  10008. * arm.cc (Target_arm::do_finalize_sections): Use
  10009. add_target_dynamic_tags.
  10010. * i386.cc (Target_i386::do_finalize_sections): Likewise.
  10011. * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
  10012. * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
  10013. * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
  10014. 2010-01-07 Ian Lance Taylor <iant@google.com>
  10015. PR 11042
  10016. * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
  10017. object as needed.
  10018. 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
  10019. Ian Lance Taylor <iant@google.com>
  10020. PR 11019
  10021. * object.cc: Instantiate Xindex::initialize_symtab_xindex and
  10022. Xindex::read_symtab_xindex.
  10023. 2010-01-07 Doug Kwan <dougkwan@google.com>
  10024. * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
  10025. (Insn_template::thumb16_bcond_insn): New method declaration.
  10026. (Insn_template): Fix spelling.
  10027. (Stub::thumb16_special): New method declaration.
  10028. (Stub::do_write): Define virtual method which was previously pure
  10029. virtual.
  10030. (Stub::do_thumb16_special): New method declaration.
  10031. (Stub::do_fixed_endian_write): New template member.
  10032. (Reloc_stub::do_write): Remove.
  10033. (Reloc_stub::do_fixed_endian_write): Remove.
  10034. (Cortex_a8_stub): New class definition.
  10035. (Stub_factory::make_cortex_a8_stub): New method definition.
  10036. (Stub_factory::Stub_factory): Add missing static storage class
  10037. qualifier for elf32_arm_stub_a8_veneer_blx.
  10038. 2010-01-07 Ian Lance Taylor <iant@google.com>
  10039. PR 10980
  10040. * options.h (class General_options): Add --warn-unresolved-symbols
  10041. and --error-unresolved-symbols.
  10042. * errors.cc (Errors::undefined_symbol): Implement
  10043. --warn-unresolved-symbols.
  10044. * options.h (class General_options): Add -z text and -z textoff.
  10045. * layout.cc (Layout::finish_dynamic_section): Implement -z text.
  10046. 2010-01-06 Sriraman Tallam <tmsriram@google.com>
  10047. * gc.h (Garbage_collection::Cident_section_map): New typedef.
  10048. (Garbage_collection::cident_sections): New function.
  10049. (Garbage_collection::add_cident_section): New function.
  10050. (Garbage_collection::cident_sections_): New member.
  10051. (gc_process_relocs): Add references to sections whose names are C
  10052. identifiers.
  10053. * gold.h (cident_section_start_prefix): New constant.
  10054. (cident_section_stop_prefix): New constant.
  10055. (is_cident): New function.
  10056. * layout.cc (Layout::define_section_symbols): Replace string constants
  10057. with the newly defined constants.
  10058. * object.cc (Sized_relobj::do_layout): Track sections whose names are
  10059. C identifiers.
  10060. * testsuite/Makefile.am: Add gc_orphan_section_test.
  10061. * testsuite/Makefile.in: Regenerate.
  10062. * testsuite/gc_orphan_section_test.cc: New file.
  10063. * testsuite/gc_orphan_section_test.sh: New file.
  10064. 2010-01-06 Ian Lance Taylor <iant@google.com>
  10065. PR 10980
  10066. * options.h (class General_options): Add --warn-shared-textrel.
  10067. * layout.cc (Layout::finish_dynamic_section): Implement
  10068. --warn-shared-textrel.
  10069. PR 10980
  10070. * options.h (class General_options): Add --warn-multiple-gp.
  10071. 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  10072. * Makefile.am (incremental_dump_DEPENDENCIES): Remove
  10073. $(THREADSLIB) and $(LIBDL).
  10074. * Makefile.in: Rebuild.
  10075. 2010-01-06 Ian Lance Taylor <iant@google.com>
  10076. PR 10980
  10077. * options.cc (General_options::parse_section_start): New function.
  10078. (General_options::section_start): New function.
  10079. (General_options::General_options): Initialize all members.
  10080. * options.h: Include <map>
  10081. (class General_options): Add --section-start. Add section_starts_
  10082. member.
  10083. * layout.cc (Layout::attach_allocated_section_to_segment): If
  10084. --section-start was used, set the address of the segment. Remove
  10085. local sort_sections.
  10086. (Layout::relaxation_loop_body): If the address of the load segment
  10087. has been set by --section-start, don't use it.
  10088. * output.h (Output_segment::update_flags_for_output_section): New
  10089. function.
  10090. * output.cc (Output_segment::add_output_section): Call
  10091. update_flags_for_output_section.
  10092. 2010-01-05 Ian Lance Taylor <iant@google.com>
  10093. PR 10980
  10094. * options.h (class General_options): Add --undefined-version.
  10095. * script.cc (struct Version_expression): Add was_matched_by_symbol
  10096. field.
  10097. (Version_script_info::matched_symbol): New function.
  10098. (Version_script_info::get_symbol_version_helper): Call
  10099. matched_symbol.
  10100. (Version_script_info::check_unmatched_names): New function.
  10101. * script.h (class Version_script_info): Update declarations.
  10102. * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
  10103. * options.h (class General_options): Use DEFINE_bool_alias for
  10104. allow_multiple_definition.
  10105. * resolve.cc (Symbol_table::should_override): Don't test
  10106. allow_multiple_definition.
  10107. PR 10980
  10108. * options.h (class General_options): Add --cref.
  10109. * main.cc (main): Print cref table if --cref. Don't close mapfile
  10110. until after printing cref table.
  10111. * cref.cc: Include "symtab.h".
  10112. (class Cref_inputs): Define Cref_table_compare and Cref_table.
  10113. (Cref_table_compare::operator()): New function.
  10114. (Cref_inputs::gather_cref): New function.
  10115. (filecol): New static const.
  10116. (Cref_inputs::print_cref): New function.
  10117. (Cref::print_cref): New function.
  10118. * cref.h: Include <cstdio>.
  10119. (class Cref): Update declarations.
  10120. * mapfile.h (Mapfile::file): New function.
  10121. * object.h (class Object): Define Symbols. Declare virtual
  10122. do_get_global_symbols.
  10123. (Object::get_global_symbols): New function.
  10124. * object.cc (Input_objects::add_object): Pass object to cref_ if
  10125. --cref.
  10126. (Input_objects::archive_start): Likewise.
  10127. (Input_objects::archive_stop): Likewise.
  10128. (Input_objects::print_cref): New function.
  10129. * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
  10130. * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
  10131. --cref.
  10132. * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
  10133. function.
  10134. * plugin.h (class Sized_pluginobj): Update declarations.
  10135. 2010-01-05 Ian Lance Taylor <iant@google.com>
  10136. * symtab.cc (Symbol_table::add_from_object): Rename def parameter
  10137. to is_default_version. Rename insdef to insdefault.
  10138. (Symbol_table::add_from_relobj): Rename def to is_default_version
  10139. and local to is_forced_local.
  10140. (Symbol_table::add_from_pluginobj): Likewise.
  10141. (Symbol_table::add_from_dynobj): Likewise.
  10142. (Symbol_table::define_special_symbol): Rename insdef to
  10143. insdefault.
  10144. 2010-01-04 Ian Lance Taylor <iant@google.com>
  10145. PR 10980
  10146. * options.h (class General_options): Add
  10147. --allow-multiple-definition and -z muldefs.
  10148. * resolve.cc (Symbol_table::should_override): Don't warn about a
  10149. multiple symbol definition if --allow-multiple-definition or -z
  10150. muldefs.
  10151. PR 10980
  10152. * options.h (class General_options): Add --add-needed and
  10153. --copy-dt-needed-entries. Tweak --as-needed help entry.
  10154. * object.cc (Input_objects::check_dynamic_dependencies): Give an
  10155. error if --copy-dt-needed-entries aka --add-needed is used and
  10156. would cause a change in behaviour.
  10157. PR 10980
  10158. * options.h (class General_options): Add -G as a short version of
  10159. --shared. Add no-op options -assert, -g, and -i.
  10160. 2010-01-04 Sriraman Tallam <tmsriram@google.com>
  10161. * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
  10162. check for .text or .gnu.linkonce.t sections.
  10163. * icf.cc (Icf::find_identical_sections): Ditto.
  10164. Change the detection for mangled function name within the section
  10165. name.
  10166. * icf.h (is_section_foldable_candidate): New function.
  10167. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10168. PR 10980
  10169. * options.h (class General_options): Permit two dashes with
  10170. --retain-symbols-file.
  10171. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10172. PR 10979
  10173. * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
  10174. don't put the file header and segment headers in the text
  10175. segment.
  10176. PR 10979
  10177. * common.cc (Sort_commons::operator()): Stabilize sort when both
  10178. entries are NULL.
  10179. (Symbol_table::do_allocate_commons_list): When allocating common
  10180. symbols, skip a symbol which is no longer common.
  10181. * symtab.h (Symbol::is_common): Test whether the symbol comes from
  10182. an object before checking its type.
  10183. * testsuite/common_test_2.c: New file.
  10184. * testsuite/common_test_3.c: New file.
  10185. * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
  10186. (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
  10187. (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
  10188. (common_test_2_pic.o, common_test_2.so): New targets.
  10189. (common_test_3_pic.o, common_test_3.so): New targets.
  10190. * testsuite/Makefile.in: Rebuild.
  10191. PR 10979
  10192. * script.cc (read_input_script): If we see a new SECTIONS clause,
  10193. and we have added an input section, give an error.
  10194. * layout.h (class Layout): Add have_added_input_section function.
  10195. Add have_added_input_section_ field.
  10196. * layout.cc (Layout::Layout): Initialize
  10197. have_added_input_section_.
  10198. (Layout::layout): Set have_added_input_section_.
  10199. (Layout::layout_eh_frame): Likewise.
  10200. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10201. PR 10931
  10202. * options.h (class General_options): Add --sort-common option.
  10203. * symtab.h (class Symbol_table): Define Sort_commons_order enum.
  10204. * common.cc (Sort_common): Add sort_order parameter to
  10205. constructor. Add sort_order_ field.
  10206. (Sort_commons::operator): Check sort_order_.
  10207. (Symbol_table::allocate_commons): Determine the sort order.
  10208. (Symbol_table::do_allocate_commons): Add sort_order parameter.
  10209. Change all callers.
  10210. (Symbol_table::do_allocate_commons_list): Likewise.
  10211. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10212. PR 10916
  10213. * symtab.cc (Symbol_table::add_from_relobj): When not exporting
  10214. symbols from this object, don't change the visibility of an
  10215. undefined symbol.
  10216. * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
  10217. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10218. PR 10861
  10219. * script.h (class Version_script_info): Define Language enum.
  10220. Update declarations. Define Glob, Exact, and Lookup types. Add
  10221. new fields globals_, locals_, and is_finalized_.
  10222. * script.cc: Various formatting fixes.
  10223. (class Parser_closure): Change language_stack_ from a vector of
  10224. std::string to one of Version_script_info::Language. Adjust all
  10225. uses accordingly.
  10226. (class Lazy_demangler): Remove.
  10227. (struct Version_expression): Change language from std::string to
  10228. Version_script_info::Language.
  10229. (Version_script_info::Version_script_info): New function.
  10230. (Version_script_info::~Version_script_info): Don't call clear.
  10231. (Version_script_info::finalize): New function.
  10232. (Version_script_info::build_lookup_tables): New function.
  10233. (Version_script_info::build_expression_list_lookup): New
  10234. function.
  10235. (Version_script_info::get_symbol_version_helper): Rewrite to use
  10236. lookup tables.
  10237. (Version_script_info::print_expression_list): Adjust to use
  10238. Version_script_info::Language.
  10239. (script_push_lex_into_version_mode): Check that the version script
  10240. has not been finalized.
  10241. (version_script_push_lang): Change language string to
  10242. Version_script_info::Language.
  10243. * options.cc (Command_line::version_script): New function.
  10244. * options.h (class General_options): Add finalize_dynamic_list
  10245. function. Change version_script from declaration to definition.
  10246. * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
  10247. * testsuite/version_script.map: Remove duplicate def of foo.
  10248. * testsuite/Makefile.am (ver_matching_def.so): Depend upon
  10249. version_script.map.
  10250. * testsuite/Makefile.in: Rebuild.
  10251. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10252. PR 10843
  10253. * target-reloc.h (relocate_for_relocatable): When copying a reloc,
  10254. if the input symbol index is 0, make the output symbol index 0.
  10255. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10256. PR 10670
  10257. * options.h (class General_options): Add -x/--discard-all.
  10258. * object.cc (Sized_relobj::do_count_local_symbols): Handle
  10259. --discard-all. If the local symbol needs a dynamic entry, check
  10260. that before handling --discard-locals.
  10261. 2009-12-30 Ian Lance Taylor <iant@google.com>
  10262. PR 10450
  10263. * output.cc (Output_segment::Output_segment): If PT_TLS, set the
  10264. flags to PF_R.
  10265. (Output_segment::add_output_section): Don't change the flags if
  10266. the type is PT_TLS.
  10267. PR 10450
  10268. * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
  10269. GNU hash table if they need a dynamic value. Otherwise, don't add
  10270. them if they are defined in a dynamic object or are forced local.
  10271. 2009-12-29 Ian Lance Taylor <iant@google.com>
  10272. PR 10450
  10273. * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
  10274. .gnu.hash table for a 32-bit target.
  10275. PR 10450
  10276. * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
  10277. regular and a dynamic object only needs a dynamic symbol table
  10278. entry if it is externally visible.
  10279. PR 10450
  10280. * i386.cc (class Target_i386): Initialize global_offset_table_ in
  10281. constructor. Add global_offset_table_ field.
  10282. (Target_i386::got_section): Set global_offset_table_.
  10283. (Target_i386::do_finalize_sections): Set global_offset_table_
  10284. size.
  10285. * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
  10286. in constructor. Add global_offset_table_ field.
  10287. (Target_x86_64::got_section): Set global_offset_table_.
  10288. (Target_x86_64::do_finalize_sections): Set global_offset_table_
  10289. size.
  10290. * layout.cc (Layout::Layout): Initialize increase_relro_.
  10291. (Layout::get_output_section): Add is_relro, is_last_relro, and
  10292. is_first_non_relro parameters. Change all callers.
  10293. (Layout::choose_output_section): Likewise.
  10294. (Layout::add_output_section_data): Likewise.
  10295. (Layout::make_output_section): Likewise.
  10296. (Layout::set_segment_offsets): Clear increase_relro when using a
  10297. linker script.
  10298. * layout.h (class Layout): Add increase_relro method. Add
  10299. increase_relro_ field. Update declarations.
  10300. * output.cc (Output_section::Output_section): Initialize
  10301. is_last_relro_ and is_first_non_relro_.
  10302. (Output_segment::add_output_section): Group relro sections is
  10303. do_sort is true. Handle is_last_relro and is_first_non_relro.
  10304. (Output_segment::maximum_alignment): Remove relro handling.
  10305. (Output_segment::set_section_addresses): Add increase_relro
  10306. parameter. Change all callers. Add initial alignment to align
  10307. relro sections on separate page. Remove old relro handling.
  10308. (Output_segment::set_section_list_addresses): Remove in_relro
  10309. parameter. Change all callers.
  10310. (Output_segment::set_offset): Add increase parameter. Change all
  10311. callers. Remove old relro handling.
  10312. * output.h (class Output_section): Add new methods: is_last_relro,
  10313. set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
  10314. Add is_last_relro_ and is_first_non_relro_ fields.
  10315. * i386.cc (Target_i386::got_section): Don't call set_is_relro.
  10316. Create separate .got.plt section. Call increase_relro.
  10317. * x86_64.cc (Target_x86_64::got_section): Likewise.
  10318. * testsuite/relro_script_test.t: Add .got.plt.
  10319. PR 10450
  10320. * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
  10321. (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
  10322. (Layout::finalize): Call set_dynamic_symbol_size.
  10323. (Layout::set_dynamic_symbol_size): New function.
  10324. * layout.h (class Layout): Add dynamic_symbol_ field. Declare
  10325. set_dynamic_symbol_size.
  10326. PR 10450
  10327. * output.h (class Output_section): Add is_entsize_zero_ field.
  10328. * output.cc (Output_section::Output_section): Initialize
  10329. is_entsize_zero_.
  10330. (Output_section::set_entsize): If two different entsizes are
  10331. requested, force it to zero.
  10332. (Output_section::add_input_section): Set flags for .debug_str
  10333. before updating section flags. Set entsize.
  10334. (Output_section::update_flags_for_input_section): Set SHF_MERGE
  10335. and SHF_STRING if all input sections have those flags.
  10336. 2009-12-29 Rafael Espindola <espindola@google.com>
  10337. * main.cc (main): Fix the sys time reporting.
  10338. * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
  10339. reporting.
  10340. 2009-12-29 Sriraman Tallam <tmsriram@google.com>
  10341. * options.cc (General_options::parse_version): Allow -v to exit
  10342. without an error if there is nothing to link.
  10343. 2009-12-29 Ian Lance Taylor <iant@google.com>
  10344. * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
  10345. using a version of gcc before 4.1.
  10346. * configure: Rebuild.
  10347. 2009-12-28 Chris Demetriou <cgd@google.com>
  10348. * attributes.cc (Output_attributes_section_data::do_write): Use
  10349. std::vector::front rather than std::vector::data.
  10350. 2009-12-28 Ian Lance Taylor <iant@google.com>
  10351. * symtab.h (class Symbol_table): Add enum Defined.
  10352. * resolve.cc (Symbol_table::should_override): Add defined
  10353. parameter. Change all callers. Test whether object is NULL
  10354. before calling a method on it.
  10355. (Symbol_table::report_resolve_problem): Add defined parameter.
  10356. Change all callers.
  10357. (Symbol_table::should_override_with_special): Likewise.
  10358. * symtab.cc (Symbol_table::define_in_output_data): Add defined
  10359. parameter. Change all callers.
  10360. (Symbol_table::do_define_in_output_data): Likewise.
  10361. (Symbol_table::define_in_output_segment): Likewise.
  10362. (Symbol_table::do_define_in_output_segment): Likewise.
  10363. (Symbol_table::define_as_constant): Likewise.
  10364. (Symbol_table::do_define_as_constant): Likewise.
  10365. * script.h (class Symbol_assignment): Add is_defsym parameter to
  10366. constructor; change all callers.
  10367. * script.cc (Script_options::add_symbol_assignment): Add is_defsym
  10368. parameter. Change all callers. Add is_defsym_ field.
  10369. (class Parser_closure): Add parsing_defsym parameter to
  10370. constructor; change all callers. Add parsing_defsym accessor
  10371. function. Add parsing_defsym_ field.
  10372. 2009-12-28 Ian Lance Taylor <iant@google.com>
  10373. * gold.cc (queue_middle_tasks): Fix formatting.
  10374. * object.cc (Relobj::is_section_name_included): Likewise.
  10375. 2009-12-23 Ian Lance Taylor <iant@google.com>
  10376. * i386.cc (Target_i386::do_calls_non_split): Recognize
  10377. -fsplit-stack prologue for a function with a static chain.
  10378. * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
  10379. -fsplit-stack prologue when using %r11.
  10380. 2009-12-21 Sriraman Tallam <tmsriram@google.com>
  10381. * options.cc (General_options::parse_version): Make -v continue and do
  10382. the link like GNU ld does.
  10383. 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
  10384. * Makefile.am (CCFILES): Add timer.cc.
  10385. (HFILES): Add timer.h.
  10386. * configure.ac: Check for sysconf and times.
  10387. * main.cc: include timer.h.
  10388. (main): Use Timer instead of get_run_time.
  10389. * timer.cc: New.
  10390. * timer.h: New.
  10391. * workqueue.cc: include timer.h.
  10392. (Workqueue::find_and_run_task):
  10393. Report user, sys and wall time.
  10394. * Makefile.in: Regenerate.
  10395. * config.in: Regenerate.
  10396. * configure: Regenerate.
  10397. 2009-12-16 Doug Kwan <dougkwan@google.com>
  10398. * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
  10399. sections.
  10400. * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
  10401. relaxed input sections.
  10402. * output.cc (Output_section::find_relaxed_input_section): Change
  10403. return type to Output_relaxed_input_section pointer. Adjust code
  10404. for new type of relaxed_input_section_map_.
  10405. * output.h (Output_section::find_relaxed_input_section): Change
  10406. return type to Output_relaxed_input_section pointer.
  10407. (Output_section::Output_relaxed_input_section_by_input_section_map):
  10408. New type.
  10409. (Output_section::relaxed_input_section_map_): Change type to
  10410. Output_section::Output_relaxed_input_section_by_input_section_map.
  10411. * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
  10412. input section.
  10413. 2009-12-15 Ian Lance Taylor <iant@google.com>
  10414. * layout.cc (Layout::create_shstrtab): Only write out after input
  10415. sections if we are compressing debug sections.
  10416. 2009-12-15 Ian Lance Taylor <iant@google.com>
  10417. * archive.cc (Archive::add_symbols): Only look up a symbol without
  10418. a version if there is, in fact, a version.
  10419. 2009-12-14 Ian Lance Taylor <iant@google.com>
  10420. Revert -Wshadow changes, all changes from:
  10421. 2009-12-11 Doug Kwan <dougkwan@google.com>
  10422. 2009-12-11 Nick Clifton <nickc@redhat.com>
  10423. * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
  10424. 2009-12-11 Doug Kwan <dougkwan@google.com>
  10425. * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
  10426. due to -Wshadow.
  10427. * attributes.cc (Object_attribute::size): Ditto.
  10428. (Attributes_section_data::size): Ditto.
  10429. (Attributes_section_data::Attributes_section_data): Ditto.
  10430. (Output_attributes_section_data::do_write): Ditto.
  10431. * attributes.h (Object_attribute::set_type): Ditto.
  10432. * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
  10433. 2009-12-11 Nick Clifton <nickc@redhat.com>
  10434. * archive.cc: Fix shadowed variable warnings.
  10435. * arm.cc: Likewise.
  10436. * compressed_output.cc: Likewise.
  10437. * compressed_output.h: Likewise.
  10438. * configure: Likewise.
  10439. * dwarf_reader.cc: Likewise.
  10440. * dynobj.cc: Likewise.
  10441. * dynobj.h: Likewise.
  10442. * ehframe.cc: Likewise.
  10443. * ehframe.h: Likewise.
  10444. * errors.cc: Likewise.
  10445. * expression.cc: Likewise.
  10446. * fileread.cc: Likewise.
  10447. * fileread.h: Likewise.
  10448. * freebsd.h: Likewise.
  10449. * i386.cc: Likewise.
  10450. * icf.cc: Likewise.
  10451. * incremental.h: Likewise.
  10452. * layout.cc: Likewise.
  10453. * layout.h: Likewise.
  10454. * mapfile.cc: Likewise.
  10455. * merge.cc: Likewise.
  10456. * merge.h: Likewise.
  10457. * object.cc: Likewise.
  10458. * object.h: Likewise.
  10459. * options.h: Likewise.
  10460. * output.cc: Likewise.
  10461. * output.h: Likewise.
  10462. * parameters.cc: Likewise.
  10463. * plugin.cc: Likewise.
  10464. * powerpc.cc: Likewise.
  10465. * reduced_debug_output.cc: Likewise.
  10466. * reduced_debug_output.h: Likewise.
  10467. * reloc.cc: Likewise.
  10468. * reloc.h: Likewise.
  10469. * resolve.cc: Likewise.
  10470. * script-sections.cc: Likewise.
  10471. * script.cc: Likewise.
  10472. * script.h: Likewise.
  10473. * sparc.cc: Likewise.
  10474. * symtab.cc: Likewise.
  10475. * symtab.h: Likewise.
  10476. * target-select.cc: Likewise.
  10477. * target-select.h: Likewise.
  10478. * token.h: Likewise.
  10479. * workqueue.cc: Likewise.
  10480. * workqueue.h: Likewise.
  10481. * x86_64.cc: Likewise.
  10482. 2009-12-10 Doug Kwan <dougkwan@google.com>
  10483. * arm.cc (attributes.h): New include.
  10484. (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
  10485. (Arm_relobj::~Arm_relobj): Delete object pointed by
  10486. attributes_section_data_.
  10487. (Arm_relobj::attributes_section_data): New method definition.
  10488. (Arm_relobj::attributes_section_data_): New data member declaration.
  10489. (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
  10490. (Arm_dynobj::~Arm_dynobj): Delete object pointed by
  10491. attributes_section_data_.
  10492. (Arm_dynobj::attributes_section_data): New method definition.
  10493. (Arm_dynobj::attributes_section_data_): New data member declaration.
  10494. (Target_arm::Target_arm): Initialize attributes_section_data_. Change
  10495. initialization value of may_use_blx_ to false.
  10496. (Target_arm::using_thumb2, Target_arm::using_thumb_only,
  10497. Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
  10498. object attributes to compute results instead of hard-coding.
  10499. (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
  10500. Target_arm::get_secondary_compatible_arch,
  10501. Target_arm::set_secondary_compatible_arch
  10502. Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
  10503. Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
  10504. New method declarations.
  10505. (Target_arm::get_aeabi_object_attribute): New method definition.
  10506. (Target_arm::attributes_section_data_): New data member declaration.
  10507. (read_arm_attributes_section): New template definition.
  10508. (Arm_relobj::do_read_symbols): Read attributes section if it exists.
  10509. (Arm_dynobj::do_read_symbols): Ditto.
  10510. (Target_arm::do_finalize_sections): Merge attributes sections from
  10511. input. Check for BLX use after attributes section merging.
  10512. Fix __exidx_start and __exidx_end visibility. Create an
  10513. .ARM.attributes section if necessary.
  10514. (Target_arm::get_secondary_compatible_arch,
  10515. Target_arm::set_secondary_compatible_arch,
  10516. Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
  10517. Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
  10518. Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
  10519. New method definitions.
  10520. 2009-12-09 Ian Lance Taylor <iant@google.com>
  10521. * plugin.cc (Plugin::load): Don't cast from void* to a function
  10522. pointer.
  10523. 2009-12-09 Ian Lance Taylor <iant@google.com>
  10524. * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
  10525. information fields.
  10526. 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
  10527. * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
  10528. Replace two_file_shared_1.so with two_file_shared_2.so.
  10529. * testsuite/Makefile.in: Regenerated.
  10530. 2009-12-08 Doug Kwan <dougkwan@google.com>
  10531. * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
  10532. (HFILES): Add attributes.h and int_encoding.h.
  10533. * Makefile.in: Regenerate.
  10534. * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
  10535. function definitions to int_encoding.cc
  10536. * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
  10537. prototypes to int_encoding.h
  10538. * reduced_debug_output.cc (int_encoding.h): New include.
  10539. (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
  10540. function definitions to int_encoding.cc
  10541. (insert_into_vector, read_from_pointer): Move template definitions to
  10542. int_encoding.h
  10543. * attributes.cc: New file.
  10544. * attributes.h: New file.
  10545. * int_encoding.cc: New file.
  10546. * int_encoding.h: New file.
  10547. 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
  10548. PR gold/11055
  10549. * incremental-dump.cc (dump_incremental_inputs): New.
  10550. (main): Use dump_incremental_inputs.
  10551. 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
  10552. PR gold/10893
  10553. * i386.cc (Target_i386::Scan::globa): Use is_func instead of
  10554. checking elfcpp::STT_FUNC.
  10555. (Target_i386::Relocate::relocate): Likewise.
  10556. * x86_64.cc (Target_x86_64::Scan::global): Likewise.
  10557. * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
  10558. symbols from shared libraries into normal FUNC symbols.
  10559. * symtab.h (Symbol): Add is_func and use it.
  10560. 2009-12-05 Doug Kwan <dougkwan@google.com>
  10561. * arm.cc (Target_arm::arm_info): Initialize new fields
  10562. attributes_section and attributes_vendor.
  10563. * i386.cc (Target_i386::i386_info): Same.
  10564. * object.cc (Sized_relobj::do_layout): Skip attribute section.
  10565. * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
  10566. fields attributes_section and attributes_vendor.
  10567. * sparc.cc (Target_sparc::sparc_info): Same.
  10568. * target.h (Target::attributes_section, Target::attributes_vendor,
  10569. Target::is_attributes_section, Target::attribute_arg_type,
  10570. Target::attributes_order): New method definitions.
  10571. (Target::Target_info::attributes_section,
  10572. Target::Target_info::attributes_vendor): New fields.
  10573. (Target::do_attribute_arg_type, Target::do_attributes_order): New
  10574. virtual method definitions.
  10575. * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
  10576. attributes_section and attributes_vendor.
  10577. * testsuite/testfile.cc (Target_test::test_target_info): Same.
  10578. 2009-12-05 Doug Kwan <dougkwan@google.com>
  10579. * arm.cc: Update comments about interworking and stub generation.
  10580. (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
  10581. considered as non-PIC.
  10582. (Arm_relocate_functions::base_abs): Fix formatting.
  10583. (Arm_relocate_functions::got_prel): Fix comment. Change interface
  10584. of function to use GOT entry address instead of offset.
  10585. (Target_arm::Scan::global): Issue an error if a symbol would need a
  10586. PLT does not get one because it is untyped. Remove code to create
  10587. dynamic symbols for relative branches.
  10588. (Target_arm::Relocate::relocate: Use 0 instead of false since function
  10589. takes unsigned integer instead of boolean.
  10590. 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
  10591. * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
  10592. (two_file_test_LDADD): Likewise.
  10593. (common_test_1_LDADD): Likewise.
  10594. (exception_test_LDADD) Likewise.
  10595. (weak_test_LDADD): Likewise.
  10596. (many_sections_test_LDADD): Likewise.
  10597. (initpri1_LDADD): Likewise.
  10598. (script_test_1_LDADD): Likewise.
  10599. (script_test_2_LDADD): Likewise.
  10600. (justsyms_LDADD): Likewise.
  10601. (binary_test_LDADD): Likewise.
  10602. (large_LDADD): Likewise.
  10603. * testsuite/Makefile.in: Regenerated.
  10604. 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
  10605. * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
  10606. (Symbol_table::override_with_special): Likewise.
  10607. (Symbol_table::add_from_object): Likewise.
  10608. 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
  10609. * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
  10610. Don't set the data_offset twice.
  10611. 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
  10612. * testsuite/Makefile.in: Regenerate.
  10613. 2009-12-03 Doug Kwan <dougkwan@google.com>
  10614. * arm.cc: Remove comment about missing .ARM.exidx section symbols.
  10615. (Target_arm::do_finalize_sections): Add parameter for symbol table
  10616. pointer. Add __exidx_start and __exidx_end symbols as appropriate.
  10617. * i386.cc (Target_i386::do_finalize_sections): Add an additional
  10618. parameter for symbol table pointer.
  10619. * layout.cc (Layout::finalize): Call Target::finalize_sections with
  10620. an additional parameter for a pointer to symbol table.
  10621. * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
  10622. parameter for a symbol table pointer.
  10623. * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
  10624. * target.h (Target::finalize_sections, Target::do_finalize_sections):
  10625. Ditto.
  10626. * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
  10627. parameter for a symbol table pointer.
  10628. 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
  10629. * incremental.cc (Incremental_inputs_header)
  10630. (Incremental_inputs_header_write, Incremental_inputs_entry)
  10631. (Incremental_inputs_entry_write): Move ...
  10632. * incremental.h (Incremental_inputs_header)
  10633. (Incremental_inputs_header_write, Incremental_inputs_entry)
  10634. (Incremental_inputs_entry_write): here.
  10635. 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
  10636. * incremental.cc (make_sized_incremental_binary): Set the target.
  10637. Error if it is incompatible.
  10638. * output.h (Output_file): Add filename method.
  10639. 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
  10640. * incremental.cc (Incremental_inputs_entry): Remove unused argument
  10641. from the get_* methods.
  10642. 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
  10643. * incremental-dump.cc (main): Check that the offeset of a script is 0.
  10644. * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
  10645. Write 0 for the data_offset of scripts.
  10646. 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
  10647. * testsuite/Makefile.am: Add the incremental_test.sh test.
  10648. * testsuite/incremental_test.sh: New.
  10649. * testsuite/incremental_test_1.c: New.
  10650. * testsuite/incremental_test_2.c: New.
  10651. 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
  10652. * incremental-dump.cc (main): Fix typos.
  10653. 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
  10654. PR gold/11025
  10655. * incremental-dump.cc (main): Use llu to print 64 bit values.
  10656. 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
  10657. H.J. Lu <hongjiu.lu@intel.com>
  10658. * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
  10659. $(LIBDL).
  10660. (incremental_dump_LDADD): Likewise.
  10661. * Makefile.in: Regenerated.
  10662. 2009-11-25 Doug Kwan <dougkwan@google.com>
  10663. Revert:
  10664. 2009-11-25 Doug Kwan <dougkwan@google.com>
  10665. * arm.cc (Target_arm::Target_arm): Move method definition
  10666. outside of class definition. Add code to handle
  10667. --target1-rel, --target1-abs and --target2= options.
  10668. (Target_arm::get_reloc_reloc_type): Change method to be
  10669. non-static and const.
  10670. (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
  10671. New data member declaration.
  10672. (Target_arm::Scan::local, Target_arm::Scan::global,
  10673. Target_arm::Relocate::relocate,
  10674. Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
  10675. Adjust call to Target_arm::get_real_reloc_type.
  10676. (Target_arm::get_real_reloc_type): Use command line options
  10677. to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
  10678. * options.h (--target1-rel, --target1-abs, --target2): New
  10679. ARM-only options.
  10680. 2009-11-25 Doug Kwan <dougkwan@google.com>
  10681. * arm.cc (Target_arm::Target_arm): Move method definition outside of
  10682. class definition. Add code to handle --target1-rel, --target1-abs
  10683. and --target2= options.
  10684. (Target_arm::get_reloc_reloc_type): Change method to be non-static
  10685. and const.
  10686. (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
  10687. member declaration.
  10688. (Target_arm::Scan::local, Target_arm::Scan::global,
  10689. Target_arm::Relocate::relocate,
  10690. Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
  10691. call to Target_arm::get_real_reloc_type.
  10692. (Target_arm::get_real_reloc_type): Use command line options to
  10693. determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
  10694. * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
  10695. options.
  10696. 2009-11-25 Doug Kwan <dougkwan@google.com>
  10697. * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
  10698. (Arm_relocate_functions::thumb_branch_common): New metod declaration.
  10699. (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
  10700. formatting.
  10701. (Arm_relocate_functions::thm_call): Replace body with a call to
  10702. Arm_relocate_functions::thumb_branch_common.
  10703. (Arm_relocate_functions::thm_jump24,
  10704. Arm_relocate_functions::thm_xpc22): New method definitions.
  10705. (Arm_relocate_functions::thumb_branch_common): New method definition.
  10706. (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
  10707. operator.
  10708. (Target_arm::Relocate::relocate): Adjust call to thm_call.
  10709. Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
  10710. 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
  10711. * Makefile.am: Build incremental-dump
  10712. * Makefile.in: Regenerate.
  10713. * incremental-dump.cc: New.
  10714. * incremental.cc (Incremental_inputs_header_data,
  10715. Incremental_inputs_entry_data): Move to incremental.h
  10716. * incremental.h: (Incremental_inputs_header_data,
  10717. Incremental_inputs_entry_data): Move from incremental.cc
  10718. 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
  10719. * incremental.cc (Incremental_inputs_header,
  10720. Incremental_inputs_header_write, Incremental_inputs_entry,
  10721. Incremental_inputs_entry_write): Add a typedef with the data type.
  10722. 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
  10723. * incremental.cc (Incremental_inputs_header,
  10724. Incremental_inputs_header_write, Incremental_inputs_entry,
  10725. Incremental_inputs_entry_write): Update comment about which
  10726. type has the filed descriptions.
  10727. 2009-11-15 Doug Kwan <dougkwan@google.com>
  10728. * arm.cc (Target_arm::may_use_arm_nop): New method definition.
  10729. (Arm_relocate_functions::arm_branch_common): Change method defintion
  10730. in class definition to a method declaration and update list of formal
  10731. parameters.
  10732. (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
  10733. Arm_relocation_functions::jump24): Adjust call to
  10734. Arm_relocate_functions::arm_branch_common. Update list of formal
  10735. parameters.
  10736. (Arm_relocate_functions::xpc25): New method definition.
  10737. (Arm_relocate_functions::arm_branch_common): Move method defintion
  10738. out from class definition. Use stubs for mode-switching and extending
  10739. branch ranges.
  10740. (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
  10741. specially. Change code to enable use of stubs in ARM branches.
  10742. 2009-11-10 Doug Kwan <dougkwan@google.com>
  10743. * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
  10744. in method declaration.
  10745. (Target_arm::relocate_stub): New method declaration.
  10746. (Target_arm::default_target): Change to return a pointer instead of
  10747. a const reference.
  10748. (Reloc_stub::stub_type_for_reloc): Adjust for the change in
  10749. Target_arm::default_target.
  10750. (Arm_Relobj::do_relocate_sections): Remove options paramater in
  10751. method definition.
  10752. (Target_arm::relocate_section): Adjust view.
  10753. (Target_arm::relocate_stub): New method definition.
  10754. 2009-11-10 Doug Kwan <dougkwan@google.com>
  10755. * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
  10756. a format warning.
  10757. * incremental.cc (open_incremental_binary): Initialized local
  10758. variables to avoid warnings.
  10759. * object.cc (make_elf_object): Ditto.
  10760. * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
  10761. a format warning.
  10762. 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
  10763. PR gold/10930
  10764. * testsuite/plugin_test.c: Include "config.h".
  10765. 2009-11-09 Doug Kwan <dougkwan@google.com>
  10766. * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
  10767. (arm_symbol_value): Remove.
  10768. (Arm_relocate_functions::arm_branch_common,
  10769. Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
  10770. Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
  10771. Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
  10772. Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
  10773. Arm_relocate_functions::call, Arm_relocate_functions::jump24,
  10774. Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
  10775. Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
  10776. Arm_relocate_functions::thm_mobw_abs_nc,
  10777. Arm_relocate_functions::thm_mov_abs,
  10778. Arm_relocate_functions::movw_prel_nc,
  10779. Arm_relocate_functions::thm_movt_abs,
  10780. Arm_relocate_functions::movt_prel,
  10781. Arm_relocate_functions::thm_movw_prel_nc,
  10782. Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
  10783. (Target_arm::Relocate::relocate): Only decompose address into two
  10784. parts if relocation type uses the thumb-bit and pass the actual
  10785. bit instead of a flag indicating that the thumb-bit is used. Adjust
  10786. calls to methods in Arm_relocate_functions for this change.
  10787. 2009-11-08 Ian Lance Taylor <iant@google.com>
  10788. PR 10925
  10789. * reloc.cc: Instantiate
  10790. Sized_relobj::initialize_input_to_output_maps and
  10791. Sized_relobj:free_input_to_output_maps.
  10792. 2009-11-06 Ian Lance Taylor <iant@google.com>
  10793. PR 10876
  10794. * defstd.cc (in_segment): Set only_if_ref true for "end".
  10795. 2009-11-06 Doug Kwan <dougkwan@google.com>
  10796. * arm.cc (class Reloc_stub): Correct a comment.
  10797. (Target_arm::Target_arm): Initialize arm_input_section_map_.
  10798. (Target_arm::scan_section_for_stubs): New method declaration.
  10799. (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
  10800. Change methods from private to protected.
  10801. (Target_arm::do_may_relax): New method definition.
  10802. (Target_arm::do_relax, Target_arm::group_sections,
  10803. Target_arm::scan_reloc_for_stub,
  10804. Target_arm::scan_reloc_section_for_stubs): New method declarations.
  10805. (Target_arm::arm_input_section_map_): New data member declaration.
  10806. (Target_arm::scan_reloc_for_stub,
  10807. Target_arm::scan_reloc_section_for_stubs,
  10808. Target_arm::scan_section_for_stubs, Target_arm::group_sections,
  10809. Target_arm::do_relax): New method definitions.
  10810. 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
  10811. * configure.ac: Check for (struct stat)::st_mtim
  10812. * fileread.cc (File_read::get_mtime): Use st_mtim if available.
  10813. * config.in: Regenerate.
  10814. * configure: Regenerate.
  10815. 2009-11-05 Ian Lance Taylor <iant@google.com>
  10816. PR 10910
  10817. * output.cc (Output_segment::add_output_section): Add missing
  10818. return statement.
  10819. 2009-11-04 Ian Lance Taylor <iant@google.com>
  10820. PR 10880
  10821. * object.h (class Object): Add is_needed and set_is_needed
  10822. methods. Add is_needed_ field. Make bool fields into bitfields.
  10823. * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
  10824. defined in a dynamic object and referenced by a regular object,
  10825. set is_needed for the dynamic object.
  10826. * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
  10827. if the file is marked with as_needed and it is not needed.
  10828. 2009-11-04 Ian Lance Taylor <iant@google.com>
  10829. PR 10887
  10830. * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
  10831. tags if data is discarded by linker script.
  10832. * i386.cc (Target_i386::do_finalize_sections): Likewise.
  10833. * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
  10834. * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
  10835. * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
  10836. 2009-11-04 Ian Lance Taylor <iant@google.com>
  10837. * layout.cc (Layout::get_output_section): Add is_interp and
  10838. is_dynamic_linker_section parameters. Change all callers.
  10839. (Layout::choose_output_section): Likewise.
  10840. (Layout::make_output_section): Likewise.
  10841. (Layout::add_output_section_data): Add is_dynamic_linker_section
  10842. parameter. Change all callers.
  10843. * layout.h (class Layout): Update declarations.
  10844. * output.h (class Output_section): Add is_interp, set_is_interp,
  10845. is_dynamic_linker_section, set_is_dynamic_linker_section methods.
  10846. Add is_interp_, is_dynamic_linker_section_ fields. Change
  10847. generate_code_fills_at_write_ to a bitfield.
  10848. * output.cc (Output_section::Output_sections): Initialize new
  10849. fields.
  10850. (Output_segment::add_output_section): Add do_sort parameter.
  10851. Change all callers.
  10852. 2009-11-03 Ian Lance Taylor <iant@google.com>
  10853. PR 10860
  10854. * options.h (class General_options): Add --warn-common.
  10855. * resolve.cc (Symbol_table::resolve): Handle --warn-common when
  10856. merging two common symbols.
  10857. (Symbol_table::should_override): Handle --warn-common when merging
  10858. a common symbol with a defined symbol. Use report_resolve_problem
  10859. for multiple definitions.
  10860. (Symbol_table::report_resolve_problem): New function.
  10861. * symtab.h (class Symbol_table): Declare report_resolve_problem.
  10862. 2009-11-03 Doug Kwan <dougkwan@google.com>
  10863. * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
  10864. stub_factory_.
  10865. (Target_arm::stub_factory): New method definition.
  10866. (Target_arm::new_arm_input_section,
  10867. Target_arm::find_arm_input_section, Target_arm::new_stub_table,
  10868. Target_arm::reloc_uses_thumb_bit): New method declarations.
  10869. (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
  10870. New type definitions.
  10871. (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
  10872. member declarations.
  10873. (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
  10874. Target_arm::find_arm_input_section, Target_arm::new_stub_table):
  10875. New method definitions.
  10876. 2009-11-03 Ian Lance Taylor <iant@google.com>
  10877. * options.h (class General_options): Add --warn_constructors.
  10878. 2009-11-03 Ian Lance Taylor <iant@google.com>
  10879. PR 10893
  10880. * defstd.cc (in_section): Add entries for __rel_iplt_start,
  10881. __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
  10882. 2009-11-03 Ian Lance Taylor <iant@google.com>
  10883. PR 10895
  10884. * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
  10885. --msgid-bugs-address.
  10886. (install-pdf): New target.
  10887. (install-data_yes): Look up one directory to find mkinstalldirs.
  10888. 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
  10889. * po/Make-in (.po.gmo): Don't generate .gmo files in source
  10890. tree.
  10891. 2009-10-30 Doug Kwan <dougkwan@google.com>
  10892. * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
  10893. 2009-10-30 Doug Kwan <dougkwan@google.com>
  10894. * arm.cc (Stub_addend_reader): New struct template definition
  10895. and partial specializations.
  10896. (Stub_addend_reader::operator()): New method definition for a
  10897. partially specialized template.
  10898. 2009-10-30 Doug Kwan <dougkwan@google.com>
  10899. * arm.cc (Arm_relobj::processor_specific_flags): New method
  10900. definition.
  10901. (Arm_relobj::do_read_symbols): New method declaration.
  10902. (Arm_relobj::processor_specific_flags_): New data member declaration.
  10903. (Arm_dynobj): New class definition.
  10904. (Target_arm::do_finalize_sections): Add input_objects parameter.
  10905. (Target_arm::do_adjust_elf_header): New method declaration.
  10906. (Target_arm::are_eabi_versions_compatible,
  10907. (Target_arm::merge_processor_specific_flags): New method declaration.
  10908. (Target_arm::do_make_elf_object): New overloaded method definitions
  10909. and declaration.
  10910. (Arm_relobj::do_read_symbols): New method definition.
  10911. (Arm_dynobj::do_read_symbols): Ditto.
  10912. (Target_arm::do_finalize_sections): Add input_objects parameters.
  10913. Merge processor-specific flags from all input objects.
  10914. (Target_arm::are_eabi_versions_compatible,
  10915. Target_arm::merge_processor_specific_flags,
  10916. Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
  10917. New method definitions.
  10918. * i386.cc (Target_i386::do_finalize_sections): Add unnamed
  10919. Input_objects pointer type parameter.
  10920. * layout.cc (Layout::finalize): Pass input objects to target's.
  10921. finalize_sections function.
  10922. * output.cc (Output_file_header::do_sized_write): Set ELF file
  10923. header's processor-specific flags.
  10924. * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
  10925. Input_objects pointer type parameter.
  10926. * sparc.cc (Target_sparc::do_finalize_sections): Same.
  10927. * target.h (Input_objects): New forward class declaration.
  10928. (Target::processor_specific_flags,
  10929. Target::are_processor_specific_flags_sect): New method definitions.
  10930. (Target::finalize_sections): Add input_objects parameter.
  10931. (Target::Target): Initialize processor_specific_flags_ and
  10932. are_processor_specific_flags_set_.
  10933. (Target::do_finalize_sections): Add unnamed Input_objects pointer type
  10934. parameter.
  10935. (Target::set_processor_specific_flags): New method definition.
  10936. (Target::processor_specific_flags_,
  10937. Target::are_processor_specific_flags_set_): New data member
  10938. declarations.
  10939. * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
  10940. Input_objects pointer type parameter.
  10941. 2009-10-30 Doug Kwan <dougkwan@google.com>
  10942. * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
  10943. 2009-10-28 Ian Lance Taylor <iant@google.com>
  10944. * object.h (class Relobj): Drop options parameter from
  10945. gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
  10946. do_scan_relocs, do_relocate. Change all callers.
  10947. (class Sized_relobj): Drop options parameters from
  10948. do_gc_process_relocs, do_scan_relocs, do_relocate,
  10949. do_relocate_sections, relocate_sections, emit_relocs_scan,
  10950. emit_relocs_scan_reltype. Change all callers.
  10951. (struct Relocate_info): Remove options field and all references to
  10952. it.
  10953. * reloc.h (class Read_relocs): Remove options constructor
  10954. parameter and options_ field. Change all callers.
  10955. (class Gc_process_relocs, class Scan_relocs): Likewise.
  10956. (class Relocate_task): Likewise.
  10957. * target-reloc.h (scan_relocs): Remove options parameter. Change
  10958. all callers.
  10959. (scan_relocatable_relocs): Likewise.
  10960. * target.h (class Sized_target): Remove options parameter from
  10961. gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
  10962. all callers.
  10963. * gc.h (gc_process_relocs): Remove options parameter. Change all
  10964. callers.
  10965. * arm.cc: Update functions to remove options parameters.
  10966. * i386.cc: Likewise.
  10967. * powerpc.cc: Likewise.
  10968. * sparc.cc: Likewise.
  10969. * x86_64.cc: Likewise.
  10970. * testsuite/testfile.cc: Likewise.
  10971. 2009-10-28 Doug Kwan <dougkwan@google.com>
  10972. * arm.cc (Arm_relobj): New class definition.
  10973. (Arm_relobj::scan_sections_for_stubs,
  10974. Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
  10975. New method definitions.
  10976. 2009-10-28 Cary Coutant <ccoutant@google.com>
  10977. * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
  10978. (Plugin::cleanup_done_): New member.
  10979. (Plugin_manager::Plugin_manager): Remove cleanup_done_.
  10980. (Plugin_manager::cleanup_done_): Remove.
  10981. (Plugin_manager::add_input_file): Edit error message.
  10982. * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
  10983. (Plugin_manager::cleanup): Remove use of cleanup_done_.
  10984. 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
  10985. * fileread.cc: (File_read::View::~View): Use the new
  10986. data_ownership_ filed.
  10987. (File_read::~File_read): Dispose the new whole_file_view_.
  10988. (File_read::open): Mmap the whole file if needed.
  10989. (File_read::open): Use whole_file_view_ instead of contents_.
  10990. (File_read::find_view): Use whole_file_view_ if applicable.
  10991. (File_read::do_read): Use whole_file_view_ instead of contents_.
  10992. (File_read::make_view): Use whole_file_view_ instead of contents_,
  10993. update File_read::View::View call.
  10994. (File_read::find_or_make_view): Update File_read::View::View
  10995. call.
  10996. * fileread.h: (File_read::File_read): Initialize whole_file_view_,
  10997. remove contents_
  10998. (File_read::View::Data_ownership): New enum.
  10999. (File_read::View::View): Replace bool mapped_ with Data_ownership
  11000. argument.
  11001. (File_read::View::mapped_): Remove (replaced by data_ownership_).
  11002. (File_read::View::data_ownership_): New field.
  11003. (File_read::contents_): Remove (replaced by whole_file_view_).
  11004. (File_read::whole_file_view_): New field.
  11005. * options.h (class General_options): Add --keep-files-mapped.
  11006. 2009-10-27 Cary Coutant <ccoutant@google.com>
  11007. * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
  11008. * testsuite/Makefile.am (plugin_test_5): New test case.
  11009. * testsuite/Makefile.in: Regenerate.
  11010. 2009-10-25 Doug Kwan <dougkwan@google.com>
  11011. * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
  11012. from private to protected to allow access by child class.
  11013. (Sized_relobj::do_relocate_sections): New method declaration.
  11014. (Sized_relobj::relocate_sections): Virtualize.
  11015. * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
  11016. Sized_relobj::relocate_sections. Instantiate template explicitly
  11017. for different target sizes and endianity.
  11018. 2009-10-24 Doug Kwan <dougkwan@google.com>
  11019. * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
  11020. (Arm_input_section::as_arm_input_section): New method.
  11021. (Arm_output_section): New class definition.
  11022. (Arm_output_section::create_stub_group,
  11023. Arm_output_section::group_sections): New method definitions.
  11024. 2009-10-22 Doug Kwan <dougkwan@google.com>
  11025. * arm.cc (Arm_input_section): New class definition.
  11026. (Arm_input_section::init, Arm_input_section:do_write,
  11027. Arm_input_section::set_final_data_size,
  11028. Arm_input_section::do_reset_address_and_file_offset): New method
  11029. definitions.
  11030. 2009-10-21 Doug Kwan <dougkwan@google.com>
  11031. * arm.cc (Stub_table, Arm_input_section): New forward class
  11032. declarations.
  11033. (Stub_table): New class defintion.
  11034. (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
  11035. Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
  11036. New method definition.
  11037. 2009-10-21 Doug Kwan <dougkwan@google.com>
  11038. * arm.cc: Update copyright comments.
  11039. (Target_arm): New forward class template declaration.
  11040. (Arm_address): New type.
  11041. (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
  11042. THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
  11043. THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
  11044. constants.
  11045. (Insn_template): Same.
  11046. (DEF_STUBS): New macro.
  11047. (Stub_type): New enum type.
  11048. (Stub_template): New class definition.
  11049. (Stub): Same.
  11050. (Reloc_stub): Same.
  11051. (Stub_factory): Same.
  11052. (Target_arm::Target_arm): Initialize may_use_blx_ and
  11053. should_force_pic_veneer_.
  11054. (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
  11055. Target_arm::should_force_pic_veneer,
  11056. Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
  11057. Target_arm::using_thumb_only, Target_arm:;default_target): New
  11058. method defintions.
  11059. (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
  11060. New data member declarations.
  11061. (Insn_template::size, Insn_template::alignment): New method defintions.
  11062. (Stub_template::Stub_template): New method definition.
  11063. (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
  11064. Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
  11065. (Stub_factory::Stub_factory): New method definition.
  11066. * gold.h (string_hash): New template.
  11067. * output.h (Input_section_specifier::hash_value): Use
  11068. gold::string_hash.
  11069. (Input_section_specifier::string_hash): Remove.
  11070. * stringpool.cc (Stringpool_template::string_hash): Use
  11071. gold::string_hash.
  11072. 2009-10-20 Doug Kwan <dougkwan@google.com>
  11073. * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
  11074. symbols of relaxed input sections.
  11075. * output.h (Output_section::find_relaxed_input_section): Make
  11076. method public.
  11077. 2009-10-16 Doug Kwan <dougkwan@google.com>
  11078. * dynobj.cc (Versions::Versions): Initialize version_script_.
  11079. Only insert base version symbol definition for a shared object
  11080. if version script defines any version versions.
  11081. (Versions::define_base_version): New method definition.
  11082. (Versions::add_def): Check that base version is not needed.
  11083. (Versions::add_need): Define base version lazily.
  11084. * dynobj.h (Versions::define_base_version): New method declaration.
  11085. (Versions::needs_base_version_): New data member declaration.
  11086. * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
  11087. (check_DATA): Add no_version_test.stdout.
  11088. (libno_version_test.so, no_version_test.o no_version_test.stdout):
  11089. New make rules.
  11090. * testsuite/Makefile.in: Regenerate.
  11091. * testsuite/no_version_test.c: New file.
  11092. * testsuite/no_version_test.sh: Ditto.
  11093. 2009-10-16 Doug Kwan <dougkwan@google.com>
  11094. * expression.cc (class Segment_start_expression): New class definition.
  11095. (Segment_start_expression::value): New method definition.
  11096. (script_exp_function_segment_start): Return a new
  11097. Segment_start_expression.
  11098. * gold/script-c.h (script_saw_segment_start_expression): New function
  11099. prototype.
  11100. * script-sections.cc (Script_sections::Script_sections): Initialize
  11101. SAW_SEGMENT_START_EXPRESSION_ to false.
  11102. (Script_sections::set_section_addresses): Use -Ttext, -Tdata
  11103. and -Tbbs options to specify section addresses if given in
  11104. command line and no SEGMENT_START expression is seen in a script.
  11105. * script-sections.h (Script_sections::saw_segment_start_expression,
  11106. Script_sections::set_saw_segment_start_expression): New method
  11107. definition.
  11108. (Script_sections::saw_segment_start_expression_): New data member
  11109. declaration.
  11110. * script.cc (script_saw_segment_start_expression): New function.
  11111. * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
  11112. * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
  11113. script_test_7.sh and script_test_8.sh.
  11114. (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
  11115. script_test_8.stdout.
  11116. (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
  11117. (script_test_6, script_test_6.stdout, script_test_7,
  11118. script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
  11119. * Makefile.in: Regenerate.
  11120. * testsuite/script_test_6.sh: New file.
  11121. * testsuite/script_test_6.t: Same.
  11122. * testsuite/script_test_7.sh: Same.
  11123. * testsuite/script_test_7.t: Same.
  11124. * testsuite/script_test_8.sh: Same.
  11125. 2009-10-16 Doug Kwan <dougkwan@google.com>
  11126. * output.cc (Output_segment::set_section_list_address): Cast
  11127. expressions to unsigned long long type to avoid format warnings.
  11128. 2009-10-15 Ian Lance Taylor <iant@google.com>
  11129. * script.cc (Script_options::add_symbol_assignment): Always add a
  11130. dot assignment to script_sections_.
  11131. * script-sections.cc (Script_sections::add_dot_assignment):
  11132. Initialize if necessary.
  11133. * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
  11134. program headers with no load segment if there is a linker script.
  11135. * layout.cc (Layout::set_segment_offsets): Align the file offset
  11136. to the segment aligment for -N or -n with no load segment.
  11137. * output.cc (Output_segment::add_output_section): Don't crash if
  11138. the first section is a TLS section.
  11139. (Output_segment::set_section_list_addresses): Print an error
  11140. message if the address moves backward in a linker script.
  11141. * script-sections.cc
  11142. (Output_section_element_input::set_section_addresses): Don't
  11143. increase *dot_value for a SHF_TLS/SHT_NOBITS section.
  11144. (Orphan_output_section::set_section_addresses): Likewise.
  11145. 2009-10-15 Doug Kwan <dougkwan@google.com>
  11146. * layout.cc (Layout::finish_dynamic_section): Generate tags
  11147. DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
  11148. DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
  11149. used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
  11150. 2009-10-14 Ian Lance Taylor <iant@google.com>
  11151. * object.h (class Relocate_info): Add reloc_shdr and data_shdr
  11152. fields.
  11153. * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
  11154. data_shdr fields of relinfo.
  11155. * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
  11156. (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
  11157. R_386_TLS_LDO_32, adjust based on section flags.
  11158. (Target_i386::Relocate::fix_up_ldo): Remove.
  11159. 2009-10-13 Ian Lance Taylor <iant@google.com>
  11160. Add support for -pie.
  11161. * options.h (class General_options): Add -pie and
  11162. --pic-executable.
  11163. (General_options::output_is_position_independent): Test -pie.
  11164. (General_options::output_is_executable): Return true if not shared
  11165. and not relocatable.
  11166. (General_options::output_is_pie): Remove.
  11167. * options.cc (General_options::finalize): Reject incompatible uses
  11168. of -pie.
  11169. * gold.cc (queue_middle_tasks): A -pie link is not static.
  11170. * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
  11171. * symtab.cc (Symbol::final_value_is_known): Return false if
  11172. output_is_position_independent.
  11173. * layout.cc (Layout::set_segment_offsets): Start at address 0 if
  11174. output_is_position_independent.
  11175. * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
  11176. output_is_position_independent.
  11177. * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
  11178. output_is_position_independent.
  11179. * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
  11180. two_file_pie_test.
  11181. (basic_pie_test.o, basic_pie_test): New targets.
  11182. (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
  11183. (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
  11184. (two_file_pie_test): New target.
  11185. * testsuite/Makefile.in: Rebuild.
  11186. * README: Remove note saying that -pie is not supported.
  11187. 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
  11188. * options.h (class General_options): Add -init and -fini.
  11189. * layout.cc (Layout::finish_dynamic_section): Emit
  11190. given init and fini functions.
  11191. 2009-10-13 Sriraman Tallam <tmsriram@google.com>
  11192. * gc.h (gc_process_relocs): Check if icf is enabled using new
  11193. function.
  11194. * gold.cc (queue_initial_tasks): Likewise.
  11195. (queue_middle_tasks): Likewise.
  11196. * object.cc (do_layout): Likewise.
  11197. * symtab.cc (is_section_folded): Likewise.
  11198. * main.cc (main): Likewise.
  11199. * reloc.cc (Read_relocs::run): Likewise.
  11200. (Sized_relobj::do_scan_relocs): Likewise.
  11201. * icf.cc (is_function_ctor_or_dtor): New function.
  11202. (Icf::find_identical_sections): Check if function is ctor or dtor when
  11203. safe icf is chosen.
  11204. * options.h (General_options::icf): Change option to be an enum.
  11205. (Icf_status): New enum.
  11206. (icf_enabled): New method.
  11207. (icf_safe_folding): New method.
  11208. (set_icf_status): New method.
  11209. (icf_status_): New variable.
  11210. * (options.cc) (General_options::finalize): Set icf_status_.
  11211. * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
  11212. icf_test and icf_keep_unique_test to use the --icf enum flag.
  11213. * testsuite/icf_safe_test.sh: New file.
  11214. * testsuite/icf_safe_test.cc: New file.
  11215. 2009-10-12 Sriraman Tallam <tmsriram@google.com>
  11216. * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
  11217. includes to gc.h and icf.h.
  11218. * arm.cc: Include gc.h.
  11219. * gold.cc: Likewise.
  11220. * i386.cc: Likewise.
  11221. * powerpc.cc: Likewise.
  11222. * sparc.cc: Likewise.
  11223. * x86_64.cc: Likewise.
  11224. * gc.h: Include icf.h.
  11225. 2009-10-11 Ian Lance Taylor <iant@google.com>
  11226. * plugin.cc: Include "gold.h" before other header files.
  11227. 2009-10-10 Chris Demetriou <cgd@google.com>
  11228. * options.h (Input_file_argument::Input_file_type): New enum.
  11229. (Input_file_argument::is_lib_): Replace with...
  11230. (Input_file_argument::type_): New member.
  11231. (Input_file_argument::Input_file_argument): Take Input_file_type
  11232. 'type' rather than boolean 'is_lib' as second argument.
  11233. (Input_file_argument::is_lib): Use type_.
  11234. (Input_file_argument::is_searched_file): New function.
  11235. (Input_file_argument::may_need_search): Handle is_searched_file.
  11236. * options.cc (General_options::parse_library): Support -l:filename.
  11237. (General_options::parse_just_symbols): Update for Input_file_argument
  11238. changes.
  11239. (Command_line::process): Likewise.
  11240. * archive.cc (Archive::get_file_and_offset): Likewise.
  11241. * plugin.cc (Plugin_manager::release_input_file): Likewise.
  11242. * script.cc (read_script_file, script_add_file): Likewise.
  11243. * fileread.cc (Input_file::Input_file): Likewise.
  11244. (Input_file::will_search_for): Handle is_searched_file.
  11245. (Input_file::open): Likewise.
  11246. * readsyms.cc (Read_symbols::get_name): Likewise.
  11247. * testsuite/Makefile.am (searched_file_test): New test.
  11248. * testsuite/Makefile.in: Regenerate.
  11249. * testsuite/searched_file_test.cc: New file.
  11250. * testsuite/searched_file_test_lib.cc: New file.
  11251. 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
  11252. Ian Lance Taylor <iant@google.com>
  11253. * descriptor.cc: Include <cstdio> and "binary-io.h".
  11254. (Descriptors::open): Open the files in binary mode always.
  11255. * script.cc (Lex::get_token): Treat \r as whitespace.
  11256. 2009-10-09 Ian Lance Taylor <iant@google.com>
  11257. * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
  11258. 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
  11259. Ian Lance Taylor <iant@google.com>
  11260. * configure.ac: Check for readv function also.
  11261. * fileread.cc (readv): Define if not HAVE_READV.
  11262. * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
  11263. does not exist.
  11264. * config.in: Regenerate.
  11265. * configure: Regenerate.
  11266. 2009-10-09 Doug Kwan <dougkwan@google.com>
  11267. * layout.cc (Layout::make_output_section): Call target hook to make
  11268. ordinary output section.
  11269. (Layout::finalize): Adjust parameter list of call the
  11270. Target::may_relax().
  11271. * layout.h (class Layout::section_list): New method.
  11272. * merge.h (Output_merge_base::entsize): Change visibility to public.
  11273. (Output_merge_base::is_string, Output_merge_base::do_is_string):
  11274. New methods.
  11275. (Output_merge_string::do_is_string): New method.
  11276. * object.cc (Sized_relobj::do_setup): renamed from
  11277. Sized_relobj::set_up.
  11278. * object.h (Sized_relobj::adjust_shndx,
  11279. Sized_relobj::initializ_input_to_output_maps,
  11280. Sized_relobj::free_input_to_output_maps): Change visibilities to
  11281. protected.
  11282. (Sized_relobj::setup): Virtualize.
  11283. (Sized_relobj::do_setup): New method declaration.
  11284. (Sized_relobj::invalidate_section_offset,
  11285. Sized_relobj::do_invalidate_section_offset): New method decfinitions.
  11286. (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
  11287. * options.cc (parse_int): New function.
  11288. * options.h (parse_int): New declaration.
  11289. (DEFINE_int): New macro.
  11290. (stub_group_size): New option.
  11291. * output.cc (Output_section::Output_section): Initialize memebers
  11292. merge_section_map_, merge_section_by_properties_map_,
  11293. relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
  11294. (Output_section::add_input_section): Handled deferred code-fill
  11295. generation and remove an old comment.
  11296. (Output_section::add_relaxed_input_section): New method definition.
  11297. (Output_section::add_merge_input_section): Use merge section by
  11298. properties map to speed to search. Update merge section maps
  11299. as appropriate.
  11300. (Output_section::build_relaxation_map): New method definition.
  11301. (Output_section::convert_input_sections_in_list_to_relaxed_sections):
  11302. Same.
  11303. (Output_section::relax_input_section): Renamed to
  11304. Output_section::convert_input_sections_to_relaxed_sections and change
  11305. interface to take a vector of pointers to relaxed sections.
  11306. (Output_section::find_merge_section,
  11307. Output_section::find_relaxed_input_section): New method definitions.
  11308. (Output_section::is_input_address_mapped,
  11309. Output_section::output_offset, Output_section::output_address):
  11310. Use output section data maps to speed up searching.
  11311. (Output_section::find_starting_output_address): Add comments.
  11312. (Output_section::do_write,
  11313. Output_section::write_to_postprocessing_buffer): Do code-fill
  11314. generation as appropriate.
  11315. (Output_section::get_input_sections): Invalidate relaxed input section
  11316. map.
  11317. (Output_section::restore_states): Adjust type of checkpoint .
  11318. Invalidate relaxed input section map.
  11319. * output.h (Output_merge_base): New class declaration.
  11320. (Input_section_specifier): New class defintion.
  11321. (class Output_relaxed_input_section) Change base class to
  11322. Output_section_data_build.
  11323. (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
  11324. base class initializer.
  11325. (Output_section::add_relaxed_input_section): New method declaration.
  11326. (Output_section::Input_section): Change visibility to protected.
  11327. (Output_section::Input_section::relobj,
  11328. Output_section::Input_section::shndx): Handle relaxed input sections.
  11329. Output_section::input_sections) Change visibility to protected. Also
  11330. define overload to return a non-const pointer.
  11331. (Output_section::Merge_section_properties): New class defintion.
  11332. (Output_section::Merge_section_by_properties_map,
  11333. Output_section::Output_section_data_by_input_section_map,
  11334. Output_section::Relaxation_map): New types.
  11335. (Output_section::relax_input_section): Rename method to
  11336. Output_section::convert_input_sections_to_relaxed_sections and change
  11337. interface to take a vector of relaxed section pointers.
  11338. (Output_section::find_merge_section,
  11339. Output_section::find_relaxed_input_section,
  11340. Output_section::build_relaxation_map,
  11341. Output_section::convert_input_sections_in_list_to_relaxed_sections):
  11342. New method declarations.
  11343. (Output_section::merge_section_map_
  11344. Output_section::merge_section_by_properties_map_,
  11345. Output_section::relaxed_input_section_map_,
  11346. Output_section::is_relaxed_input_section_map_valid_,
  11347. Output_section::generate_code_fills_at_write_): New data members.
  11348. * script-sections.cc
  11349. (Output_section_element_input::set_section_addresses): Call
  11350. current_data_size and addralign methods of relaxed input sections.
  11351. (Orphan_output_section::set_section_addresses): Call current_data_size
  11352. and addralign methods of relaxed input sections.
  11353. * symtab.cc (Symbol_table::compute_final_value): Extract template
  11354. from the body of Symbol_table::sized_finalize_symbol.
  11355. (Symbol_table::sized_finalized_symbol): Call
  11356. Symbol_table::compute_final_value.
  11357. * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
  11358. (Symbol_table::compute_final_value): New templated method declaration.
  11359. * target.cc (Target::do_make_output_section): New method defintion.
  11360. * target.h (Target::make_output_section): New method declaration.
  11361. (Target::relax): Add more parameters for input objects, symbol table
  11362. and layout. Adjust call to do_relax.
  11363. (Target::do_make_output_section): New method declaration.
  11364. (Target::do_relax): Add parameters for input objects, symbol table
  11365. and layout.
  11366. 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
  11367. * pread.c: Include stdio.h.
  11368. 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
  11369. * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
  11370. defined.
  11371. 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
  11372. * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
  11373. Change read_shndx type to unsigned int.
  11374. (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
  11375. int.
  11376. (Sized_dwarf_line_info::read_line_mappings): Likewise.
  11377. * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
  11378. Change read_shndx type to unsigned int.
  11379. (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
  11380. int.
  11381. (Sized_dwarf_line_info::read_line_mappings): Likewise.
  11382. * layout.cc (Layout::create_symtab_sections): Cast the result of
  11383. local_symcount * symsize to off_t in the gold_assert.
  11384. 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  11385. * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
  11386. R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
  11387. R_ARM_BASE_ABS.
  11388. (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
  11389. (Arm_relocate_functions::thm_abs5): New function.
  11390. (Arm_relocate_functions::abs12): New function.
  11391. (Arm_relocate_functions::abs16): New function.
  11392. (Arm_relocate_functions::base_abs): New function.
  11393. (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
  11394. (Scan::local): Remove special handling of R_ARM_ABS8. Handle
  11395. R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
  11396. R_ARM_BASE_ABS.
  11397. (Scan::global): Likewise.
  11398. (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
  11399. R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
  11400. (Relocatable_size_for_reloc::get_size_for_reloc): Handle
  11401. R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
  11402. R_ARM_BASE_ABS.
  11403. 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  11404. * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
  11405. (Arm_relocate_functions::movt_prel): New function.
  11406. (Arm_relocate_functions::thm_movw_prel_nc): New function.
  11407. (Arm_relocate_functions::thm_movt_prel): New function.
  11408. (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
  11409. R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
  11410. (Scan::global, Relocate::relocate): Likewise.
  11411. (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
  11412. 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
  11413. * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
  11414. Incremental_checker.
  11415. * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
  11416. unsigned int.
  11417. (class Incremental_inputs_header): New class.
  11418. (Incremental_inputs_header_writer): Edit comment.
  11419. (Incremental_inputs_entry): New class.
  11420. (Incremental_inputs_entry_writer): Edit comment.
  11421. (Sized_incremental_binary::do_find_incremental_inputs_section):
  11422. Add *strtab_shndx parameter, fill it.
  11423. (Sized_incremental_binary::do_check_inputs): New method.
  11424. (Incremental_checker::can_incrementally_link_output_file): Use
  11425. Sized_incremental_binary::check_inputs.
  11426. (Incremental_inputs::report_command_line): Save command line in
  11427. command_line_.
  11428. * incremental.h:
  11429. (Incremental_binary::find_incremental_inputs_section): New
  11430. method.
  11431. (Incremental_binary::do_find_incremental_inputs_section): Add
  11432. strtab_shndx parameter.
  11433. (Incremental_binary::do_check_inputs): New pure virtual method.
  11434. (Sized_incremental_binary::do_check_inputs): Declare.
  11435. (Incremental_checker::Incremental_checker): Add incremental_inputs
  11436. parameter, use it to initialize incremental_inputs_.
  11437. (Incremental_checker::incremental_inputs_): New field.
  11438. (Incremental_checker::command_line): New method.
  11439. (Incremental_checker::inputs): New method.
  11440. (Incremental_checker::command_line_): New field.
  11441. 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
  11442. * incremental.cc: Include <cstdarg> and "target-select.h".
  11443. (vexplain_no_incremental): New function.
  11444. (explain_no_incremental): New function.
  11445. (Incremental_binary::error): New method.
  11446. (Sized_incremental_binary::do_find_incremental_inputs_section): New
  11447. method.
  11448. (make_sized_incremental_binary): New function.
  11449. (open_incremental_binary): New function.
  11450. (can_incrementally_link_file): Add checks if output is ELF and has
  11451. inputs section.
  11452. * incremental.h: Include "elfcpp_file.h" and "output.h".
  11453. (Incremental_binary): New class.
  11454. (Sized_incremental_binary): New class.
  11455. (open_incremental_binary): Declare.
  11456. * object.cc (is_elf_object): Use
  11457. elfcpp::Elf_recognizer::is_elf_file.
  11458. (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
  11459. * output.h (Output_file::filesize): New method.
  11460. 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  11461. * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
  11462. New function.
  11463. (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
  11464. (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
  11465. function.
  11466. (Arm_relocate_functions::insert_val_thumb_movw_movt): New
  11467. function.
  11468. (Arm_relocate_functions::movw_abs_nc): New function.
  11469. (Arm_relocate_functions::movt_abs): New function.
  11470. (Arm_relocate_functions::thm_movw_abs_nc): New function.
  11471. (Arm_relocate_functions::thm_movt_abs): New function.
  11472. (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
  11473. R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
  11474. (Scan::global): Likewise.
  11475. (Relocate::relocate): Likewise.
  11476. (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
  11477. 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  11478. * arm.cc (Arm_relocate_functions::got_prel) New function.
  11479. (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
  11480. (Relocate::relocate): Likewise.
  11481. (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
  11482. 2009-10-06 Ian Lance Taylor <iant@google.com>
  11483. * options.h (class General_options): Define
  11484. split_stack_adjust_size parameter.
  11485. * object.h (class Object): Add uses_split_stack_ and
  11486. has_no_split_stack_ fields. Add uses_split_stack and
  11487. has_no_split_stack accessor functions. Declare
  11488. handle_split_stack_section.
  11489. (class Reloc_symbol_changes): Define.
  11490. (class Sized_relobj): Define Function_offsets. Declare
  11491. split_stack_adjust, split_stack_adjust_reltype, and
  11492. find_functions.
  11493. * object.cc (Object::handle_split_stack_section): New function.
  11494. (Sized_relobj::do_layout): Call handle_split_stack_section.
  11495. * dynobj.cc (Sized_dynobj::do_layout): Call
  11496. handle_split_stack_section.
  11497. * reloc.cc (Sized_relobj::relocate_sections): Call
  11498. split_stack_adjust for executable sections in split_stack
  11499. objects. Pass reloc_map to relocate_section.
  11500. (Sized_relobj::split_stack_adjust): New function.
  11501. (Sized_relobj::split_stack_adjust_reltype): New function.
  11502. (Sized_relobj::find_functions): New function.
  11503. * target-reloc.h: Include "object.h".
  11504. (relocate_section): Add reloc_symbol_changes parameter. Change
  11505. all callers.
  11506. * target.h (class Target): Add calls_non_split method. Declare
  11507. do_calls_non_split virtual method. Declare match_view and
  11508. set_view_to_nop.
  11509. * target.cc: Include "elfcpp.h".
  11510. (Target::do_calls_non_split): New function.
  11511. (Target::match_view): New function.
  11512. (Target::set_view_to_nop): New function.
  11513. * gold.cc (queue_middle_tasks): Give an error if mixing
  11514. split-stack and non-split-stack objects with -r.
  11515. * i386.cc (Target_i386::relocate_section): Add
  11516. reloc_symbol_changes parameter.
  11517. (Target_i386::do_calls_non_split): New function.
  11518. * x86_64.cc (Target_x86_64::relocate_section): Add
  11519. reloc_symbol_changes parameter.
  11520. (Target_x86_64::do_calls_non_split): New function.
  11521. * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
  11522. parameter.
  11523. * powerpc.cc (Target_powerpc::relocate_section): Add
  11524. reloc_symbol_changes parameter.
  11525. * sparc.cc (Target_sparc::relocate_section): Add
  11526. reloc_symbol_changes parameter.
  11527. * configure.ac: Call AM_CONDITIONAL for the default target.
  11528. * configure: Rebuild.
  11529. * testsuite/Makefile.am (TEST_AS): New variable.
  11530. (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
  11531. (check_DATA): Add split_i386 and split_x86_64 files.
  11532. (SPLIT_DEFSYMS): Define.
  11533. (split_i386_[1234n].o): New targets.
  11534. (split_i386_[124]): New targets.
  11535. (split_i386_[1234r].stdout): New targets.
  11536. (split_x86_64_[1234n].o): New targets.
  11537. (split_x86_64_[124]): New targets.
  11538. (split_x86_64_[1234r].stdout): New targets.
  11539. (MOSTLYCLEANFILES): Add new executables.
  11540. * testsuite/split_i386.sh: New file.
  11541. * testsuite/split_x86_64.sh: New file.
  11542. * testsuite/split_i386_1.s: New file.
  11543. * testsuite/split_i386_2.s: New file.
  11544. * testsuite/split_i386_3.s: New file.
  11545. * testsuite/split_i386_4.s: New file.
  11546. * testsuite/split_i386_n.s: New file.
  11547. * testsuite/split_x86_64_1.s: New file.
  11548. * testsuite/split_x86_64_2.s: New file.
  11549. * testsuite/split_x86_64_3.s: New file.
  11550. * testsuite/split_x86_64_4.s: New file.
  11551. * testsuite/split_x86_64_n.s: New file.
  11552. * testsuite/testfile.cc (Target_test): Update relocation_section
  11553. function.
  11554. * testsuite/Makefile.in: Rebuild.
  11555. 2009-10-06 Ian Lance Taylor <iant@google.com>
  11556. * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
  11557. (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
  11558. changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
  11559. handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
  11560. the address on ldo_addrs_.
  11561. (Target_i386::Relocate::fix_up_ldo): New function.
  11562. 2009-10-06 Rafael Espindola <espindola@google.com>
  11563. * plugin.cc (add_input_library): New.
  11564. (Plugin::load): Add add_input_library to tv.
  11565. (Plugin_manager::add_input_file): Add the is_lib argument.
  11566. (add_input_file): Update call to Plugin_manager::add_input_file.
  11567. (add_input_library): New.
  11568. * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
  11569. 2009-09-30 Doug Kwan <dougkwan@google.com>
  11570. * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
  11571. symbol and call Symbol::may_need_copy_reloc to determine if
  11572. a copy reloc is needed.
  11573. * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
  11574. nocopyreloc is given in command line.
  11575. (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
  11576. given in command line.
  11577. * i386.cc (Target_i386::may_need_copy_reloc): Remove.
  11578. (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
  11579. of the removed Target_i386::may_need_copy_reloc.
  11580. * options.h (copyreloc): New option with default value false.
  11581. * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
  11582. (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
  11583. instead of the removed Target_powerpc::may_need_copy_reloc.
  11584. * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
  11585. (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
  11586. instead of the removed Target_sparc::may_need_copy_reloc.
  11587. * symtab.h (Symbol::may_need_copy_reloc): New method definition.
  11588. * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
  11589. (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
  11590. instead of the removed Target_x86_64::may_need_copy_reloc.
  11591. 2009-09-30 Ian Lance Taylor <iant@google.com>
  11592. * object.h (class Object): Remove target_ field, and target,
  11593. sized_target, and set_target methods.
  11594. (Object::sized_target): Remove.
  11595. (class Sized_relobj): Update declarations. Remove sized_target.
  11596. * object.cc (Sized_relobj::setup): Remove target parameter.
  11597. Change all callers.
  11598. (Input_objects::add_object): Don't do anything with the target.
  11599. (make_elf_sized_object): Add punconfigured parameter. Change all
  11600. callers. Set or test parameter target.
  11601. * dynobj.cc (Sized_dynobj::target): Remove target parameter.
  11602. Change all callers.
  11603. * parameters.cc (Parameters::set_target): Change parameter type to
  11604. be non-const.
  11605. (Parameters::default_target): Remove.
  11606. (set_parameters_target): Change parameter type to be non-const.
  11607. (parameters_force_valid_target): New function.
  11608. (parameters_clear_target): New function.
  11609. * parameters.h (class Parameters): Update declarations. Remove
  11610. default_target method. Add sized_target and clear_target
  11611. methods. Change target_ to be non-const.
  11612. (set_parameters_target): Update declaration.
  11613. (parameters_force_valid_target): Declare.
  11614. (parameters_clear_target): Declare.
  11615. * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
  11616. as NULL if we aren't searching.
  11617. (Add_symbols::run): Don't check for compatible target.
  11618. * fileread.cc (Input_file::open_binary): Call
  11619. parameters_force_valid_target.
  11620. * gold.cc (queue_middle_tasks): Likewise.
  11621. * plugin.cc (make_sized_plugin_object): Likewise. Don't call
  11622. set_target on object.
  11623. * dynobj.h (class Sized_dynobj): Update declarations.
  11624. * archive.cc (Archive::get_elf_object_for_member): Return NULL if
  11625. make_elf_object returns NULL.
  11626. (Archive::include_member): Don't check whether object target is
  11627. compatible.
  11628. * output.cc (Output_section::add_input_section): Get target from
  11629. parameters.
  11630. (Output_section::relax_input_section): Likewise.
  11631. * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
  11632. parameters.
  11633. (Sized_relobj::do_scan_relocs): Likewise.
  11634. (Sized_relobj::relocate_sections): Likewise.
  11635. * resolve.cc (Symbol_table::resolve): Likewise.
  11636. * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
  11637. parameter. Change all callers.
  11638. (Symbol_table::add_from_object): Get target from parameters.
  11639. (Symbol_table::add_from_relobj): Don't check object target.
  11640. (Symbol_table::add_from_dynobj): Likewise.
  11641. (Symbol_table::define_special_symbol): Get target from
  11642. parameters.
  11643. * symtab.h (class Symbol_table): Update declaration.
  11644. * testsuite/binary_unittest.cc (gold_testsuite): Remove target
  11645. parameter. Change all callers. Clear parameter target.
  11646. (Binary_test): Test target here.
  11647. * testsuite/object_unittest.cc (gold_testsuite): Remove
  11648. target_test_pointer parameter. Change all callers.
  11649. (Object_test): Test target here.
  11650. 2009-09-26 Ian Lance Taylor <iant@google.com>
  11651. * testsuite/initpri1.c: Don't try to use constructor priorities if
  11652. compiling with gcc before 4.3.
  11653. 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
  11654. * testsuite/retain_symbols_file_test.sh (check_present): Change
  11655. output file name to retain_symbols_file_test.stdout.
  11656. (check_absent): Likewise.
  11657. 2009-09-18 Craig Silverstein <csilvers@google.com>
  11658. * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
  11659. * options.cc: Include <cerrno> and <fstream>.
  11660. (General_options::finalize): Parse -retain-symbols-file tag.
  11661. * options.h: New flag.
  11662. (General_options): New method should_retain_symbol, new
  11663. variable symbols_to_retain.
  11664. * symtab.cc (Symbol_table::sized_finalize_symbol): Test
  11665. should_retain_symbol map.
  11666. * testsuite/Makefile.am (retain_symbols_file_test): New test.
  11667. * testsuite/Makefile.in: Regenerate.
  11668. * testsuite/retain_symbols_file_test.sh: New file.
  11669. 2009-09-18 Nick Clifton <nickc@redhat.com>
  11670. * po/es.po: Updated Spanish translation.
  11671. 2009-09-17 Doug Kwan <dougkwan@google.com>
  11672. * debug.h (DEBUG_RELAXATION): New constant.
  11673. (DEBUG_ALL): Add DEBUG_RELAXATION.
  11674. (debug_string_to_enum): Add relaxation debug option.
  11675. * layout.cc
  11676. (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
  11677. Layout::Relaxation_debug_check::read_sections,
  11678. Layout::Relaxation_debug_check::read_sections): New method definitions.
  11679. (Layout::Layout): Initialize data members
  11680. record_output_section_data_from_scrips_,
  11681. script_output_section_data_list_ and relaxation_debug_check_.
  11682. (Layout::save_segments, Layout::restore_segments,
  11683. Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
  11684. Layout::relaxation_loop_body): New method definitions.
  11685. (Layout::finalize): Support relaxation. Move section layout code to
  11686. Layout::relaxation_loop_body.
  11687. (Layout::set_asection_address_from_script): Move code for orphan
  11688. section placement out.
  11689. (Layout::place_orphan_sections_in_script): New method definition.
  11690. * layout.h (Output_segment_headers, Output_file_header):
  11691. New forward class declarations.
  11692. (Layout::~Layout): Define.
  11693. (Layout::new_output_section_data_from_script): New method definition.
  11694. (Layout::place_orphan_sections_in_script): New method declaration.
  11695. (Layout::Segment_states): New type declaration.
  11696. (Layout::save_segments, Layout::restore_segments,
  11697. Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
  11698. Layout::relaxation_loop_body): New method declarations.
  11699. (Layout::Output_section_data_list): New type declaration.
  11700. (Layout::Relaxation_debug_check): New class definition.
  11701. (Layout::record_output_section_data_from_script_,
  11702. Layout::script_output_section_data_list_, Layout::segment_states_,
  11703. Layout::relaxation_debug_check_): New data members.
  11704. * output.cc: (Output_section_headers::do_size): New method definition.
  11705. (Output_section_headers::Output_section_headers): Move size
  11706. computation to Output_section_headers::do_size.
  11707. (Output_segment_headers::do_size): New method definition.
  11708. (Output_file_header::Output_file_header): Move size computation to
  11709. Output_file_header::do_size and call it.
  11710. (Output_file_header::do_size): New method definition.
  11711. (Output_data_group::Output_data_group): Adjust call to
  11712. Output_section_data.
  11713. (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
  11714. (Output_symtab_xindex::do_write): Add array bound check.
  11715. (Output_section::Input_section::print_to_mapfile): Handle
  11716. RELAXED_INPUT_SECTION_CODE.
  11717. (Output_section::Output_section): Initialize data member checkpoint_.
  11718. (Output_section::~Output_section): Delete checkpoint object pointed
  11719. by checkpoint_.
  11720. (Output_section::add_input_section): Always add an Input_section if
  11721. relaxing.
  11722. (Output_section::add_merge_input_section): Add assert.
  11723. (Output_section::relax_input_section): New method definition.
  11724. (Output_section::set_final_data_size): Set load address to zero for
  11725. an unallocated section.
  11726. (Output_section::do_address_and_file_offset_have_reset_values):
  11727. New method definition.
  11728. (Output_section::Input_section_sort_enty::Input_section_sort_enty):
  11729. Handle relaxed input section.
  11730. (Output_section::sort_attached_input_sections): Checkpoint input
  11731. section list lazily.
  11732. (Output_section::get_input_sections): Change type of input_sections to
  11733. list of Simple_input_section pointers. Checkpoint input section list
  11734. lazily. Also handle relaxed input sections.
  11735. (Output_section::add_input_section_for_script): Take a reference to
  11736. a Simple_input_section object instead of Relobj pointer and section
  11737. index as parameter. Handle relaxed input sections.
  11738. (Output_section::save_states, Output_section::restore_states): New
  11739. method definitions.
  11740. * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
  11741. (Output_data::is_data_size_fixed): New method definition.
  11742. (Output_data::reset_addresss_and_file_offset): Do not reset data size
  11743. if it is fixed.
  11744. (Output_data::address_and_file_offset_have_reset_values): New method
  11745. definition.
  11746. (Output_data::do_address_and_file_offset_have_reset_values): New method
  11747. definition.
  11748. (Output_data::set_data_size): Check that data size is not fixed.
  11749. (Output_data::fix_data_size): New method definition.
  11750. (Output_data::is_data_size_fixed_): New data member.
  11751. (Output_section_headers::set_final_data_size): New method definition.
  11752. (Output_section_headers::do_size): New method declaration.
  11753. (Output_segment_headers::set_final_data_size): New method definition.
  11754. (Output_segment_headers::do_size): New method declaration.
  11755. (Output_file_header::set_final_data_size)::New method definition.
  11756. (Output_file_header::do_size)::New method declaration.
  11757. (Output_section_data::Output_section_data): Add new parameter
  11758. is_data_size_fixed and use it to fix data size.
  11759. (Output_data_const::Output_data_const): Adjust call to base class
  11760. constructor and fix data size.
  11761. (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
  11762. base class constructor and fix data size.
  11763. (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
  11764. base class constructor and fix data size.
  11765. (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
  11766. class constructor and fix data size.
  11767. (Output_data_group::set_final_data_size): New method definition.
  11768. (Output_data_dynamic::Dynamic_entry::tag): New method definition.
  11769. (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
  11770. class constructor and fix data size.
  11771. (Output_relaxed_input_section): New class definition.
  11772. (Output_section::Simple_input_section): New class definition.
  11773. (Output_section::get_input_sections): Adjust parameter list.
  11774. (Output_section::add_input_section_for_script): Same.
  11775. (Output_section::save_states, Output_section::restore_states,
  11776. Output_section::do_address_and_file_offset_have_reset_values,
  11777. (Output_section::Input_section::Input_section): Handle
  11778. RELAXED_INPUT_SECTION_CODE. Add new overload for
  11779. Output_relaxed_input_section.
  11780. (Output_section::Input_section::is_input_section,
  11781. Output_section::Input_section::set_output_section): Handle relaxed
  11782. input section.
  11783. (Output_section::Input_section::is_relaxed_input_section,
  11784. Output_section::Input_section::output_section_data,
  11785. Output_section::Input_section::relaxed_input_section): New method
  11786. definitions.
  11787. (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
  11788. value.
  11789. (Output_section::Input_section::u1_): Update comments.
  11790. (Output_section::Input_section::u2_): Add new union member poris.
  11791. (Output_section::Checkpoint_output_section): New classs definition.
  11792. (Output_section::relax_input_section): New method declaration.
  11793. (Output_section::checkpoint_): New data member.
  11794. (Output_segment): Update comments.
  11795. (Output_segment::Output_segment): Un-privatize copy constructor.
  11796. (Output_segment::operator=): Un-privatize.
  11797. * script-sections.cc (Output_section_element::Input_section_list):
  11798. Change element type to Output_section::Simple_input_section.
  11799. (Output_section_element_dot_assignment::set_section_addresses):
  11800. Register output section data for relaxation clean up.
  11801. (Output_data_exression::Output_data_expression): Adjust call to base
  11802. constructor to fix data size.
  11803. (Output_section_element_data::set_section_addresses): Register
  11804. Output_data_expression object for relaxation clean up.
  11805. (struct Input_section_info): Replace Relobj pointer and section index
  11806. pair with Output_section::Simple_input_section and Convert struct to a
  11807. class.
  11808. (Input_section_sorter::operator()): Adjust access to
  11809. Input_section_info data member to use accessors.
  11810. (Output_section_element_input::set_section_addresses): Use layout
  11811. parameter. Adjust code to use Output_section::Simple_input_section
  11812. and Input_secction_info classes. Register filler for relaxation
  11813. clean up.
  11814. (Orphan_output_section::set_section_addresses): Replace Relobj pointer
  11815. and section index pair with Output_section::Simple_input_section
  11816. class. Adjust code accordingly.
  11817. (Phdrs_element::release_segment): New method definition.
  11818. (Script_sections::attach_sections_using_phdrs_clause): Do not modify
  11819. segment list.
  11820. (Script_sections::release_segments): New method definition.
  11821. * gold/script-sections.h (Script_sections::release_segments): New
  11822. method declaration.
  11823. * gold/target.h (Target::may_relax, Target::relax,
  11824. Target::do_may_relax, Target::do_relax): New method definitions.
  11825. 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
  11826. * arm.cc (has_signed_unsigned_overflow): New function.
  11827. (Arm_relocate_functions::abs8): New function.
  11828. (Target_arm::Scan::local): Handle R_ARM_ABS8.
  11829. (Target_arm::Scan::global): Likewise.
  11830. (Target_arm::relocate::relocate): Likewise.
  11831. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
  11832. Likewise.
  11833. 2009-09-16 Cary Coutant <ccoutant@google.com>
  11834. * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
  11835. * testsuite/Makefile.in: Regenerate.
  11836. 2009-09-11 Nick Clifton <nickc@redhat.com>
  11837. * po/gold.pot: Updated by the Translation project.
  11838. 2009-09-08 Cary Coutant <ccoutant@google.com>
  11839. * output.cc (Output_file::open): Add execute permission to empty file.
  11840. * testsuite/Makefile.am (permission_test): New test.
  11841. * testsuite/Makefile.in: Regenerate.
  11842. 2009-09-02 Ian Lance Taylor <iant@google.com>
  11843. * output.cc (Output_file::resize): Call map_no_anonymous rather
  11844. than map.
  11845. 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
  11846. * gold.cc: Include "incremental.h".
  11847. (queue_initial_tasks): Call Incremental_checker methods.
  11848. * incremental.cc: Include "output.h".
  11849. (Incremental_checker::can_incrementally_link_output_file): New
  11850. method.
  11851. * incremental.h (Incremental_checker): New class.
  11852. * output.cc (Output_file::open_for_modification): New method.
  11853. (Output_file::map_anonymous): Changed return type to bool. Record
  11854. map in base_ field.
  11855. (Output_file::map_no_anonymous): New method, broken out of map.
  11856. (Output_file::map): Use map_no_anonymous and map_anonymous.
  11857. * output.h (class Output_file): Update declarations.
  11858. 2009-08-24 Cary Coutant <ccoutant@google.com>
  11859. * options.h (Command_line::Pre_options): New class.
  11860. (Command_line::pre_options): New member.
  11861. * options.cc (gold::options::ready_to_register): New variable.
  11862. (One_option::register_option): Do nothing if not registering options.
  11863. Assert if same short option registered twice.
  11864. (General_options::General_options): Turn off option registration when
  11865. done constructing.
  11866. (Command_line::Pre_options::Pre_options): New constructor.
  11867. 2009-08-24 Cary Coutant <ccoutant@google.com>
  11868. * options.h (General_options::no_keep_memory): Remove incorrect
  11869. short option.
  11870. 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  11871. * Makefile.am (am__skiplex, am__skipyacc): New.
  11872. * Makefile.in: Regenerate.
  11873. 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  11874. * Makefile.am (AM_CPPFLAGS): Renamed from ...
  11875. (INCLUDES): ... this.
  11876. * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
  11877. (AM_CPPFLAGS): Renamed from ...
  11878. (INCLUDE): ... this.
  11879. * Makefile.in, testsuite/Makefile.in: Regenerate.
  11880. * Makefile.in: Regenerate.
  11881. * aclocal.m4: Likewise.
  11882. * config.in: Likewise.
  11883. * configure: Likewise.
  11884. * testsuite/Makefile.in: Likewise.
  11885. * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
  11886. * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
  11887. * Makefile.in: Regenerate.
  11888. * testsuite/Makefile.in: Regenerate.
  11889. 2009-08-19 Cary Coutant <ccoutant@google.com>
  11890. * resolve.cc (Symbol_table::resolve): Don't complain about defined
  11891. symbols in shared libraries overridden by hidden or internal symbols
  11892. in the main program.
  11893. 2009-08-19 Chris Demetriou <cgd@google.com>
  11894. * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
  11895. checking source file names in error messages.
  11896. 2009-08-18 Doug Kwan <dougkwan@google.com>
  11897. * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
  11898. an elcpp::Ehdr as parameter. Adjust call to set_target.
  11899. * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
  11900. an elfcpp::Ehdr as parameter.
  11901. * object.cc (Object::set_target): Remove the version that looks up
  11902. a target and sets it.
  11903. (Sized_relobj::setup): Take a Target object instead of
  11904. an elfcpp::Ehdr as parameter. Adjust call to set_target.
  11905. (make_elf_sized_object): Find target and ask target to
  11906. make an ELF object.
  11907. * object.h: (Object::set_target): Remove the version that looks up
  11908. a target and sets it.
  11909. (Sized_relobj::setup): Take a Target object instead of
  11910. an elfcpp:Ehdr as parameter.
  11911. * target.cc: Include dynobj.h.
  11912. (Target::do_make_elf_object_implementation): New.
  11913. (Target::do_make_elf_object): New.
  11914. * target.h (Target::make_elf_object): New template declaration.
  11915. (Target::do_make_elf_object): New method declarations.
  11916. (Target::do_make_elf_object_implementation): New template declaration.
  11917. 2009-08-14 Ian Lance Taylor <iant@google.com>
  11918. * gold.h (FUNCTION_NAME): Define.
  11919. (gold_unreachable): Use FUNCTION_NAME.
  11920. 2009-08-12 Sriraman Tallam <tmsriram@google.com>
  11921. * icf.cc (Icf::find_identical_sections): Issue a warning when a
  11922. symbol in the --keep-unique list is not found.
  11923. 2009-08-12 Sriraman Tallam <tmsriram@google.com>
  11924. * icf.cc (Icf::find_identical_sections): Unfold symbols that have
  11925. been maked as --keep-unique.
  11926. (Icf::unfold_section): New function.
  11927. * icf.h (Icf::unfold_section): New function.
  11928. * options.h (General_options::keep_unique): New option.
  11929. * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
  11930. * testsuite/Makefile.in: Regenerate.
  11931. * testsuite/icf_keep_unique_test.sh: New file.
  11932. * testsuite/icf_keep_unique_test.cc: New file.
  11933. 2009-08-12 Cary Coutant <ccoutant@google.com>
  11934. PR 10471
  11935. * resolve.cc (Symbol_table::resolve): Check for references from
  11936. dynamic objects to hidden and internal symbols.
  11937. * testsuite/Makefile.am (hidden_test.sh): New test.
  11938. * testsuite/Makefile.in: Regenerate.
  11939. * testsuite/hidden_test.sh: New script.
  11940. * testsuite/hidden_test_1.c: New test source.
  11941. * testsuite/hidden_test_main.c: New test source.
  11942. 2009-08-11 Doug Kwan <dougkwan@google.com>
  11943. * arm.cc: Update comments.
  11944. (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
  11945. segment to locate the .ARM.exidx section if present.
  11946. 2009-08-09 Doug Kwan <dougkwan@google.com>
  11947. * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
  11948. patch.
  11949. 2009-08-07 Sriraman Tallam <tmsriram@google.com>
  11950. * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
  11951. compiler warnings.
  11952. 2009-08-06 Sriraman Tallam <tmsriram@google.com>
  11953. * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
  11954. valid tls_segment only for non-debug-section relocations.
  11955. * testsuite/Makefile.am: Add gc_tls_test.
  11956. * testsuite/Makefile.in: Regenerate.
  11957. * testsuite/gc_tls_test.cc: New file.
  11958. * testsuite/gc_tls_test.sh: New file.
  11959. 2009-08-05 Sriraman Tallam <tmsriram@google.com>
  11960. * icf.cc: New file.
  11961. * icf.h: New file.
  11962. * Makefile.am (CCFILES): Add icf.cc.
  11963. (HFILES): Add icf.h
  11964. * Makefile.in: Regenerate.
  11965. * dynobj.h (Sized_dynobj::do_section_entsize): New function.
  11966. * gc.h (gc_process_relocs): Populate lists used by icf to contain
  11967. section, symbol and addend information for the relocs.
  11968. * gold.cc (queue_middle_tasks): Call identical code folding.
  11969. * gold.h: Add defines for multimap.
  11970. * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
  11971. to the call of finalize_local_symbols.
  11972. * main.cc (main): Create object of class Icf.
  11973. * object.cc (Sized_relobj::do_layout): Allow this function to be
  11974. called twice during icf.
  11975. (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
  11976. to sections marked as identical by icf.
  11977. (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
  11978. when available.
  11979. (Sized_relobj::do_section_entsize): New function.
  11980. * object.h (Object::section_entsize): New function.
  11981. (Object::do_section_entsize): New pure virtual function.
  11982. (Relobj::finalize_local_symbols): Add new parameter.
  11983. (Relobj::do_section_entsize): New function.
  11984. * options.h (General_options::icf): New option.
  11985. (General_options::icf_iterations): New option.
  11986. (General_options::print_icf_sections): New option.
  11987. * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
  11988. * plugin.h (Sized_pluginobj::do_section_entsize): New function.
  11989. * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
  11990. icf.
  11991. * symtab.cc (Symbol_table::is_section_folded): New function.
  11992. (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
  11993. to sections marked as identical by icf.
  11994. * symtab.h (Symbol_table::set_icf): New function.
  11995. (Symbol_table::icf): New function.
  11996. (Symbol_table::is_section_folded): New function.
  11997. (Symbol_table::icf_): New data member.
  11998. * target-reloc.h (relocate_section): Ignore sections folded by icf.
  11999. * testsuite/Makefile.am: Add commands to build icf_test.
  12000. * testsuite/Makefile.in: Regenerate.
  12001. * testsuite/icf_test.sh: New file.
  12002. * testsuite/icf_test.cc: New file.
  12003. 2009-07-24 Chris Demetriou <cgd@google.com>
  12004. * layout.cc (is_compressible_debug_section): Fix incorrect
  12005. comment about compressed section names.
  12006. 2009-07-20 Ian Lance Taylor <ian@airs.com>
  12007. PR 10419
  12008. * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
  12009. 2009-07-16 Ian Lance Taylor <iant@google.com>
  12010. PR 10400
  12011. * layout.h: #include <map>.
  12012. (class Kept_section): Change from struct to class. Add accessors
  12013. and setters. Add section size to Comdat_group mapping. Change
  12014. Comdat_group to std::map. Add is_comdat_ field. Add
  12015. linkonce_size field in union.
  12016. (class Layout): Update declaration of find_or_add_kept_section.
  12017. Don't declare find_kept_object.
  12018. * layout.cc (Layout::find_or_add_kept_section): Remove candidate
  12019. parameter. Add object, shndx, is_comdat, and is_group_name
  12020. parameters. Change all callers. Adjust for new Kept_section.
  12021. (Layout::find_kept_object): Remove.
  12022. * object.cc (Sized_relobj::include_section_group): Update use of
  12023. Kept_section. Rename secnum to shndx. Only record
  12024. Kept_comdat_section if sections are the same size.
  12025. (Sized_relobj::include_linkonce_section): Update use of
  12026. Kept_section. Only record Kept_comdat_section if sections are the
  12027. same size. Set size of linkonce section.
  12028. (Sized_relobj::map_to_kept_section): Update call to
  12029. get_kept_comdat_section.
  12030. * object.h (class Sized_relobj): Rename fields in
  12031. Kept_comdat_section to drop trailing underscores; change object
  12032. field to Relobj*. Change Kept_comdat_section_table to store
  12033. struct rather than pointer.
  12034. (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
  12035. Add kept_object and kept_shndx parameters. Change all callers.
  12036. (Sized_relobj::get_kept_comdat_section): Change return type to
  12037. bool. Add kept_object and kept_shndx parameters. Change all
  12038. callers.
  12039. * plugin.cc (Pluginobj::include_comdat_group): Update call to
  12040. Layout::find_or_add_kept_section.
  12041. 2009-07-09 Ian Lance Taylor <iant@google.com>
  12042. * merge.cc (Object_merge_map::initialize_input_to_output_map):
  12043. Reserve space in the hash table.
  12044. 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
  12045. * fileread.cc (File_read::get_mtime): New method.
  12046. * fileread.h (Timespec): New structure.
  12047. (File_read::get_mtime): New method.
  12048. * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
  12049. Renamed from timestamp_nsec.
  12050. (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
  12051. Elf_Xword.
  12052. (Incremental_inputs_entry_write::timestamp_usec): Renamed from
  12053. timestamp_nsec.
  12054. (Incremental_inputs::report_archive): Save mtime; style fix.
  12055. (Incremental_inputs::report_obejct): Save mtime; style fix.
  12056. (Incremental_inputs::report_script): Save mtime; style fix.
  12057. (Incremental_inputs::finalize_inputs): Style fix.
  12058. (Incremental_inputs::finalize): Style fix.
  12059. (Incremental_inputs::create_input_section_data): Store inputs
  12060. mtime.
  12061. * incremental.h (Incremental_inputs::report_script): Add mtime
  12062. argument.
  12063. (Incremental_inputs::Input_info::Input_info): Intialize only one
  12064. union member.
  12065. (Incremental_inputs::Input_info::archive): Move to nameless
  12066. union.
  12067. (Incremental_inputs::Input_info::obejct): Move to nameless union.
  12068. (Incremental_inputs::Input_info::script): Move to nameless union.
  12069. (Incremental_inputs::mtime): New field.
  12070. * script.cc (read_input_script): Pass file mtime to
  12071. Incremental_input.
  12072. * script.h (Script_info::inputs): Style fix.
  12073. 2009-07-01 Ian Lance Taylor <ian@airs.com>
  12074. * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
  12075. instead of 32.
  12076. 2009-06-24 Ian Lance Taylor <iant@google.com>
  12077. PR 10156
  12078. * layout.cc (Layout::choose_output_section): If we find an
  12079. existing section, update the flags.
  12080. (Layout::create_notes): New function, broken out of
  12081. Layout::finalize.
  12082. (Layout::finalize): Don't create note sections.
  12083. (Layout::create_note): Don't crash if linker script discards
  12084. section.
  12085. (Layout::create_gold_note): Likewise.
  12086. (Layout::create_build_id): Likewise. Don't set
  12087. after_input_sections on the section.
  12088. (Layout::create_executable_stack_info): Remove target parameter.
  12089. Change caller.
  12090. * layout.h (class Layout): Declare create_notes. Update
  12091. declaration of create_executable_stack_info.
  12092. * gold.cc (queue_middle_tasks): Call create_notes.
  12093. * output.cc (Output_section::update_flags_for_input_section): Move
  12094. here from output.h. If SHF_ALLOC flag is newly set, mark address
  12095. invalid.
  12096. * output.h (Output_data::mark_address_invalid): New function.
  12097. (class Output_section): Only declare, not define,
  12098. update_flags_for_input_section. Remove set_flags.
  12099. 2009-06-24 Ian Lance Taylor <iant@google.com>
  12100. * script-sections.cc (Output_section_definition::
  12101. set_section_addresses): Rename shadowing local load_address to
  12102. laddr.
  12103. 2009-06-24 Ian Lance Taylor <iant@google.com>
  12104. PR 10244
  12105. * reloc.cc (relocate_sections): Skip empty relocation sections.
  12106. 2009-06-23 Ian Lance Taylor <iant@google.com>
  12107. PR 10156
  12108. * layout.cc (Layout::create_note): Use choose_output_section
  12109. rather than make_output_section.
  12110. 2009-06-23 Ian Lance Taylor <iant@google.com>
  12111. PR 10237
  12112. * options.cc (General_options::parse_V): Set printed_version_.
  12113. (General_options::General_options): Initialize printed_version_.
  12114. * options.h (class General_options): Add printed_version_ field.
  12115. * gold.cc (queue_initial_tasks): If there are no input files,
  12116. don't give a fatal error if we printed the version information.
  12117. (queue_middle_tasks): If using -r with a shared object, give a
  12118. fatal error rather than an ordinary error.
  12119. 2009-06-23 Ian Lance Taylor <iant@google.com>
  12120. PR 10219
  12121. * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
  12122. (Layout::make_output_section): Set have_stabstr_section_ if we see
  12123. a .stab*str section.
  12124. (Layout::finalize): Call link_stabs_sections.
  12125. (Layout::link_stabs_sections): New file.
  12126. * layout.h (class Layout): Add have_stabstr_section_ field.
  12127. Declare link_stabs_sections.
  12128. 2009-06-23 Doug Kwan <dougkwan@google.com>
  12129. * Makefile.am (libgold_a_LIBADD): New.
  12130. (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
  12131. * Makefile.in: Regenerate.
  12132. * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
  12133. * configure: Regenerate.
  12134. * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
  12135. * fileread.cc: Include sys/state.h
  12136. * gold.h: Declare memmem and strndup if found missing.
  12137. * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
  12138. 2009-06-23 Ian Lance Taylor <iant@google.com>
  12139. * configure.ac: Call AC_CHECK_DECLS using C, not C++.
  12140. * configure: Rebuild.
  12141. 2009-06-23 Ian Lance Taylor <iant@google.com>
  12142. PR 10147
  12143. * object.cc (Object::section_contents): Don't try to get a view if
  12144. the section has length zero.
  12145. (Object::handle_gnu_warning_section): If the section is empty, use
  12146. the name of the section as the warning.
  12147. 2009-06-23 Ian Lance Taylor <iant@google.com>
  12148. PR 10133
  12149. * stringpool.h (class Stringpool_template): Add optimize_ field.
  12150. (Stringpool_template::set_optimize): New function.
  12151. * stringpool.cc (Stringpool_template::Stringpool_template):
  12152. Initialize optimize_ field.
  12153. (Stringpool_template::set_string_offsets): Test local optimize
  12154. fild rather than parameter.
  12155. * layout.cc (Layout::Layout): Call set_optimize on the section
  12156. name stringpool.
  12157. 2009-06-22 Ian Lance Taylor <iant@google.com>
  12158. PR 10030
  12159. * yyscript.y: Parse TARGET.
  12160. * script.cc (script_set_target): New function.
  12161. * script-c.h (script_set_target): Declare.
  12162. * options.cc (General_options::string_to_object_format): Rename
  12163. from string_to_object_format in anonymous namespace. Change
  12164. callers.
  12165. * options.h (class General_options): Declare
  12166. string_to_object_format.
  12167. 2009-06-22 Ian Lance Taylor <iant@google.com>
  12168. * script-sections.cc (Script_sections::create_segments): Don't put
  12169. program headers in a PT_LOAD segment if -n or -N.
  12170. 2009-06-22 Ian Lance Taylor <iant@google.com>
  12171. PR 10141
  12172. * options.h (class General_options): Add -z lazy and -z now. Sort
  12173. -z options into alphabetical order.
  12174. * layout.cc (Layout::finish_dynamic_section): Handle -z now.
  12175. 2009-06-21 Ian Lance Taylor <iant@google.com>
  12176. * layout.cc (Layout::make_output_section): Call
  12177. Target::new_output_section.
  12178. (Layout::attach_allocated_section_to_segment): Put large section
  12179. sections in a separate load segment with the large segment flag
  12180. set.
  12181. (Layout::segment_precedes): Sort large data segments after other
  12182. load segments.
  12183. (align_file_offset): New static function.
  12184. (Layout::set_segment_offsets): Use align_file_offset.
  12185. * output.h (class Output_section): Add is_small_section_ and
  12186. is_large_section_ fields.
  12187. (Output_section::is_small_section): New function.
  12188. (Output_section::set_is_small_section): New function.
  12189. (Output_section::is_large_section): New function.
  12190. (Output_section::set_is_large_section): New function.
  12191. (Output_section::is_large_data_section): New function.
  12192. (class Output_segment): Add is_large_data_segment_ field.
  12193. (Output_segment::is_large_data_segment): New function.
  12194. (Output_segment::set_is_large_data_segment): New function.
  12195. * output.cc (Output_section::Output_section): Initialize new
  12196. fields.
  12197. (Output_segment::Output_segment): Likewise.
  12198. (Output_segment::add_output_section): Add assertion that large
  12199. data sections always go in large data segments. Force small data
  12200. sections to the end of the list of data sections. Force small BSS
  12201. sections to the start of the list of BSS sections. For large BSS
  12202. sections to the end of the list of BSS sections.
  12203. * symtab.h (class Symbol): Declare is_common_shndx.
  12204. (Symbol::is_defined): Check Symbol::is_common_shndx.
  12205. (Symbol::is_common): Likewise.
  12206. (class Symbol_table): Define enum Commons_section_type. Update
  12207. declarations. Add small_commons_ and large_commons_ fields.
  12208. * symtab.cc (Symbol::is_common_shndx): New function.
  12209. (Symbol_table::Symbol_table): Initialize new fields.
  12210. (Symbol_table::add_from_object): Put small and large common
  12211. symbols in the right list.
  12212. (Symbol_table::sized_finalized_symbol): Check
  12213. Symbol::is_common_shndx.
  12214. (Symbol_table::sized_write_globals): Likewise.
  12215. * common.cc (Symbol_table::do_allocate_commons): Allocate new
  12216. common symbol lists. Don't call do_allocate_commons_list if the
  12217. list is empty.
  12218. (Symbol_table::do_allocate_commons_list): Remove is_tls
  12219. parameter. Add comons_section_type parameter. Change all
  12220. callers. Handle small and large common symbols.
  12221. * object.cc (Sized_relobj::do_finalize_local_symbols): Check
  12222. Symbol::is_common_shndx.
  12223. * resolve.cc (symbol_to_bits): Likewise.
  12224. * target.h (Target::small_common_shndx): New function.
  12225. (Target::small_common_section_flags): New function.
  12226. (Target::large_common_shndx): New function.
  12227. (Target::large_common_section_flags): New function.
  12228. (Target::new_output_section): New function.
  12229. (Target::Target_info): Add small_common_shndx, large_common_shndx,
  12230. small_common_section_flags, and large_common_section_flags
  12231. fields.
  12232. (Target::do_new_output_section): New virtual function.
  12233. * arm.cc (Target_arm::arm_info): Initialize new fields.
  12234. * i386.cc (Target_i386::i386_info): Likewise.
  12235. * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
  12236. Likewise.
  12237. * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
  12238. * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
  12239. (Target_x86_64::do_new_output_section): New function.
  12240. * configure.ac: Define conditional MCMODEL_MEDIUM.
  12241. * testsuite/Makefile.am (check_PROGRAMS): Add large.
  12242. (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
  12243. (large_LDFLAGS): Define.
  12244. * testsuite/large.c: New file.
  12245. * testsuite/testfile.cc (Target_test::test_target_info):
  12246. Initialize new fields.
  12247. * configure, testsuite/Makefile.in: Rebuild.
  12248. 2009-06-05 Doug Kwan <dougkwan@google.com>
  12249. * Makefile.am (CCFILES): Add target.cc.
  12250. * Makefile.in: Regenerate.
  12251. * i386.cc (class Target_i386): Define new virtual method to
  12252. override do_is_local_label_name in parent.
  12253. * object.cc (Sized_relobj::do_count_local_symbols): Discard
  12254. local symbols if --discard-locals or -X is given.
  12255. * options.h (class General_options): Declare new options
  12256. '--discard-locals' and '-X' for discarding locals.
  12257. * target.h (class Target): Define new methods is_local_label_name.
  12258. Declare new virtual method do_is_local_label_name.
  12259. * target.cc: New file.
  12260. * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
  12261. (check_SCRIPTS): Add discard_locals_test.sh.
  12262. (check_DATA): Add discard_local_tests.syms.
  12263. (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
  12264. (discard_local_tests.syms, discard_locals_test.o): New make rules.
  12265. * testsuite/Makefile.in: Regenerate.
  12266. * testsuite/discard_locals_test.c: New file.
  12267. * testsuite/discard_locals_test.sh: Same.
  12268. 2009-06-05 Doug Kwan <dougkwan@google.com>
  12269. * object.cc (Sized_relobj::Sized_relobj): Initialize
  12270. discarded_eh_frame_shndx_ to -1U.
  12271. (Sized_relobj::do_layout): Record index of a discard .eh_frame
  12272. section.
  12273. (Sized_relobj::do_count_local_symbols): Skip local symbols in
  12274. a discarded .eh_frame section.
  12275. (Sized_relobj::do_finalize_local_symbols): Ditto.
  12276. * object.h (class Sized_relobj): Declare new member
  12277. discarded_eh_frame_shndx_.
  12278. * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
  12279. (local_labels_test.o, local_labels_test): New rules.
  12280. * testsuite/Makefile.in: Regenerate.
  12281. 2009-06-04 Doug Kwan <dougkwan@google.com>
  12282. * layout.cc (Layout::section_name_mapping): Add mapping for
  12283. special ARM sections.
  12284. 2009-06-03 Doug Kwan <dougkwan@google.com>
  12285. * arm.cc (utils::sign_extend): Reverse test in gold_assert.
  12286. (utils::has_overflow): Same.
  12287. 2009-06-03 Ian Lance Taylor <iant@google.com>
  12288. * layout.cc (Layout::section_name_mapping): New array, replacing
  12289. Layout::linkonce_mapping.
  12290. (Layout::section_name_mapping_count): New variable, replacing
  12291. Layout::linkonce_mapping_count.
  12292. (Layout::linkonce_output_name): Remove.
  12293. (Layout::output_section_name): Rewrite.
  12294. * layout.h (class Layout): Rename Linkonce_mapping to
  12295. Section_name_mapping, linkonce_mapping to section_name_mapping,
  12296. linkonce_mapping_count to section_name_mapping_count. Don't
  12297. declare linkonce_output_name.
  12298. 2009-06-03 Doug Kwan <dougkwan@google.com>
  12299. * gold/arm.cc (namespace utils): New.
  12300. (Target_arm::reloc_is_non_pic): Define new method.
  12301. (class Arm_relocate_functions): New.
  12302. (Target_arm::Relocate::relocate): Handle relocation types used by
  12303. Android.
  12304. 2009-06-03 Ian Lance Taylor <iant@google.com>
  12305. * arm.cc (Target_arm::scan::global): Use || instead of |.
  12306. 2009-06-02 Doug Kwan <dougkwan@google.com>
  12307. * gold/arm.cc (Target_arm::Scan::Scan): Initialize
  12308. issued_non_pic_error_.
  12309. (class Target_arm::Scan): Declare new method check_non_pic.
  12310. Define new method symbol_needs_plt_entry.
  12311. Declare new data member issued_non_pic_error_.
  12312. (class Target_arm::Relocate): Declare new method
  12313. should_apply_static_reloc.
  12314. (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
  12315. (Target_arm::Scan::check_non_pic): Define new method.
  12316. (Target_arm::Scan::local): Handle a small subset of reloc types used
  12317. by Android.
  12318. (Target_arm::Scan::local): Same.
  12319. (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
  12320. 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
  12321. * incremental.cc (Incremental_inputs::report_command_line): Filter
  12322. out --incremental-* options.
  12323. 2009-05-29 Doug Kwan <dougkwan@google.com>
  12324. * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
  12325. template class.
  12326. (class Target_arm): Update comment.
  12327. (Target_arm::Target_arm): Initialize new data members GOT_,
  12328. PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
  12329. Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
  12330. and Target_arm::rel_dyn_section.
  12331. Declare new_enum Target_arm::Got_type.
  12332. Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
  12333. and DYNBSS_.
  12334. Update commments for member do_dynsym_value.
  12335. (Target_arm::got_size, Target_arm::plt_section,
  12336. Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
  12337. new methods inside class defintion.
  12338. (Target_arm::got_section): Define new method.
  12339. (Target_arm::rel_dyn_section): Same.
  12340. (Output_data_plt_arm): New template class.
  12341. (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
  12342. (Output_data_plt_arm:do_adjust_output_section): Define new method.
  12343. (Output_data_plt_arm::add_entry): Same.
  12344. (Output_data_plt_arm::first_plt_entry): Define new
  12345. static data member for PLT instruction template.
  12346. (Output_data_plt_arm::plt_entry): Same.
  12347. (Output_data_plt_arm::do_write): Define new method.
  12348. (Target_arm::make_plt_entry): Same.
  12349. (Target_arm::do_finalize_sections): Same.
  12350. (Target_arm::do_dynsym_value): Same.
  12351. 2009-05-28 Doug Kwan <dougkwan@google.com>
  12352. * Makefile.am (TARGETSOURCES): Add arm.cc.
  12353. (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
  12354. * Makefile.in: Regenerate.
  12355. * arm.cc: New file.
  12356. * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
  12357. 2009-05-26 Doug Kwan <dougkwan@google.com>
  12358. * options.cc (General_options::parse_exclude_libs). Fix a comment.
  12359. (General_options::check_excluded_libs): Strip off directories in
  12360. archive name before matching like GNU ld does.
  12361. * testsuite/Makefile.am (MOSTLYCLEANFILES,
  12362. exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
  12363. (exclude_libs_test_LDFLAGS): Add linker option
  12364. -Wl,--exclude-libs,libexclude_libs_test_3
  12365. (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
  12366. an explicit archive without using -l.
  12367. (alt/libexclude_libs_test_3.a): New make rule.
  12368. * testsuite/Makefile.in: Regenerate.
  12369. * testsuite/exclude_libs_test.c : Declare lib3_default().
  12370. (main): Call it.
  12371. * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
  12372. * exclude_libs_test_3.c: New file.
  12373. 2009-05-26 Nick Clifton <nickc@redhat.com>
  12374. * po/id.po: New Indonesian translation.
  12375. * po/gold.pot: Updated template file.
  12376. 2009-05-22 Sriraman Tallam <tmsriram@google.com>
  12377. * testsuite/Makefile.am: Add -ffunction-sections to compile
  12378. gc_comdat_test files. Add -Wl,--gc-sections to build
  12379. gc_comdat_test.
  12380. * testsuite/Makefile.in: Regenerate.
  12381. * testsuite/gc_comdat_test.sh: Fix the condition around grep.
  12382. 2009-05-21 Sriraman Tallam <tmsriram@google.com>
  12383. * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
  12384. kept comdat section was garbage collected.
  12385. * testsuite/Makefile.am: Add test gc_comdat_test.sh.
  12386. * testsuite/Makefile.in: Regenerate.
  12387. * testsuite/gc_comdat_test.sh: New file.
  12388. * testsuite/gc_comdat_test_1.cc: New file.
  12389. * testsuite/gc_comdat_test_2.cc: New file.
  12390. 2009-05-19 Doug Kwan <dougkwan@google.com>
  12391. * archive.cc (Archive::Archive): Move constructor from archive.h
  12392. to here. Initialize no_export_.
  12393. (Archive::get_elf_object_for_member): Set no_export flag of object.
  12394. * archive.h (Archive::Archive): Move constructor body to
  12395. archive.cc.
  12396. (Archive::no_export): New method.
  12397. (Archive::no_export_): New field.
  12398. * object.h (Object::Object): Initialize no_export_ to false.
  12399. (Object::no_export, Object::set_no_export): New methods.
  12400. (Object::no_export_): New field.
  12401. * options.cc (General_options::parse_exclude_libs): New method.
  12402. (General_options::check_excluded_libs) Same.
  12403. * options.h (exclude_libs): New option.
  12404. (General_options::check_excluded_libs): New method declaration.
  12405. (General_options::excluded_libs_): New field.
  12406. * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
  12407. default or protected visibility if an object has no-export flag set.
  12408. testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
  12409. (check_SCRIPTS): Add exclude_libs_test.sh.
  12410. (check_DATA): Add exclude_libs_test.syms.
  12411. (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
  12412. libexclude_libs_test_1.a and libexclude_libs_test_2.a.
  12413. (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
  12414. exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
  12415. (exclude_libs_test.syms, libexclude_libs_test_1.a,
  12416. libexclude_libs_test_2.a): New rules.
  12417. * testsuite/Makefile.in: Regenerate.
  12418. * testsuite/exclude_libs_test.c: New file.
  12419. * testsuite/exclude_libs_test.sh: Ditto.
  12420. * testsuite/exclude_libs_test_1.c: Ditto.
  12421. * testsuite/exclude_libs_test_2.c: Ditto.
  12422. 2009-05-15 Ian Lance Taylor <iant@google.com>
  12423. * configure.ac: Check for declarations for cases where libiberty.h
  12424. checks HAVE_DECL_xxx.
  12425. * configure, config.in: Rebuild.
  12426. 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
  12427. * gold.h (Incremental_argument_list): Remove (invalid) forward
  12428. declaration.
  12429. * incremental.cc (Incremental_inputs::report_achive): New method.
  12430. (Incremental_inputs::report_object): New method.
  12431. (Incremental_inputs::report_script): New method.
  12432. (Incremental_inputs::finalize_inputs): New method.
  12433. (Incremental_inputs::finalize): Call finalize_inputs().
  12434. (Incremental_inputs::sized_create_incremental_inputs_section_data):
  12435. Create inputs entries.
  12436. * incremental.h (Incremental_input_type): New enum.
  12437. (Incremental_inputs::Incremental_input): Initialize new fields.
  12438. (Incremental_inputs::report_inputs): New method.
  12439. (Incremental_inputs::report_achive): New method.
  12440. (Incremental_inputs::report_object): New method.
  12441. (Incremental_inputs::report_script): New method.
  12442. (Incremental_inputs::finalize_inputs): New method.
  12443. (Incremental_inputs::Input_info): New struct.
  12444. (Incremental_inputs::Input_info_map): New typedef.
  12445. (Incremental_inputs::lock_): New field.
  12446. (Incremental_inputs::Inputs_): New field.
  12447. (Incremental_inputs::Inputs_map): New field.
  12448. * main.cc (main): Call Incremental_input::report_inputs.
  12449. * options.h (Input_argument_list): Typedef moved from
  12450. Input_arguments.
  12451. (Input_file_group::Files): Remove, use ::Input_argument_list.
  12452. (Input_file_group::Input_argument_list): Remove, use
  12453. ::Input_argument_list.
  12454. * plugin.cc (Plugin_manager::add_input_file): Add error in
  12455. incremental build.
  12456. * read_syms.cc (do_read_syms): Call Incremental_input::report_*
  12457. functions.
  12458. * script.cc (read_input_script): Call
  12459. Incremental_input::report_script.
  12460. * script.h (Script_info): New class.
  12461. 2009-04-27 Ian Lance Taylor <iant@google.com>
  12462. * x86_64.cc (do_adjust_output_section): Set entsize to
  12463. plt_entry_size.
  12464. 2009-04-23 Elliott Hughes <enh@google.com>
  12465. * output.cc (Output_file::close): After short writes, continue
  12466. writing from the correct offset in the buffer being written.
  12467. 2009-04-23 Chris Demetriou <cgd@google.com>
  12468. * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
  12469. * configure: Regenerate.
  12470. * config.in: Regenerate.
  12471. * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
  12472. if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
  12473. 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
  12474. * incremental.cc (Incremental_inputs_header_data): Renamed from
  12475. Incremental_input_header_data.
  12476. (Incremental_inputs_header_data::data_size): New field.
  12477. (Incremental_inputs_header_data::put_input_file_count): Renamed
  12478. from input_file_count.
  12479. (Incremental_inputs_header_data::put_command_line_offset): Renamed
  12480. from command_line_offset.
  12481. (Incremental_inputs_header_data::put_reserved): Renamed from
  12482. put_reserved.
  12483. (Incremental_inputs_entry_data): Renamed from
  12484. Incremental_input_entry_data.
  12485. (Incremental_inputs_entry_data::data_size): New field.
  12486. (Incremental_inputs::report_command_line): New method.
  12487. (Incremental_inputs::finalize): New method.
  12488. (Incremental_inputs::create_incremental_inputs_data): New method.
  12489. (Incremental_inputs::sized_create_incremental_inputs_data): New method.
  12490. * incremental.h: New file.
  12491. * layout.cc (Layout::Layout): Handle new incremental_inputs_.
  12492. (Layout::finalize): Create incremental inputs section in
  12493. incremental builds.
  12494. (Layout::create_incremental_info_sections): New method.
  12495. * layout.h (Layout::incremental_inputs): New method.
  12496. (Layout::create_incremental_info_sections): New method.
  12497. (Layout::incremental_inputs_): New field.
  12498. * main.cc (main): Notify Incremental_input of the command line.
  12499. 2009-04-01 Ian Lance Taylor <iant@google.com>
  12500. Mikolaj Zalewski <mikolajz@google.com>
  12501. * gold.h (reserve_unordered_map): Define, three versions, one for
  12502. each version of Unordered_map.
  12503. * layout.cc (Layout::Layout): Remove options parameter. Add
  12504. number_of_input_files parameter. Don't initialize options_.
  12505. Initialize number_of_input_files_ and resized_signatures_. Move
  12506. sections_are_attached_.
  12507. (Layout::layout_group): Reserve space for group_signatures_.
  12508. (Layout::find_or_add_kept_section): Change name parameter to be a
  12509. reference. Resize signatures_ map when it gets large enough.
  12510. (Layout::layout_eh_frame): Use parameters->options() instead of
  12511. this->options_.
  12512. (Layout::make_output_section): Likewise.
  12513. (Layout::attach_allocated_section_to_segment): Likewise.
  12514. (Layout::finalize, Layout::create_executable_stack): Likewise.
  12515. (Layout::set_segment_offsets, Layout::create_interp): Likewise.
  12516. (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
  12517. * layout.h (class Layout): Update declarations. Remove options_
  12518. field. Add number_of_input_files_ and resized_signatures_
  12519. fields. Move sections_are_attached_ field.
  12520. * main.cc (main): Pass number of input files to Layout
  12521. constructor. Don't pass options.
  12522. 2009-03-30 Ian Lance Taylor <iant@google.com>
  12523. * ffsll.c (ffsll): Correct implementation.
  12524. 2009-03-27 Ian Lance Taylor <iant@google.com>
  12525. * ffsll.c: New file.
  12526. * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
  12527. * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
  12528. * ftruncate.c (ftruncate): Declare before definition.
  12529. * mremap.c (mremap): Likewise.
  12530. * pread.c (pread): Likewise.
  12531. * configure, Makefile.in, config.in: Rebuild.
  12532. * mremap.c: New file.
  12533. * configure.ac: Call AC_REPLACE_FUNCS on mremap.
  12534. * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
  12535. (mremap): Declare if HAVE_MREMAP is not defined.
  12536. * configure, Makefile.in, config.in: Rebuild.
  12537. 2009-03-27 Cary Coutant <ccoutant@google.com>
  12538. * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
  12539. position independent.
  12540. * sparc.cc (Target_sparc::check_non_pic): Likewise.
  12541. * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
  12542. 2009-03-24 Cary Coutant <ccoutant@google.com>
  12543. * symtab.h (needs_plt_entry): Check for unsatisfied reference from
  12544. an executable.
  12545. (needs_dynamic_reloc): Likewise.
  12546. 2009-03-24 Ian Lance Taylor <iant@google.com>
  12547. * yyscript.y (file_cmd): Recognize EXTERN.
  12548. (extern_name_list, extern_name_list_body): New nonterminals.
  12549. * script.cc (script_add_extern): Define.
  12550. * script-c.h (script_add_extern): Declare.
  12551. 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
  12552. * object.cc (is_elf_object): Define.
  12553. * object.h (is_elf_object): Declare.
  12554. * archive.cc (Archive::get_elf_object_for_member): Call
  12555. is_elf_object.
  12556. * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
  12557. 2009-03-24 Elliott Hughes <enh@google.com>
  12558. * output.cc (Output_file::map_anonymous): Define.
  12559. (Output_file::map): Use map_anonymous. If the regular mmap fails,
  12560. try an anonymous one. Report the size if the mmap fails.
  12561. * output.h (class Output_file): Declare map_anonymous.
  12562. 2009-03-24 Ian Lance Taylor <iant@google.com>
  12563. * target-select.cc (instantiate_target): Don't acquire the lock if
  12564. the instantiated_target_ field has already been set.
  12565. 2009-03-23 Ian Lance Taylor <iant@google.com>
  12566. * gold-threads.h (class Initialize_lock): Define.
  12567. * gold-threads.cc (class Initialize_lock_once): Define.
  12568. (initialize_lock_control): New static variable.
  12569. (initialize_lock_pointer): New static variable.
  12570. (initialize_lock_once): New static function.
  12571. (Initialize_lock::Initialize_lock): Define.
  12572. (Initialize_lock::initialize): Define.
  12573. * target-select.h: Include "gold-threads.h".
  12574. (class Target_selector): Add lock_ and initialize_lock_ fields.
  12575. Don't define instantiate_target, just declare it.
  12576. * target-select.cc (Target_selector::Target_selector): Initialize
  12577. new fields.
  12578. (Target_selector::instantiate_target): Define.
  12579. * descriptors.h: Include "gold-threads.h".
  12580. (class Descriptors): Add initialize_lock_ field.
  12581. * descriptors.cc (Descriptors::Descriptors): Initialize new
  12582. field.
  12583. (Descriptors::open): Use initialize_lock_ field
  12584. * errors.h (class Errors): Add initialize_lock_ field.
  12585. * errors.cc (Errors::Errors): Initialize new field.
  12586. (Errors::initialize_lock): Use initialize_lock_ field.
  12587. * powerpc.cc (class Target_selector_powerpc): Remove
  12588. instantiated_target_ field. In do_recognize call
  12589. instantiate_target rather than do_instantiate_target. In
  12590. do_instantiate_target just allocate a new target.
  12591. * sparc.cc (class Target_selector_sparc): Likewise.
  12592. * freebsd.h: New file.
  12593. * i386.cc: Include "freebsd.h".
  12594. (Target_i386): Derive from Target_freebsd rather than
  12595. Sized_target.
  12596. (Target_selector_i386): Derive from Target_selector_freebsd rather
  12597. than Target_selector.
  12598. * x86_64.cc: Include "freebsd.h".
  12599. (Target_x86_64): Derive from Target_freebsd rather than
  12600. Sized_target.
  12601. (Target_selector_x86_64): Derive from Target_selector_freebsd
  12602. rather than Target_selector.
  12603. * target.h (class Target): Add adjust_elf_header and
  12604. do_adjust_elf_header.
  12605. * output.cc (Output_file_header:: do_sized_write): Call target
  12606. adjust_elf_header routine.
  12607. * configure.tgt: Set targ_osabi.
  12608. * configure.ac: Define GOLD_DEFAULT_OSABI.
  12609. * parameters.cc (Parameters::default_target): Pass
  12610. GOLD_DEFAULT_OSABI to select_target.
  12611. * target-select.h (class Target_selector): Make instantiate_target
  12612. protected rather than private.
  12613. * Makefile.am (HFILES): Add freebsd.h.
  12614. * configure, Makefile.in, config.in: Rebuild.
  12615. * merge.cc (do_add_input_section): Correct pend value. Change
  12616. message about last entry not being null terminated from error to
  12617. warning.
  12618. 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
  12619. * incremental.cc: New file.
  12620. * Makefile.am (CCFILES): Add incremental.cc.
  12621. * Makefile.in: Rebuild.
  12622. 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
  12623. * layout.cc (Layout::output_section_name): Preserve names
  12624. of '.note.' sections.
  12625. 2009-03-19 Ian Lance Taylor <iant@google.com>
  12626. * descriptors.cc (Descriptors::open): Check that the options are
  12627. valid before using them.
  12628. 2009-03-18 Ian Lance Taylor <iant@google.com>
  12629. * script-sections.h: Include <list>.
  12630. (class Script_sections): Change Sections_elements from std::vector
  12631. to std::list. Typedef public Elements_iterator. Add
  12632. orphan_section_placement_, data_segment_align_start_, and
  12633. saw_data_segment_align_ fields. Remove data_segment_align_index_
  12634. field.
  12635. * script-sections.cc (class Orphan_section_placement): New class.
  12636. (class Sections_element): Add virtual functions is_relro and
  12637. orphan_section_init. Remove virtual function place_orphan_here.
  12638. (class Output_section_definition): Add is_relro and
  12639. orphan_section_init. Remove place_orphan_here.
  12640. (class Orphan_output_section): Likewise.
  12641. (Script_sections::Script_sections): Update for field changes.
  12642. (Script_sections::data_segment_align): Set saw_data_segment_align_
  12643. and data_segment_align_start_, not data_segment_align_index.
  12644. (Script_sections::data_segment_relro_end): Check
  12645. saw_data_segment_align_. Use data_segment_align_start_ rather
  12646. than data_segment_align_index_.
  12647. (Script_sections::place_orphan): Rewrite to use
  12648. Orphan_section_placement.
  12649. 2009-03-17 Ian Lance Taylor <iant@google.com>
  12650. * archive.cc (Archive::add_symbols): Check for a version attached
  12651. to the symbol name in the archive map.
  12652. * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
  12653. (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
  12654. (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
  12655. (ver_test_11.a): New target.
  12656. * testsuite/Makefile.in: Rebuild.
  12657. * configure.ac: Check for chsize and posix_fallocate. Replace
  12658. ftruncate.
  12659. * ftruncate.c: New file, from gnulib.
  12660. * output.cc (posix_fallocate): Define dummy version if not
  12661. HAVE_POSIX_FALLOCATE.
  12662. (Output_file::map): Call posix_fallocate rather than lseek and
  12663. write.
  12664. * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
  12665. * configure, Makefile.in, config.in: Rebuild.
  12666. 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
  12667. * layout.h (Layout::create_note): Add section_name parameter.
  12668. * layout.cc (Layout::create_note): Likewise.
  12669. (Layout::create_build_id, Layout::create_gold_note): Fix callers.
  12670. 2009-03-17 Ian Lance Taylor <iant@google.com>
  12671. * descriptors.cc: Include "options.h".
  12672. (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
  12673. (Descriptors::open): Always use O_CLOEXEC when opening a new
  12674. descriptor. If we have a plugin, and O_CLOEXEC was not defined,
  12675. then set FD_CLOEXEC.
  12676. * sparc.cc (class Target_sparc): Add has_got_section.
  12677. (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
  12678. make sure we have a GOT section.
  12679. * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
  12680. (Target_sparc::Scan::local): Likewise.
  12681. (Target_sparc::Scan::global): Likewise.
  12682. (Target_sparc::Relocate::relocate): Likewise.
  12683. (Target_sparc::Relocate::relocate_tls): Likewise.
  12684. * symtab.cc (Symbol_table::define_default_version): New function,
  12685. broken out of add_from_object.
  12686. (Symbol_table::add_from_object): Call define_default_version.
  12687. (Symbol_table::define_special_symbol): Add resolve_oldsym
  12688. parameter. Change all callers. If the version for a symbol comes
  12689. from a version script, resolve it with the symbol with the same
  12690. name with no version. Also add the symbol without a version if
  12691. appropriate.
  12692. (do_define_in_output_data): If resolving with oldsym, don't delete
  12693. sym.
  12694. (do_define_in_output_segment): Likewise.
  12695. (do_define_as_constant): Likewise.
  12696. * symtab.h (class Symbol_table): Update declarations.
  12697. 2009-03-13 Ian Lance Taylor <iant@google.com>
  12698. * readsyms.cc (Read_symbols::incompatible_warning): New function.
  12699. (Read_symbols::requeue): New function.
  12700. (Read_symbols::do_read_symbols): If make_elf_object fails because
  12701. the target type is not configured, and the file was searched for,
  12702. issue a warning and retry with the next directory.
  12703. (Add_symbols::run): If the file has an incompatible format, and
  12704. it was searched for, requeue the Read_symbols task. On error,
  12705. release the object.
  12706. * readsyms.h (class Read_symbols): Add dirindex_ field. Add
  12707. dirindex parameter to constructor. Change all callers. Declare
  12708. incompatible_warning and requeue.
  12709. (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
  12710. input_argument_ and input_group_ fields. Add them to
  12711. constructor. Change all callers.
  12712. (class Read_script): Add dirindex_ field. Add it to constructor.
  12713. Change all callers.
  12714. * archive.cc (Archive::setup): Remove input_objects parameter.
  12715. Change all callers.
  12716. (Archive::get_file_and_offset): Likewise.
  12717. (Archive::read_all_symbols): Likewise.
  12718. (Archive::read_symbols): Likewise.
  12719. (Archive::get_elf_object_for_member): Remove input_objects
  12720. parameter. Add punconfigured parameter. Change all callers.
  12721. (Archive::add_symbols): Change return type to bool. Check return
  12722. value of include_member.
  12723. (Archive::include_all_members): Likewise.
  12724. (Archive::include_member): Change return type to bool. Return
  12725. false if first included object has incompatible target. Set
  12726. included_member_ field.
  12727. (Add_archive_symbols::run): If add_symbols returns false, requeue
  12728. Read_symbols task.
  12729. * archive.h (class Archive): Add included_member_ field.
  12730. Initialize it in constructor. Add input_file and searched_for
  12731. methods. Update declarations.
  12732. (class Add_archive_symbols): Add dirpath_, dirindex_, and
  12733. input_argument_ fields. Add them to constructor. Change all
  12734. callers.
  12735. * script.cc: Include "target-select.h".
  12736. (class Parser_closure): Add skip_on_incompatible_target_ and
  12737. found_incompatible_target_ fields. Add
  12738. skip_on_incompatible_target parameter to constructor. Change all
  12739. callers. Add methods skip_on_incompatible_target,
  12740. clear_skip_on_incompatible_target, found_incompatible_target, and
  12741. set_found_incompatible_target.
  12742. (read_input_script): Add dirindex parameter. Change all callers.
  12743. If parser finds an incompatible target, requeue Read_symbols
  12744. task.
  12745. (script_set_symbol): Clear skip_on_incompatible_target in
  12746. closure.
  12747. (script_add_assertion, script_parse_option): Likewise.
  12748. (script_start_sections, script_add_phdr): Likewise.
  12749. (script_check_output_format): New function.
  12750. * script.h (read_input_script): Update declaration.
  12751. * script-c.h (script_check_output_format): Declare.
  12752. * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
  12753. (ignore_cmd): Remove OUTPUT_FORMAT.
  12754. * fileread.cc (Input_file::Input_file): Add explicit this.
  12755. (Input_file::will_search_for): New function.
  12756. (Input_file::open): Add pindex parameter. Change all callers.
  12757. * fileread.h (class Input_file): Add input_file_argument method.
  12758. Declare will_search_for. Update declarations.
  12759. * object.cc (make_elf_object): Add punconfigured parameter.
  12760. Change all callers.
  12761. * object.h (class Object): Make input_file public. Add
  12762. searched_for method.
  12763. (make_elf_object): Update declaration.
  12764. * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
  12765. restart search.
  12766. * dirsearch.h (class Dirsearch): Update declaration.
  12767. * options.h (class General_options): Add --warn-search-mismatch.
  12768. * parameters.cc (Parameters::is_compatible_target): New function.
  12769. * parameters.h (class Parameters): Declare is_compatible_target.
  12770. * workqueue.cc (Workqueue::add_blocker): New function.
  12771. * workqueue.h (class Workqueue): Declare add_blocker.
  12772. * fileread.cc (Input_file::open): Remove options parameter.
  12773. Change all callers.
  12774. (Input_file::open_binary): Likewise.
  12775. * script.cc (read_input_script): Likewise.
  12776. * readsyms.h (class Read_symbols): Remove options_ field. Remove
  12777. options parameter from constructor. Change all callers.
  12778. (class Read_script): Likewise.
  12779. * fileread.h (class Input_file): Update declarations.
  12780. * script.h (read_input_script): Update declaration.
  12781. 2009-03-10 Nick Clifton <nickc@redhat.com>
  12782. * po/es.po: New Spanish translation.
  12783. 2009-03-06 Cary Coutant <ccoutant@google.com>
  12784. * options.cc (parse_short_option): Keep dash_z from registering itself.
  12785. 2009-03-03 Ian Lance Taylor <iant@google.com>
  12786. PR 9918
  12787. * target-reloc.h (relocate_section): Pass output_section to
  12788. relocate.
  12789. * i386.cc (Target_i386::should_apply_static_reloc): Add
  12790. output_section parameter. Change all callers.
  12791. (Target_i386::Relocate::relocate): Add output_section parameter.
  12792. * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
  12793. * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
  12794. * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
  12795. * testsuite/two_file_shared.sh: New script.
  12796. * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
  12797. (check_DATA): Add two_file_shared.dbg.
  12798. (two_file_shared.dbg): New target.
  12799. * testsuite/Makefile.in: Rebuild.
  12800. 2009-03-01 Ian Lance Taylor <iant@google.com>
  12801. * configure.ac: Check for byteswap.h.
  12802. * configure: Rebuild.
  12803. * config.in: Rebuild.
  12804. 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
  12805. * layout.cc (Layout::find_or_add_kept_section): New function.
  12806. (Layout::add_comdat): Removed.
  12807. * layout.h (struct Kept_section): Move out of class Layout.
  12808. Remove trailing underscores from field names. Add group_sections
  12809. field. Rename group_ field to is_group. Change all uses.
  12810. (class Layout): Declare find_or_add_kept_section, not add_comdat.
  12811. * object.cc (Sized_relobj::Sized_relobj): Don't initialize
  12812. comdat_groups_ field.
  12813. (Sized_relobj::include_section_group): Use
  12814. find_or_add_kept_section and Kept_section::group_sections.
  12815. (Sized_relobj::include_linkonce_section): Likewise.
  12816. * object.cc (class Sized_relobj): Don't define Comdat_group or
  12817. Comdat_group_table. Remove find_comdat_group and
  12818. add_comdat_group. Remove comdat_groups_ field.
  12819. * plugin.cc (include_comdat_group): Use
  12820. Layout::find_or_add_kept_section.
  12821. 2009-02-28 Ian Lance Taylor <iant@google.com>
  12822. * README: --gc-sections and map files are now supported. Document
  12823. some build requirements.
  12824. PR 6992
  12825. * symtab.cc (Symbol_table::sized_write_section_symbol): In a
  12826. relocatable link set the value of the section symbol to zero.
  12827. * object.cc (Sized_relobj::do_finalize_local_symbols): In a
  12828. relocatable link don't include the section address in the local
  12829. symbol value.
  12830. 2009-02-27 Ian Lance Taylor <iant@google.com>
  12831. PR 6811
  12832. * options.h (class Search_directory): Add is_system_directory.
  12833. (class General_options): Declare is_in_system_directory.
  12834. * options.cc (get_relative_sysroot): Make static.
  12835. (get_default_sysroot): Make static.
  12836. (General_optoins::is_in_system_directory): New function.
  12837. * fileread.cc (Input_file::is_in_system_directory): New function.
  12838. * fileread.h (class Input_file): Declare is_in_system_directory.
  12839. * object.h (class Object): Add is_in_system_directory.
  12840. (class Input_objects): Remove system_library_directory_ field.
  12841. * object.cc (Input_objects::add_object): Don't set
  12842. system_library_directory_.
  12843. (input_objects::found_in_system_library_directory): Remove.
  12844. * symtab.cc (Symbol_table::write_globals): Remove input_objects
  12845. parameter. Change all callers.
  12846. (Symbol_table::sized_write_globals): Likewise.
  12847. (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
  12848. Call Object::is_in_system_directory.
  12849. * symtab.h (class Symbol_table): Update declarations.
  12850. PR 5990
  12851. * descriptors.h (Open_descriptor): Add is_on_stack field.
  12852. * descriptors.cc (Descriptors::open): If the descriptor is on the
  12853. top of the stack, remove it. Initialize is_on_stack field.
  12854. (Descriptors::release): Only add pod to stack if it is not on the
  12855. stack already.
  12856. (Descriptors::close_some_descriptor): Clear stack_next and
  12857. is_on_stack fields.
  12858. PR 7091
  12859. * output.cc (Output_section::find_starting_output_address): Rename
  12860. from starting_output_address; add PADDR parameter; change return
  12861. type.
  12862. * output.h (class Output_section): Declare
  12863. find_starting_output_address instead of starting_output_address.
  12864. * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
  12865. section symbol for which we can't find a merge section.
  12866. PR 9836
  12867. * symtab.cc (Symbol_table::add_from_object): If the visibility is
  12868. hidden or internal, force the symbol to be local.
  12869. * resolve.cc (Symbol::override_visibility): Define.
  12870. (Symbol::override_base): Use override_visibility.
  12871. (Symbol_table::resolve): Likewise.
  12872. (Symbol::override_base_with_special): Likewise.
  12873. (Symbol_table::override_with_special): If the visibility is hidden
  12874. or internal, force the symbol to be local.
  12875. * symtab.h (class Symbol): Add set_visibility and
  12876. override_visibility.
  12877. * testsuite/ver_test_1.sh: New file.
  12878. * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
  12879. (check_DATA): Add ver_test_1.syms.
  12880. (ver_test_1.syms): New target.
  12881. * testsuite/Makefile.in: Rebuild.
  12882. 2009-02-25 Cary Coutant <ccoutant@google.com>
  12883. * layout.cc (Layout::choose_output_section): Don't rename sections
  12884. when using a linker script that has a SECTIONS clause.
  12885. * Makefile.in: Regenerate.
  12886. * testsuite/Makefile.am (script_test_5.sh): New test case.
  12887. * testsuite/Makefile.in: Regenerate.
  12888. * testsuite/script_test_5.cc: New file.
  12889. * testsuite/script_test_5.sh: New file.
  12890. * testsuite/script_test_5.t: New file.
  12891. 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
  12892. * archive.cc (Archive::include_member): Update calls to add_symbols.
  12893. * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
  12894. the Layout argument.
  12895. * dynobj.h (do_add_symbols): Add the Layout argument.
  12896. * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
  12897. Layout argument.
  12898. * object.h (Object::add_symbols): Add the Layout argument.
  12899. (Object::do_add_symbols): Add the Layout argument.
  12900. (Sized_relobj::do_add_symbols): Add the Layout argument.
  12901. * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
  12902. Unify the two versions.
  12903. (Add_plugin_symbols): Remove.
  12904. * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
  12905. (Sized_pluginobj::do_add_symbols): Unify the two versions.
  12906. (Add_plugin_symbols): Remove.
  12907. * readsyms.cc (Read_symbols::do_read_symbols): Update call to
  12908. Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
  12909. (Add_symbols::run): Make it work with Pulginobj.
  12910. 2009-02-06 Ian Lance Taylor <iant@google.com>
  12911. * object.cc (Sized_relobj::do_layout): Make info message start
  12912. with lower case letter.
  12913. 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
  12914. * binary.cc: Fix file comment.
  12915. * options.h (enum Incremental_disposition): Define.
  12916. (class General_options): Add new options: --incremental,
  12917. --incremental_changed, --incremental_unchanged,
  12918. --incremental_unknown. Add incremental_disposition_ and
  12919. implicit_incremental_ fields.
  12920. (General_options::incremental_disposition): New function.
  12921. (class Position_dependent_options): Add incremental_disposition
  12922. option.
  12923. (Position_dependent_options::copy_from_options): Set incremental
  12924. dispositions.
  12925. * options.cc (General_options::parse_incremental_changed): New
  12926. function.
  12927. (General_options::parse_incremental_unchanged): New function.
  12928. (General_options::parse_incremental_unknown): New function.
  12929. (General_options::General_options): Initialize new fields
  12930. incremental_disposition_ and implicit_incremental_.
  12931. (General_options::finalize): Check for uasge of --incremental-*
  12932. without --incremental.
  12933. 2009-02-06 Chris Demetriou <cgd@google.com>
  12934. * gold.h (gold_undefined_symbol): Change to take only a Symbol
  12935. pointer and to report location as the file name associated with
  12936. the symbol.
  12937. (gold_undefined_symbol_at_location): New function to replace the
  12938. old gold_undefined_symbol functionality.
  12939. * target-reloc.h (relocate_section): Update to use
  12940. gold_undefined_symbol_at_location.
  12941. * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
  12942. Call gold_undefined_symbol function rather than gold_error.
  12943. * errors.h (Errors::undefined_symbol): Take location as a
  12944. string, rather than calculating it from a relocation.
  12945. * errors.cc (Errors::fatal): Print "fatal error:" before the
  12946. formatted message.
  12947. (Errors::error, Errors::error_at_location): Print "error: "
  12948. before the formatted message.
  12949. (Errors::undefined_symbol): Take location as a string, rather
  12950. than calculating it from a relocation.
  12951. (gold_undefined_symbol_at_location): New function akin to
  12952. old gold_undefined_symbol, calculates location from relocation.
  12953. (gold_undefined_symbol): Change to take only a Symbol pointer
  12954. and to report location as the file name associated with the symbol.
  12955. * testsuite/debug_msg.sh: Update for changed error messages.
  12956. * testsuite/undef_symbol.sh: Likewise.
  12957. 2009-02-04 Duncan Sands <baldrick@free.fr>
  12958. PR 9812
  12959. * reduced_debug_output.h
  12960. (Output_reduced_debug_abbrev_section::failed): Use format for
  12961. gold_warning.
  12962. (Output_reduced_debug_info_section::faild): Likewise.
  12963. 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
  12964. * script.cc (Lazy_demangler): New class.
  12965. (Version_script_info::get_symbol_version_helper): Demangle a
  12966. symbol only once.
  12967. 2009-01-29 Cary Coutant <ccoutant@google.com>
  12968. * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
  12969. to __tls_get_addr.
  12970. * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
  12971. 2009-01-28 Ian Lance Taylor <iant@google.com>
  12972. * version.cc (version_string): Bump to 1.9.
  12973. * gold.h: Include <cstring> and <stdint.h>.
  12974. * version.cc: Include <cstdio>.
  12975. * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
  12976. warning.
  12977. * reduced_debug_output.cc (insert_into_vector): Rename from
  12978. Insert_into_vector; change all callers. Use Swap_unaligned to
  12979. avoid aliasing issue; remove union since it is unnecessary.
  12980. 2009-01-27 Sriraman Tallam <tmsriram@google.com>
  12981. * Makefile.am (CCFILES): Add gc.cc.
  12982. (HFILES): Add gc.h.
  12983. * Makefile.in: Regenerate.
  12984. * gold.cc (Gc_runner): New class.
  12985. (queue_initial_tasks): Call garbage collection related tasks
  12986. when corresponding options are invoked.
  12987. (queue_middle_gc_tasks): New function.
  12988. (queue_middle_tasks): Reorder tasks to allow relocs to be read and
  12989. processed early before laying out sections during garbage collection.
  12990. * gold.h (queue_middle_gc_tasks): New function.
  12991. (is_prefix_of): Move from "layout.cc".
  12992. * i386.cc (Target_i386::gc_process_relocs): New function.
  12993. * layout.cc (is_prefix_of): Remove. Move to "gold.h"
  12994. * main.cc (main): Create object of class "Garbage_collection".
  12995. * object.cc (Relobj::copy_symbols_data): New function.
  12996. (Relobj::is_section_name_included): New function.
  12997. (Sized_relobj::do_layout): Allow this function to be called twice
  12998. during garbage collection and defer layout of section during the
  12999. first call.
  13000. * object.h (Relobj::get_symbols_data): New function.
  13001. (Relobj::is_section_name_included): New function.
  13002. (Relobj::copy_symbols_data): New function.
  13003. (Relobj::set_symbols_data): New function.
  13004. (Relobj::get_relocs_data): New function.
  13005. (Relobj::set_relocs_data): New function.
  13006. (Relobj::is_output_section_offset_invalid): New pure virtual function.
  13007. (Relobj::gc_process_relocs): New function.
  13008. (Relobj::do_gc_process_relocs): New pure virtual function.
  13009. (Relobj::sd_): New data member.
  13010. (Sized_relobj::is_output_section_offset_invalid): New function.
  13011. (Sized_relobj::do_gc_process_relocs): New function.
  13012. * options.h (General_options::gc_sections): Modify to not be a no-op.
  13013. (General_options::print_gc_sections): New option.
  13014. * plugin.cc (Plugin_finish::run): Remove function call to
  13015. Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
  13016. * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
  13017. * reloc.cc (Read_relocs::run): Add task to process relocs and
  13018. determine unreferenced sections when doing garbage collection.
  13019. (Gc_process_relocs): New class.
  13020. (Sized_relobj::do_gc_process_relocs): New function.
  13021. (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
  13022. sections that are garbage collected.
  13023. * reloc.h (Gc_process_relocs): New class.
  13024. * sparc.cc (Target_sparc::gc_process_relocs): New function.
  13025. * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
  13026. symbols whose corresponding sections are garbage collected.
  13027. (Symbol_table::Symbol_table): Add new parameter for the garbage
  13028. collection object.
  13029. (Symbol_table::gc_mark_undef_symbols): New function.
  13030. (Symbol_table::gc_mark_symbol_for_shlib): New function.
  13031. (Symbol_table::gc_mark_dyn_syms): New function.
  13032. (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
  13033. as garbage.
  13034. (Symbol_table::add_from_object): Likewise.
  13035. (Symbol_table::add_from_relobj): When building shared objects, do not
  13036. treat externally visible symbols as garbage.
  13037. (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
  13038. table information for static and relocatable links.
  13039. * symtab.h (Symbol_table::set_gc): New function.
  13040. (Symbol_table::gc): New function.
  13041. (Symbol_table::gc_mark_undef_symbols): New function.
  13042. (Symbol_table::gc_mark_symbol_for_shlib): New function.
  13043. (Symbol_table::gc_mark_dyn_syms): New function.
  13044. (Symbol_table::gc_): New data member.
  13045. * target.h (Sized_target::gc_process_relocs): New pure virtual
  13046. function.
  13047. * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
  13048. * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
  13049. 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
  13050. * options.h (General_options::gc_sections): Define as a no-op for now.
  13051. (General_options::no_keep_memory): Ditto.
  13052. (General_options::Bshareable): Define.
  13053. * options.cc (General_options::finalize): Honor -Bshareable.
  13054. 2009-01-20 Andreas Schwab <schwab@suse.de>
  13055. * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
  13056. read the value in the contents, since we don't use it. Use the
  13057. template endianness when writing.
  13058. (Relocate::relocate): Use it for R_PPC_REL16_HA.
  13059. 2009-01-19 Andreas Schwab <schwab@suse.de>
  13060. * configure.tgt (powerpc64-*): Fix targ_obj.
  13061. 2009-01-15 Ian Lance Taylor <iant@google.com>
  13062. * object.cc (Sized_relobj::write_local_symbols): Don't write out
  13063. local symbols when stripping all symbols.
  13064. 2009-01-14 Cary Coutant <ccoutant@google.com>
  13065. * output.cc (Output_reloc): Add explicit instantiations.
  13066. 2009-01-14 Cary Coutant <ccoutant@google.com>
  13067. * archive.cc (Archive::get_elf_object_for_member): Remove call
  13068. to File_read::claim_for_plugin.
  13069. * descriptors.cc (Descriptors::open): Remove reference to
  13070. is_claimed.
  13071. (Descriptors::claim_for_plugin): Remove.
  13072. * descriptors.h (Descriptors::claim_for_plugin): Remove.
  13073. (Descriptors::is_claimed): Remove.
  13074. (claim_descriptor_for_plugin): Remove.
  13075. * fileread.cc (File_read::claim_for_plugin): Remove.
  13076. * fileread.h (File_read::claim_for_plugin): Remove.
  13077. (File_read::descriptor): Reopen descriptor if necessary.
  13078. * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
  13079. (Plugin_manager::all_symbols_read): Add task parameter. Change
  13080. all callers.
  13081. (Plugin_manager::get_input_file): New function.
  13082. (Plugin_manager::release_input_file): New function.
  13083. (Pluginobj::Pluginobj): Add filesize parameter and initialize
  13084. corresponding data member.
  13085. (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
  13086. and pass to base constructor. Change all callers.
  13087. (get_input_file, release_input_file): New functions.
  13088. (make_sized_plugin_object): Add filesize parameter. Change all callers.
  13089. * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
  13090. (Plugin_manager::all_symbols_read): Add task parameter.
  13091. (Plugin_manager::get_input_file): New function.
  13092. (Plugin_manager::release_input_file): New function.
  13093. (Plugin_manager::task_): New data member.
  13094. (Pluginobj::Pluginobj): Add filesize parameter.
  13095. (Pluginobj::filename): New function.
  13096. (Pluginobj::descriptor): New function.
  13097. (Pluginobj::filesize): New function.
  13098. (Pluginobj::filesize_): New data member.
  13099. (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
  13100. * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
  13101. File_read::claim_for_plugin; use Object::unlock to unlock the file.
  13102. * testsuite/Makefile.am (plugin_test_4): New test case for plugins
  13103. with archive libraries.
  13104. * testsuite/Makefile.in: Regenerate.
  13105. * testsuite/plugin_test.c (struct sym_info): New type.
  13106. (get_input_file, release_input_file): New static variables.
  13107. (onload): Capture new transfer vector entries.
  13108. (claim_file_hook): Stop reading at end of file according to filesize.
  13109. Factor out parsing of readelf output into separate function.
  13110. (all_symbols_read_hook): Exercise get_input_file and release_input_file
  13111. APIs and get the source file name from the symbol table. Convert
  13112. source file name to corresponding object file name. Print info
  13113. message when adding new input files.
  13114. (parse_readelf_line): New function.
  13115. * testsuite/plugin_test_1.sh: Add checks for new info messages.
  13116. * testsuite/plugin_test_2.sh: Likewise.
  13117. * testsuite/plugin_test_3.sh: Likewise.
  13118. * testsuite/plugin_test_4.sh: New test case.
  13119. 2009-01-07 Ian Lance Taylor <iant@google.com>
  13120. * version.cc (version_string): Bump to 1.8.
  13121. 2008-12-23 Cary Coutant <ccoutant@google.com>
  13122. * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
  13123. * plugin.cc (Plugin_manager::finish): Rename as
  13124. layout_deferred_objects. Move cleanup to separate function.
  13125. (Plugin_manager::cleanup): New function.
  13126. (Plugin_finish::run): Call layout_deferred_objects and cleanup
  13127. separately.
  13128. * plugin.h (Plugin_manager::finish): Rename as
  13129. layout_deferred_objects.
  13130. (Plugin_manager::cleanup): New function.
  13131. (Plugin_manager::cleanup_done): New field.
  13132. 2008-12-23 Cary Coutant <ccoutant@google.com>
  13133. * plugin.cc (is_visible_from_outside): New function.
  13134. (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
  13135. so we don't return "IR only" status for exported symbols or -r links.
  13136. * testsuite/Makefile.am (plugin_test_3): New test case.
  13137. * testsuite/Makefile.in: Regenerate.
  13138. * testsuite/plugin_test_3.sh: New file.
  13139. 2008-12-22 Cary Coutant <ccoutant@google.com>
  13140. * object.cc (Sized_relobj::layout_section): New function.
  13141. (Sized_relobj::do_layout): Defer layout of input sections until after
  13142. plugin has provided replacement files.
  13143. (Sized_relobj::do_layout_deferred_sections): New function.
  13144. * object.h (Relobj::set_section_offset): Remove virtual keyword.
  13145. (Relobj::layout_deferred_sections): New function.
  13146. (Relobj::do_layout_deferred_sections): New function.
  13147. (Sized_relobj::do_layout_deferred_sections): New function.
  13148. (Sized_relobj::layout_section): New function.
  13149. (Sized_relobj::Deferred_layout): New structure.
  13150. (Sized_relobj::deferred_layout_): New field.
  13151. * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
  13152. Change all callers. Layout deferred sections.
  13153. (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
  13154. references.
  13155. (Plugin_hook::run): Move code from do_plugin_hook inline.
  13156. (Plugin_hook::do_plugin_hook): Remove.
  13157. * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
  13158. (Plugin_manager::finish): Renamed, was cleanup.
  13159. (Plugin_manager::should_defer_layout): New function.
  13160. (Plugin_manager::add_deferred_layout_object): New function.
  13161. (Plugin_manager::Deferred_layout_list): New type.
  13162. (Plugin_manager::deferred_layout_objects_): New field.
  13163. (Plugin_hook::do_plugin_hook): Remove.
  13164. 2008-12-17 Ian Lance Taylor <iant@google.com>
  13165. * options.h (class General_options): Add --no case for
  13166. --export-dynamic.
  13167. 2008-12-16 Cary Coutant <ccoutant@google.com>
  13168. * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
  13169. vector.
  13170. (Plugin_manager::claim_file): Create plugin object even if
  13171. plugin did not call the add_symbols callback.
  13172. (Plugin_obj::get_symbol_resolution_info): Guard against plugin
  13173. asking for more symbols than were added.
  13174. * testsuite/Makefile.am (plugin_test_1): Add test case with
  13175. no global symbols.
  13176. (empty.syms): New target.
  13177. * testsuite/Makefile.in: Regenerate.
  13178. * testsuite/plugin_test.c (claim_file_hook): Add new debug
  13179. message. Don't call add_symbols if no globals.
  13180. (all_symbols_read_hook): Don't provide replacement for empty
  13181. claimed file.
  13182. 2008-12-12 Ian Lance Taylor <iant@google.com>
  13183. * target-reloc.h (Default_scan_relocatable_relocs): Only discard
  13184. r_type == 0 for a local symbol with r_sym == 0.
  13185. (scan_relocatable_relocs): Pass r_sym to
  13186. local_non_section_strategy.
  13187. * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
  13188. r_sym parameter.
  13189. * configure.ac: Update test for TLS descriptors: they are
  13190. supported as of glibc 2.9.
  13191. * configure: Rebuild.
  13192. 2008-12-11 Ian Lance Taylor <iant@google.com>
  13193. PR 7091
  13194. * target-reloc.h (Default_scan_relocatable_relocs): For each
  13195. function, map r_type == 0 to RELOC_DISCARD.
  13196. 2008-12-10 Cary Coutant <ccoutant@google.com>
  13197. * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
  13198. object to override a kept COMDAT group from a plugin object.
  13199. 2008-12-09 Ian Lance Taylor <iant@google.com>
  13200. PR 7088
  13201. * yyscript.y (file_cmd): Handle INPUT.
  13202. * testsuite/initpri1.c: Change all declarations to be full
  13203. prototypes by adding void, to avoid compiler warnings.
  13204. 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
  13205. * options.cc (General_options::parse_plugin_opt): New.
  13206. (General_options::add_plugin): The argument now is just the filename.
  13207. (General_options::add_plugin_option): New.
  13208. * options.h (plugin_opt): New.
  13209. (add_plugin): Change argument name.
  13210. (add_plugin_option): New.
  13211. * plugin.cc (Plugin::load): Don't parse the plugin option.
  13212. * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
  13213. (Plugin::add_option): New.
  13214. (Plugin::args_): Change type.
  13215. (Plugin::filename_): New.
  13216. (Plugin_manager::add_plugin_option): New.
  13217. * testsuite/Makefile.am (plugin_test_1): Use new syntax.
  13218. * testsuite/Makefile.in: Regenerate.
  13219. 2008-12-05 Cary Coutant <ccoutant@google.com>
  13220. * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
  13221. Handle --strip-lto-sections option.
  13222. * options.h (strip_lto_sections): New option.
  13223. 2008-12-01 Cary Coutant <ccoutant@google.com>
  13224. * plugin.cc (ld_plugin_message): Change format parameter to const.
  13225. Fix mismatch between new[] and delete.
  13226. 2008-11-14 Cary Coutant <ccoutant@google.com>
  13227. * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
  13228. instead of -1U.
  13229. 2008-11-05 Craig Silverstein <csilvers@google.com>
  13230. * options.cc (General_options::parse_dynamic_list): New function.
  13231. * options.h (General_options): New flags dynamic_list,
  13232. dynamic_list_data, dynamic_list_cpp_new, and
  13233. dynamic_list_cpp_typeinfo. New variable dynamic_list_.
  13234. (General_options::in_dynamic_list): New function.
  13235. * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
  13236. (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
  13237. (Lex::can_continue_name): Likewise.
  13238. (yylex): Likewise.
  13239. (read_script_file): New parameter script_options.
  13240. (read_dynamic_list): New function.
  13241. (Script_options::define_dynamic_list): New function.
  13242. (dynamic_list_keyword_parsecodes): New variable.
  13243. (dynamic_list_keywords): New variable.
  13244. * script.h (Script_options::define_dynamic_list): New function
  13245. prototype.
  13246. (read_dynamic_list): New function prototype.
  13247. * symtab.cc (strprefix): New macro.
  13248. (Symbol::should_add_dynsym_entry): Support dynamic_list,
  13249. dynamic_list_data, dynamic_list_cpp_new, and
  13250. dynamic_list_cpp_typeinfo.
  13251. * yyscript.y (PARSING_DYNAMIC_LIST): New token.
  13252. (dynamic_list_expr): New rule.
  13253. (dynamic_list_nodes): Likewise.
  13254. (dynamic_list_node): Likewise.
  13255. * testsuite/Makefile.am (dynamic_list): New test.
  13256. * testsuite/Makefile.in: Regenerated.
  13257. * testsuite/dynamic_list.t: New file.
  13258. * testsuite/dynamic_list.sh: New file.
  13259. 2008-11-05 Craig Silverstein <csilvers@google.com>
  13260. * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
  13261. * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
  13262. (t11_last): Likewise.
  13263. * testsuite/ver_test_6.c (main): Likewise.
  13264. 2008-10-07 Cary Coutant <ccoutant@google.com>
  13265. * options.c (General_options::finalize): Add check for -static and
  13266. -shared.
  13267. * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
  13268. is not empty.
  13269. 2008-10-02 Cary Coutant <ccoutant@google.com>
  13270. * plugin.cc (make_sized_plugin_object): Fix conditional
  13271. compilation to work when not all targets are enabled.
  13272. 2008-09-29 Cary Coutant <ccoutant@google.com>
  13273. * archive.cc (Archive::get_file_and_offset): Use filename instead
  13274. of name to get library path.
  13275. (Archive::include_member): Unlock external member of a thin archive.
  13276. * testsuite/Makefile.am (TEST_AR): New variable.
  13277. (thin_archive_test_1): New test.
  13278. (thin_archive_test_2): New test.
  13279. * testsuite/Makefile.in: Regenerate.
  13280. * testsuite/thin_archive_main.cc: New file.
  13281. * testsuite/thin_archive_test_1.cc: New file.
  13282. * testsuite/thin_archive_test_2.cc: New file.
  13283. * testsuite/thin_archive_test_3.cc: New file.
  13284. * testsuite/thin_archive_test_4.cc: New file.
  13285. 2008-09-29 Cary Coutant <ccoutant@google.com>
  13286. * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
  13287. * object.cc (Sized_relobj::do_layout): Use constant invalid_address
  13288. instead of -1U.
  13289. (Sized_relobj::do_finalize_local_symbols): Likewise.
  13290. (Sized_relobj::map_to_kept_section): Likewise.
  13291. * object.h (Sized_relobj::invalid_address): New constant.
  13292. (Sized_relobj::do_output_section_offset): Check for invalid_address
  13293. and return -1ULL.
  13294. * output.cc (Output_reloc::local_section_offset): Use constant
  13295. invalid_address instead of -1U.
  13296. (Output_reloc::get_address): Likewise.
  13297. (Output_section::output_address): Change -1U to -1ULL.
  13298. * output.h (Output_reloc::invalid_address): New constant.
  13299. * reloc.cc (Sized_relobj::write_sections): Use constant
  13300. invalid_address instead of -1U.
  13301. (Sized_relobj::relocate_sections): Likewise.
  13302. * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
  13303. values for merge sections.
  13304. * target-reloc.h (relocate_for_relocatable): Use constant
  13305. invalid_address instead of -1U.
  13306. 2008-09-19 Cary Coutant <ccoutant@google.com>
  13307. Add plugin functionality for link-time optimization (LTO).
  13308. * configure.ac (plugins): Add --enable-plugins option.
  13309. * configure: Regenerate.
  13310. * config.in: Regenerate.
  13311. * Makefile.am (LIBDL): New variable.
  13312. (CCFILES): Add plugin.cc.
  13313. (HFILES): Add plugin.h.
  13314. (ldadd_var): Add LIBDL.
  13315. * Makefile.in: Regenerate.
  13316. * archive.cc: Include "plugin.h".
  13317. (Archive::setup): Don't preread archive symbols when using a plugin.
  13318. (Archive::get_file_and_offset): Add memsize parameter. Change callers.
  13319. (Archive::get_elf_object_for_member): Call plugin hooks for claiming
  13320. files.
  13321. (Archive::include_member): Add symbols from plugin objects.
  13322. * archive.h (Archive::get_file_and_offset): Add memsize parameter.
  13323. * descriptors.cc (Descriptors::open): Check for file descriptors
  13324. abandoned by plugins.
  13325. (Descriptors::claim_for_plugin): New function.
  13326. * descriptors.h (Descriptors::claim_for_plugin): New function.
  13327. (Open_descriptor::is_claimed): New field.
  13328. (claim_descriptor_for_plugin): New function.
  13329. * fileread.cc (File_read::claim_for_plugin): New function.
  13330. * fileread.h (File_read::claim_for_plugin): New function.
  13331. (File_read::descriptor): New function.
  13332. * gold.cc: Include "plugin.h".
  13333. (queue_initial_tasks): Add task to call plugin hooks for generating
  13334. new object files.
  13335. * main.cc: Include "plugin.h".
  13336. (main): Load plugin libraries.
  13337. * object.h (Pluginobj): Declare.
  13338. (Object::pluginobj): New function.
  13339. (Object::do_pluginobj): New function.
  13340. (Object::set_target): New function.
  13341. * options.cc: Include "plugin.h".
  13342. (General_options::parse_plugin): New function.
  13343. (General_options::General_options): Initialize plugins_ field.
  13344. (General_options::add_plugin): New function.
  13345. * options.h (Plugin_manager): Declare.
  13346. (General_options): Add --plugin option.
  13347. (General_options::has_plugins): New function.
  13348. (General_options::plugins): New function.
  13349. (General_options::add_plugin): New function.
  13350. (General_options::plugins_): New field.
  13351. * plugin.cc: New file.
  13352. * plugin.h: New file.
  13353. * readsyms.cc: Include "plugin.h".
  13354. (Read_symbols::do_read_symbols): Check for archive before checking
  13355. for ELF file. Call plugin hooks to claim files.
  13356. * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
  13357. from a real object file; force override when processing replacement
  13358. files.
  13359. * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
  13360. (Symbol::init_base_object): Likewise.
  13361. (Symbol::init_base_output_data): Likewise.
  13362. (Symbol::init_base_output_segment): Likewise.
  13363. (Symbol::init_base_constant): Likewise.
  13364. (Symbol::init_base_undefined): Likewise.
  13365. (Symbol::output_section): Assert that object is not a plugin.
  13366. (Symbol_table::add_from_pluginobj): New function.
  13367. (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
  13368. undefined.
  13369. (Symbol_table::sized_write_globals): Likewise.
  13370. (Symbol_table::add_from_pluginobj): Instantiate template.
  13371. * symtab.h (Sized_pluginobj): Declare.
  13372. (Symbol::in_real_elf): New function.
  13373. (Symbol::set_in_real_elf): New function.
  13374. (Symbol::in_real_elf_): New field.
  13375. (Symbol_table::add_from_pluginobj): New function.
  13376. * testsuite/Makefile.am (AM_CFLAGS): New variable.
  13377. (LIBDL): New variable.
  13378. (LDADD): Add LIBDL.
  13379. (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
  13380. (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
  13381. (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
  13382. (MOSTLYCLEANFILES): Likewise.
  13383. * testsuite/Makefile.in: Regenerate.
  13384. * testsuite/plugin_test.c: New file.
  13385. * testsuite/plugin_test_1.sh: New file.
  13386. * testsuite/plugin_test_2.sh: New file.
  13387. 2008-09-16 Ian Lance Taylor <iant@google.com>
  13388. * target-reloc.h (relocate_section): Check whether a symbol is
  13389. defined by the ABI before reporting an undefined symbol error.
  13390. * target.h (Target::is_defined_by_abi): Make parameter const.
  13391. (Target::do_is_defined_by_abi): Likewise.
  13392. * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
  13393. * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
  13394. * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
  13395. * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
  13396. * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
  13397. * testsuite/Makefile.in: Rebuild.
  13398. * fileread.cc (make_view): Add casts to avoid warning.
  13399. 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
  13400. * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
  13401. * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
  13402. 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
  13403. * options.h (General_options::output_is_executable): New.
  13404. (General_options::output_is_pie): New.
  13405. * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
  13406. for shared libraries.
  13407. * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
  13408. 2008-09-11 Chris Demetriou <cgd@google.com>
  13409. * options.h (origin): New -z option.
  13410. * layout.cc (Layout:finish_dynamic_section): If "-z origin"
  13411. is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
  13412. in DT_FLAGS_1.
  13413. 2008-09-05 Cary Coutant <ccoutant@google.com>
  13414. * fileread.cc (File_read::make_view): Add check for attempt to map
  13415. beyond end of file.
  13416. 2008-09-05 Cary Coutant <ccoutant@google.com>
  13417. * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
  13418. explicit instantiations.
  13419. 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
  13420. PR gold/6858
  13421. * options.cc (General_options::finalize): Allow undefined symbols
  13422. in shlibs if linking -shared.
  13423. PR gold/6859
  13424. * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
  13425. symbols as not needing a dynsym entry.
  13426. 2008-08-20 Craig Silverstein <csilvers@google.com>
  13427. * fileread.cc (File_read::open): Do not lock the file unless it
  13428. was successfully opened.
  13429. 2008-08-14 Cary Coutant <ccoutant@google.com>
  13430. * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
  13431. Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
  13432. * testsuite/tls_test.cc (struct int128): 128-bit struct
  13433. for testing TLS relocs with non-zero addend.
  13434. (v12): New TLS variable.
  13435. (t12): New test.
  13436. (t_last): Add check for v12.
  13437. * testsuite/tls_test.h (t12): New function.
  13438. * testsuite/tls_test_main.cc (thread_routine): Call new test.
  13439. 2008-08-13 Ian Lance Taylor <iant@google.com>
  13440. * layout.cc (Layout::attach_allocated_section_to_segment): Don't
  13441. set tls_segment_ or relro_segment_.
  13442. (Layout::make_output_segment): Set tls_segment_ and relro_segment_
  13443. when appropriate.
  13444. * output.h (Output_section::clear_is_relro): New function.
  13445. * output.cc (Output_segment::add_output_section): Handle SHF_TLS
  13446. sections specially even when output_data_ is empty.
  13447. (Output_segment::maximum_alignment): When first section is relro,
  13448. only force alignment for PT_LOAD segments.
  13449. * script.cc (script_data_segment_align): New function.
  13450. (script_data_segment_relro_end): New function.
  13451. * script-c.h (script_data_segment_align): Declare.
  13452. (script_data_segment_relro_end): Declare.
  13453. * script-sections.h (class Script_sections): Declare
  13454. data_segment_align and data_segment_relro_end. Add fields
  13455. segment_align_index_ and saw_relro_end_.
  13456. * script-sections.cc (class Sections_element): Add set_is_relro
  13457. virtual function. Add new bool* parameter to place_orphan_here.
  13458. Add get_output_section virtual function.
  13459. (class Output_section_definition): Add set_is_relro. Add new
  13460. bool* parameter to place_orphan_here. Add get_output_section.
  13461. Add is_relro_ field.
  13462. (Output_section_definition::Output_section_definition): Initialize
  13463. evaluated_address_, evaluated_load_address, evaluated_addralign_,
  13464. and is_relro_ fields.
  13465. (Output_section_definition::place_orphan_here): Add is_relro
  13466. parameter.
  13467. (Output_section_definition::set_section_addresses): Set relro for
  13468. output section.
  13469. (Output_section_definition::alternate_constraint): Likewise.
  13470. (class Orphan_output_section): Add new bool* parameter to
  13471. place_orphan_here. Add get_output_section.
  13472. (Orphan_output_section::place_orphan_here): Add is_relro
  13473. parameter.
  13474. (Script_sections::Script_sections): Initialize
  13475. data_segment_align_index_ and saw_relro_end_.
  13476. (Script_sections::data_segment_align): New function.
  13477. (Script_sections::data_segment_relro_end): New function.
  13478. (Script_sections::place_orphan): Set or clear is_relro.
  13479. (Script_sections::set_section_addresses): Force alignment of first
  13480. TLS section.
  13481. * yyscript.y (exp): Call script_data_segment_align and
  13482. script_data_segment_relro_end.
  13483. * testsuite/relro_script_test.t: New file.
  13484. * testsuite/relro_test.cc (using_script): Declare.
  13485. (t1, t2): Test using_script.
  13486. * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
  13487. (relro_script_test_SOURCES): Define.
  13488. (relro_script_test_DEPENDENCIES): Define.
  13489. (relro_script_test_LDFLAGS): Define.
  13490. (relro_script_test_LDADD): Define.
  13491. (relro_script_test.so): New target.
  13492. * testsuite/Makefile.in: Rebuild.
  13493. 2008-08-06 Cary Coutant <ccoutant@google.com>
  13494. * archive.cc (Archive::total_archives, Archive::total_members)
  13495. (Archive::total_members_loaded): New variables.
  13496. (Archive::setup): Add parameter. Add option to preread
  13497. archive symbols.
  13498. (Archive::read_armap): Add counter.
  13499. (Archive::get_file_and_offset): New function.
  13500. (Archive::get_elf_object_for_member): New function.
  13501. (Archive::read_all_symbols): New function.
  13502. (Archive::read_symbols): New function.
  13503. (Archive::add_symbols): Add counters.
  13504. (Archive::include_all_members): Use armap to find members if it's
  13505. already built.
  13506. (Archive::include_member): Skip reading symbols if already read.
  13507. Factored code into Archive::get_file_and_offset and
  13508. Archive::get_elf_object_for_member. Changed call to
  13509. Mapfile::report_include_archive_member.
  13510. (Archive::print_stats): New function.
  13511. * archive.h: Declare Object and Read_symbols_data classes.
  13512. (Archive::Archive): Add initializers for new members.
  13513. (Archive::setup): Add parameter.
  13514. (Archive::print_stats): New function.
  13515. (Archive::total_archives, Archive::total_members)
  13516. (Archive::total_members_loaded): New variables.
  13517. (Archive::get_file_and_offset): New function.
  13518. (Archive::get_elf_object_for_member): New function.
  13519. (Archive::read_all_symbols): New function.
  13520. (Archive::read_symbols): New function.
  13521. (Archive::Archive_member): New class.
  13522. (Archive::members_): New member.
  13523. (Archive::num_members_): New member.
  13524. * main.cc: Include archive.h.
  13525. (main): Call Archive::print_stats.
  13526. * mapfile.cc (Mapfile::report_include_archive_member): Delete
  13527. archive parameter; member_name is now the fully-decorated name.
  13528. * mapfile.h (Mapfile::report_include_archive_member): Likewise.
  13529. * options.h: (General_options): Add --preread-archive-symbols option.
  13530. * readsyms.cc (Read_symbols::do_read_symbols): Change call to
  13531. Archive::setup.
  13532. 2008-08-04 Ian Lance Taylor <iant@google.com>
  13533. * symtab.h (Symbol::use_plt_offset): New function.
  13534. * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
  13535. * powerpc.cc (Relocate::relocate): Likewise.
  13536. * sparc.cc (Relocate::relocate): Likewise.
  13537. * x86_64.cc (Relocate::relocate): Likewise.
  13538. * testsuite/weak_plt.sh: New test.
  13539. * testsuite/weak_plt_main.cc: New test.
  13540. * testsuite/weak_plt_shared.cc: New test.
  13541. * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
  13542. (check_PROGRAMS): Add weak_plt.
  13543. (check_DATA): Add weak_plt_shared.so.
  13544. (weak_plt_main_pic.o, weak_plt): New targets.
  13545. (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
  13546. * testsuite/Makefile.in: Rebuild.
  13547. * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
  13548. gcctestdir/ld.
  13549. (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
  13550. * testsuite/Makefile.in: Rebuild.
  13551. 2008-08-04 Alan Modra <amodra@bigpond.net.au>
  13552. * Makefile.am (POTFILES.in): Set LC_ALL=C.
  13553. * Makefile.in: Regenerate.
  13554. * po/POTFILES.in: Regenerate.
  13555. 2008-07-29 Ian Lance Taylor <iant@google.com>
  13556. * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
  13557. symbols before other symbols.
  13558. * testsuite/script_test_2.cc (test_addr): Declare.
  13559. (test_addr_alias): Declare.
  13560. (main): Check that test_addr and test_addr_alias have the right
  13561. values.
  13562. * testsuite/script_test_2.t: Define test_addr_alias and
  13563. test_addr.
  13564. 2008-07-24 Ian Lance Taylor <iant@google.com>
  13565. PR 5990
  13566. * descriptors.cc: New file.
  13567. * descriptors.h: New file.
  13568. * gold-threads.h (class Hold_optional_lock): New class.
  13569. * fileread.cc: Include "descriptors.h".
  13570. (File_read::~File_read): Release descriptor rather than closing
  13571. it.
  13572. (File_read::open) [file]: Call open_descriptor rather than open.
  13573. Set is_descriptor_opened_.
  13574. (File_read::open) [memory]: Assert that descriptor is not open.
  13575. (File_read::reopen_descriptor): New function.
  13576. (File_read::release): Release descriptor.
  13577. (File_read::do_read): Make non-const. Reopen descriptor.
  13578. (File_read::read): Make non-const.
  13579. (File_read::make_view): Reopen descriptor.
  13580. (File_read::do_readv): Likewise.
  13581. * fileread.h (class File_read): Add is_descriptor_opened_ field.
  13582. Update declarations.
  13583. * layout.cc: Include "descriptors.h".
  13584. (Layout::create_build_id): Use open_descriptor rather than open.
  13585. * output.cc: Include "descriptors.h".
  13586. (Output_file::open): Use open_descriptor rather than open.
  13587. * archive.cc (Archive::const_iterator): Change Archive to be
  13588. non-const.
  13589. (Archive::begin, Archive::end): Make non-const.
  13590. (Archive::count_members): Likewise.
  13591. * archive.h (class Archive): Update declarations.
  13592. * object.h (Object::read): Make non-const.
  13593. * Makefile.am (CCFILES): Add descriptors.cc.
  13594. (HFILES): Add descriptors.h.
  13595. * Makefile.in: Rebuild.
  13596. PR 6716
  13597. * gold.h: Always include <clocale>. Add Solaris workarounds
  13598. following code in binutils/sysdep.h.
  13599. PR 6048
  13600. * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
  13601. this->eh_frame_hdr_ is NULL before using it.
  13602. * dynobj.cc (Versions::Versions): Update comment.
  13603. * dynobj.cc (Versions::Versions): If there is an soname, use it as
  13604. the base version name.
  13605. * stringpool.cc (Stringpool_template::add_with_length): Set key to
  13606. array size plus one.
  13607. (Stringpool_template::set_string_offsets): Subtract one from key
  13608. before using it as an array index.
  13609. (Stringpool_template::get_offset_with_length): Likewise.
  13610. (Stringpool_template::write_to_buffer): Likewise.
  13611. * stringpool.h (Stringpool_template::get_offset_from_key):
  13612. Likewise.
  13613. 2008-07-23 Ian Lance Taylor <iant@google.com>
  13614. PR 6658
  13615. * object.h (Merged_symbol_value::value): Do our best to handle a
  13616. negative addend.
  13617. PR 6647
  13618. * script.cc (Version_script_info::get_versions): Don't add empty
  13619. version tag to return value.
  13620. (Version_script_info::get_symbol_version_helper): Change return
  13621. type to bool. Add pversion parameter. Change all callers.
  13622. (script_register_vers_node): Don't require a non-NULL tag.
  13623. * script.h (class Version_script_info): Update declarations.
  13624. (Version_script_info::get_symbol_version): Change return type to
  13625. bool. Add version parameter. Change all callers.
  13626. * symtab.cc (Sized_symbol::add_from_relobj): Rework version
  13627. handling. Handle an empty version from a version script.
  13628. (Symbol_table::define_special_symbol): Likewise.
  13629. * testsuite/ver_test_10.script: New file.
  13630. * testsuite/ver_test_10.sh: New file.
  13631. * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
  13632. (check_DATA): Add ver_test_10.syms.
  13633. (ver_test_10.syms, ver_test_10.so): New target.
  13634. * testsuite/Makefile.in: Rebuild.
  13635. 2008-07-23 Simon Baldwin <simonb@google.com>
  13636. * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
  13637. to zero for undefined symbols from dynamic libraries.
  13638. 2008-07-23 Ian Lance Taylor <iant@google.com>
  13639. * symtab.cc (Symbol_table::resolve): Remove version parameter.
  13640. Change all callers.
  13641. * symtab.h (class Symbol_table): Update declaration.
  13642. * testsuite/ver_test_9.cc: New file.
  13643. * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
  13644. (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
  13645. (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
  13646. (ver_test_9.so, ver_test_9.o): New targets.
  13647. * testsuite/Makefile.in: Rebuild.
  13648. 2008-07-22 Ian Lance Taylor <iant@google.com>
  13649. * options.h (class General_options): Define --check-sections.
  13650. * layout.cc (Layout::set_segment_offsets): Handle
  13651. --check-sections.
  13652. * options.h (class General_options): Define -n/--nmagic and
  13653. -N/--omagic.
  13654. * options.cc (General_options::finalize): For -n/--nmagic or
  13655. -N/--omagic, set -static.
  13656. * layout.cc (Layout::attach_allocated_section_to_segment): If
  13657. -N/--omagic, don't put read-only and read-write sections in
  13658. different segments.
  13659. (Layout::find_first_load_seg): If -N/--omagic, don't insist on
  13660. finding a read-only segment.
  13661. (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
  13662. don't set the minimum segment alignment to the common page size,
  13663. and don't set the file offset to the address modulo the page size.
  13664. * script-sections.cc (Script_sections::create_segments): If
  13665. -n/--omagic, don't put read-only and read-write sections in
  13666. different segments.
  13667. * cref.cc: New file.
  13668. * cref.h: New file.
  13669. * options.h (class General_options): Add --print-symbol-counts.
  13670. * main.cc (main): Issue defined symbol report if requested.
  13671. * archive.cc (Archive::interpret_header): Make into a const member
  13672. function.
  13673. (Archive::add_symbols): Call Input_objects::archive_start and
  13674. archive_stop.
  13675. (Archive::const_iterator): Define new class.
  13676. (Archive::begin, Archive::end): New functions.
  13677. (Archive::include_all_members): Rewrite to use iterator.
  13678. (Archive::count_members): New function.
  13679. * archive.h (class Archive): Update declarations.
  13680. (Archive::filename): New function.
  13681. * object.cc: Include "cref.h".
  13682. (Sized_relobj::Sized_relobj): Initialize defined_count_.
  13683. (Sized_relobj::do_get_global_symbol_counts): New function.
  13684. (Input_objects::add_object): Add object to cross-referencer.
  13685. (Input_objects::archive_start): New function.
  13686. (Input_objects::archive_stop): New function.
  13687. (Input_objects::print_symbol_counts): New function.
  13688. * object.h: Declare Cref and Archive.
  13689. (Object::get_global_symbol_counts): New function.
  13690. (Object::do_get_global_symbol_counts): New pure virtual function.
  13691. (class Sized_relobj): Add defined_count_ field. Update
  13692. declarations.
  13693. (class Input_objects): Add cref_ field. Update constructor.
  13694. Update declarations.
  13695. * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
  13696. defined_count_.
  13697. (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
  13698. symbol counts.
  13699. (Sized_dynobj::do_get_global_symbol_counts): New function.
  13700. * dynobj.h (class Sized_dynobj): Add fields symbols_ and
  13701. defined_count_. Update declarations. Define Symbols typedef.
  13702. * symtab.cc (Symbol_table::add_from_relobj): Add defined
  13703. parameter. Change all callers.
  13704. (Symbol_table::add_from_dynobj): Add sympointers and defined
  13705. parameters. Change all callers.
  13706. * symtab.h (class Symbol_table): Update declarations.
  13707. * Makefile.am (CCFILES): Add cref.cc.
  13708. (HFILES): Add cref.h.
  13709. * Makefile.in: Rebuild.
  13710. 2008-07-22 Simon Baldwin <simonb@google.com>
  13711. * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
  13712. to zero when writing undefined symbols.
  13713. 2008-07-22 Ian Lance Taylor <iant@google.com>
  13714. * output.cc (Output_section::add_input_section): Don't try to
  13715. merge empty merge sections.
  13716. 2008-07-21 Craig Silverstein <csilvers@google.com>
  13717. * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
  13718. Include symbol version in error message.
  13719. 2008-07-20 Chris Demetriou <cgd@google.com>
  13720. * configure.ac (gold_cv_c_random_seed): New configured variable.
  13721. (RANDOM_SEED_CFLAGS): New substituted variable.
  13722. * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
  13723. * configure: Rebuild.
  13724. * Makefile.in: Likewise.
  13725. * testsuite/Makefile.in: Likewise.
  13726. 2008-07-18 Ian Lance Taylor <iant@google.com>
  13727. * symtab.cc (Symbol_table::add_from_object): Rewrite the case
  13728. where we see NAME/NULL and NAME/VERSION as separate symbols.
  13729. * testsuite/ver_test_main.cc (main): Call t4.
  13730. (t4, t4_2a): Define.
  13731. * testsuite/ver_test_2.cc (t4_2): Define.
  13732. * testsuite/ver_test_2.script: Put t4_2a in VER2.
  13733. * testsuite/ver_test_4.cc (t4_2a): Define.
  13734. * testsuite/ver_test_4.script: Put t4_2a in VER2.
  13735. * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
  13736. 2008-07-17 Ian Lance Taylor <iant@google.com>
  13737. * dynobj.cc (Versions::add_def): If we give an error about a
  13738. missing version, go ahead and create the version anyhow.
  13739. 2008-07-10 Ian Lance Taylor <iant@google.com>
  13740. Handle output sections with more than 0x7fffffff bytes.
  13741. * object.h (class Relobj): Change map_to_output_ to
  13742. output_sections_, and just keep a section pointer. Change all
  13743. uses. Move comdat group support to Sized_relobj.
  13744. (Relobj::is_section_specially_mapped): Remove.
  13745. (Relobj::output_section): Remove poff parameter. Change all
  13746. callers.
  13747. (Relobj::output_section_offset): New function.
  13748. (Relobj::set_section_offset): Rewrite.
  13749. (Relobj::map_to_output): Remove.
  13750. (Relobj::output_sections): New function.
  13751. (Relobj::do_output_section_offset): New pure virtual function.
  13752. (Relobj::do_set_section_offset): Likewise.
  13753. (class Sized_relobj): Add section_offsets_ field. Add comdat
  13754. group support from Relobj. Update declarations.
  13755. (Sized_relobj::get_output_section_offset): New function.
  13756. (Sized_relobj::do_output_section_offset): New function.
  13757. (Sized_relobj::do_set_section_offset): New function.
  13758. * object.cc (Relobj::output_section_address): Remove.
  13759. (Sized_relobj::Sized_relobj): Initialize new fields.
  13760. (Sized_relobj::include_section_group): Cast find_kept_object to
  13761. Sized_relobj.
  13762. (Sized_relobj::include_linkonce_section): Likewise.
  13763. (Sized_relobj::do_layout): Use separate arrays for output section
  13764. and output offset.
  13765. (Sized_relobj::do_count_local_symbols): Change map_to_output to
  13766. output_sections.
  13767. (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
  13768. output_sections and section_offsets.
  13769. (Sized_relobj::write_local_symbols): Likewise.
  13770. (map_to_kept_section): Compute output address directly.
  13771. * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
  13772. output_sections and section_offsets.
  13773. (Sized_relobj::write_sections): Likewise.
  13774. (Sized_relobj::relocate_sections): Likewise.
  13775. * symtab.cc (sized_finalize_symbol): Use output_section_offset.
  13776. * output.h (class Output_reloc): Update declarations. Change
  13777. u2_.relobj to Sized_relobj*.
  13778. (class Output_data_reloc): Change add functions to use
  13779. Sized_relobj*.
  13780. * output.cc (Output_reloc::Output_reloc): Change relobj to
  13781. Sized_relobj*.
  13782. (Output_reloc::local_section_offset): Change return type to
  13783. Elf_Addr. Use get_output_section_offset.
  13784. (Output_reloc::get_address): Likewise.
  13785. (Output_section::is_input_address_mapped): Don't call
  13786. is_section_specially_mapped.
  13787. (Output_section::output_offset): Likewise.
  13788. (Output_section::output_address): Likewise.
  13789. (Output_section::starting_output_address): Likewise.
  13790. * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
  13791. parameter to Sized_relobj*.
  13792. (Copy_relocs::need_copy_reloc): Likewise.
  13793. (Copy_relocs::save): Likewise.
  13794. * copy-relocs.h (class Copy_relocs): Update declarations.
  13795. (class Copy_relocs::Copy_reloc_entry): Change constructor to use
  13796. Sized_relobj*. Change relobj_ field to Sized_relobj*.
  13797. * target-reloc.h (relocate_for_relocatable): Change
  13798. offset_in_output_section type to Elf_Addr. Change code that uses
  13799. it as well.
  13800. * layout.cc (Layout::layout): Always set *off.
  13801. * mapfile.cc (Mapfile::print_input_section): Use
  13802. output_section_offset.
  13803. * i386.cc (Target_i386::copy_reloc): Change object parameter to
  13804. Sized_relobj*.
  13805. * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
  13806. * sparc.cc (Target_sparc::copy_reloc): Likewise.
  13807. * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
  13808. 2008-07-03 Ian Lance Taylor <iant@google.com>
  13809. * layout.cc (Layout::include_section): Do not discard unrecognized
  13810. SHT_STRTAB sections.
  13811. 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
  13812. * script.cc (Lex::can_continue_name): Make '?' allowable in
  13813. version-script names.
  13814. * testsuite/version_script.map: Change glob pattern to use '?'
  13815. 2008-06-30 Manish Singh <yosh@gimp.org>
  13816. PR 6585
  13817. * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
  13818. Correct typo.
  13819. 2008-06-30 Ian Lance Taylor <iant@google.com>
  13820. PR 6660
  13821. PR 6682
  13822. * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
  13823. versions]: Don't try to read the value in the contents, since we
  13824. don't use it. Use the template endianness when writing.
  13825. 2008-06-25 Cary Coutant <ccoutant@google.com>
  13826. * fileread.cc (File_read::make_view): Assert on zero-length view.
  13827. * object.cc (Sized_relobj::do_read_symbols): Don't try to read
  13828. symbol table when there are no symbols to read.
  13829. 2008-06-23 Craig Silverstein <csilvers@google.com>
  13830. * version.cc (version_string): Bump to 1.7
  13831. 2008-06-18 Craig Silverstein <csilvers@google.com>
  13832. * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
  13833. constant 0xFFFF to type Valtype.
  13834. (Powerpc_relocate_functions::rel16_ha): Likewise.
  13835. 2008-06-17 Ian Lance Taylor <iant@google.com>
  13836. * output.h (Output_section::Input_section): Initialize p2align_ to
  13837. zero for Output_section_data constructors.
  13838. (Output_section::Input_section::addralign): If not an input
  13839. section, return the alignment of the Output_section_data.
  13840. * testsuite/copy_test.cc: New file.
  13841. * testsuite/copy_test_1.cc: New file.
  13842. * testsuite/copy_test_2.cc: New file.
  13843. * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
  13844. (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
  13845. (copy_test_LDFLAGS, copy_test_LDADD): New variables.
  13846. (copy_test_1_pic.o, copy_test_1.so): New targets.
  13847. (copy_test_2_pic.o, copy_test_2.so): New targets.
  13848. * testsuite/Makefile.in: Rebuild.
  13849. * script-sections.cc (Script_sections::place_orphan): Initialize
  13850. local variable exact.
  13851. 2008-06-13 David Edelsohn <edelsohn@gnu.org>
  13852. * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
  13853. 2008-06-12 David Edelsohn <edelsohn@gnu.org>
  13854. David S. Miller <davem@davemloft.net>
  13855. * powerpc.cc: New file.
  13856. * Makefile.am (TARGETSOURCES): Add powerpc.cc
  13857. (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
  13858. * configure.tgt: Add entries for powerpc-* and powerpc64-*.
  13859. * Makefile.in: Rebuild.
  13860. 2008-06-09 Ian Lance Taylor <iant@google.com>
  13861. * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
  13862. <exception>.
  13863. (throwing, orig_terminate): New static variables.
  13864. (terminate_handler): New static function.
  13865. (t2): Set terminate handler.
  13866. 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
  13867. PR 6584
  13868. * binary.cc (Binary_to_elf::sized_convert): Fix .data
  13869. alignment.
  13870. 2008-05-30 Cary Coutant <ccoutant@google.com>
  13871. * archive.cc (Archive::include_all_members) Correct to step
  13872. over symbol table and extended name table in thin archives.
  13873. 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
  13874. PR 6407
  13875. * target-reloc.h (relocate_for_relocatable): Fix new_offset
  13876. calculation.
  13877. 2008-05-28 Caleb Howe <cshowe@google.com>
  13878. * reduced_debug_output.cc: New file.
  13879. * reduced_debug_output.h: New file.
  13880. * options.h (class General_options): Add --strip-debug-non-line.
  13881. * options.cc (General_options::finalize): Add strip_debug_non_line
  13882. to the strip heirarchy.
  13883. * layout.h (class Layout): Add debug_abbrev_ and debug_info_
  13884. fields.
  13885. * layout.cc: Include "reduced_debug_output.h".
  13886. (Layout::Layout): Initialize new fields.
  13887. (line_only_debug_sections): New static array.
  13888. (is_lines_only_debug_sections): New static inline function.
  13889. (Layout::include_section): Handle --strip-debug-non-line.
  13890. (Layout::make_output_section): If --strip-debug-non-line, build
  13891. new output sections for .debug_abbrev and .debug_info.
  13892. * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
  13893. gold. Warn about possible overflow.
  13894. (read_signed_LEB_128): Likewise.
  13895. * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
  13896. (read_signed_LEB_128): Declare.
  13897. * Makefile.am (CCFILES): Add reduced_debug_output.cc.
  13898. (HFILES): Add reduced_debug_output.h.
  13899. * Makefile.in: Rebuild.
  13900. 2008-05-21 Ian Lance Taylor <iant@google.com>
  13901. * mapfile.cc: New file.
  13902. * mapfile.h: New file.
  13903. * options.h (class General_options): Add -M/--print-map and -Map.
  13904. * options.cc (General_options::finalize): Make -M equivalent to
  13905. -Map -.
  13906. * main.cc: Include <cstdio> and "mapfile.h".
  13907. (main): Open mapfile if requested.
  13908. * gold.cc (class Middle_runner): Add mapfile_ field. Update
  13909. constructor. Change caller.
  13910. (queue_initial_tasks): Add mapfile parameter. Change caller.
  13911. (queue_middle_tasks): Likewise.
  13912. * gold.h (queue_initial_tasks, queue_middle_tasks): Update
  13913. declarations.
  13914. * archive.cc: Include "mapfile.h".
  13915. (Archive::add_symbols): Add mapfile parameter. Change all
  13916. callers. Pass mapfile, symbol, and reason to include_member.
  13917. (Archive::include_all_members): Add mapfile parameter. Change all
  13918. callers.
  13919. (Archive::include_member): Add mapfile, sym, and why parameters.
  13920. Change all callers. Report inclusion to map file.
  13921. * archive.h: Include "fileread.h".
  13922. (class Archive): Update declarations.
  13923. (Archive::file): New const method.
  13924. (class Add_archive_symbols): Add mapfile_ field. Update
  13925. constructor. Change all callers.
  13926. * readsyms.h (class Read_symbols): Likewise.
  13927. (class Finish_group): Likewise.
  13928. (class Read_script): Likewise.
  13929. * common.cc: Include "mapfile.h".
  13930. (Symbol_table::allocate_commons): Add mapfile parameter. Change
  13931. all callers.
  13932. (Symbol_table::do_allocate_commons): Likewise.
  13933. (Symbol_table::do_allocate_commons_list): Likewise. Report common
  13934. symbol allocation to mapfile.
  13935. * common.h (class Allocate_commons_task): Add mapfile_ field.
  13936. Update constructor. Change all callers.
  13937. * symtab.h (class Symbol_table): Update declarations.
  13938. * layout.cc: Include "mapfile.h".
  13939. (Layout_task_runner::run): Print information to mapfile.
  13940. (Layout::create_gold_note): Change Output_data_fixed_space to
  13941. Output_data_zero_fill.
  13942. (Layout::create_build_id): Likewise.
  13943. (Layout::print_to_mapfile): New function.
  13944. * layout.h (class Layout_task_runner): Add mapfile_ field. Update
  13945. constructor. Change caller.
  13946. (class Layout): Declare print_to_mapfile.
  13947. * output.cc (Output_section::Input_section::print_to_mapfile): New
  13948. function.
  13949. (Output_section::add_input_section): If producing a map, always
  13950. add to input_sections_ list.
  13951. (Output_section::do_print_to_mapfile): New function.
  13952. (Output_segment::print_sections_to_mapfile): New function.
  13953. (Output_segment::print_section_list_to_mapfile): New function.
  13954. * output.h: Include "mapfile.h".
  13955. (Output_data::print_to_mapfile): New function.
  13956. (Output_data::do_print_to_mapfile): New virtual function.
  13957. (Output_segment_headers::do_print_to_mapfile): New function.
  13958. (Output_file_header::do_print_to_mapfile): New function.
  13959. (Output_data_const::do_print_to_mapfile): New function.
  13960. (class Output_data_const_buffer): Add map_name_ field. Update
  13961. constructor. Change all callers. Add do_print_to_mapfile
  13962. function.
  13963. (class Output_data_fixed_space): Likewise.
  13964. (class Output_data_space): Likewise.
  13965. (class Output_data_zero_fill): New class.
  13966. (Output_data_strtab::do_print_to_mapfile): New function.
  13967. (Output_data_reloc_base::do_print_to_mapfile): New function.
  13968. (Output_relocatable_relocs::do_print_to_mapfile): New function.
  13969. (Output_data_group::do_print_to_mapfile): New function.
  13970. (Output_data_got::do_print_to_mapfile): New function.
  13971. (Output_data_dynamic::do_print_to_mapfile): New function.
  13972. (Output_symtab_xindex::do_print_to_mapfile): New function.
  13973. (class Output_section): Declare do_print_to_mapflie. Declare
  13974. print_to_mapfile in Input_section.
  13975. (class Output_segment): Declare new functions.
  13976. * object.h (Sized_relobj::symbol_count): New function.
  13977. * script-sections.cc
  13978. (Output_section_element_dot_assignment::set_section_addresses):
  13979. Change Output_data_fixed_space to Output_data_zero_fill.
  13980. (Output_data_expression::do_print_to_mapfile): New function.
  13981. * script.cc (read_input_script): Add mapfile parameter. Change
  13982. all callers.
  13983. * script.h (read_input_script): Update declaration.
  13984. * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
  13985. (Eh_frame::do_print_to_mapfile): New function.
  13986. * merge.h (Output_merge_data::do_print_to_mapfile): New function.
  13987. (Output_merge_string::do_print_to_mapfile): New function.
  13988. * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
  13989. function.
  13990. * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
  13991. function.
  13992. * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
  13993. function.
  13994. * Makefile.am (CCFILES): Add mapfile.cc.
  13995. (HFILES): Add mapfile.h.
  13996. * Makefile.in: Rebuild.
  13997. 2008-05-19 Ian Lance Taylor <iant@google.com>
  13998. * options.h (class General_options): Add -z relro.
  13999. * layout.cc (Layout::Layout): Initialize relro_segment_.
  14000. (Layout::add_output_section_data): Return the output section.
  14001. (Layout::make_output_section): Rcognize relro sections and mark
  14002. them appropriately.
  14003. (Layout::attach_allocated_section_to_segment): Put relro sections
  14004. in a PT_GNU_RELRO segment.
  14005. (Layout::create_initial_dynamic_sections): Mark the .dynamic
  14006. section as relro.
  14007. (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
  14008. PT_TLS segments.
  14009. (Layout::linkonce_mapping): Map d.rel.ro.local to
  14010. .data.rel.ro.local.
  14011. (Layout::output_section_name): Us .data.rel.ro.local for any
  14012. section which begins with that.
  14013. * layout.h (class Layout): Update add_output_section_data
  14014. declaration. Add relro_segment_ field.
  14015. * output.cc (Output_section::Output_section): Initialize is_relro_
  14016. and is_relro_local_ fields.
  14017. (Output_segment::add_output_section): Group relro sections.
  14018. (Output_segment::is_first_section_relro): New function.
  14019. (Output_segment::maximum_alignment): If there is a relro section,
  14020. align the segment to the common page size.
  14021. (Output_segment::set_section_addresses): Track whether we are
  14022. looking at relro sections. If the last section is a relro
  14023. section, align to the common page size.
  14024. (Output_segment::set_section_list_addresses): Add in_relro
  14025. parameter. Change all callers. Align to the page size when
  14026. moving from relro to non-relro section.
  14027. (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
  14028. segment.
  14029. * output.h (class Output_section): Add is_relro_ and
  14030. is_relro_local_ fields.
  14031. (Output_section::is_relro): New function.
  14032. (Output_section::set_is_relro): New function.
  14033. (Output_section::is_relro_local): New function.
  14034. (Output_section::set_is_relro_local): New function.
  14035. (class Output_segment): Update declarations.
  14036. * i386.cc (Target_i386::got_section): Mark .got section as relro.
  14037. * sparc.cc (Target_sparc::got_section): Likewise.
  14038. * x86_64.cc (Target_x86_64::got_section): Likewise.
  14039. * testsuite/relro_test_main.cc: New file.
  14040. * testsuite/relro_test.cc: New file.
  14041. * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
  14042. (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
  14043. (relro_test_LDFLAGS, relro_test_LDADD): New variables.
  14044. (relro_test.so, relro_test_pic.o): New targets.
  14045. * testsuite/Makefile.in: Rebuild.
  14046. 2008-05-16 Ian Lance Taylor <iant@google.com>
  14047. * output.cc (Output_segment::add_output_section): Remove front
  14048. parameter.
  14049. * output.h (class Output_segment): Remove
  14050. add_initial_output_section and overloaded add_output_section.
  14051. Update declaration of remaining add_output_section.
  14052. * layout.cc (Layout::create_interp): Call add_output_section
  14053. rather than add_initial_output_section.
  14054. (Layout::finish_dynamic_section): Likewise.
  14055. * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
  14056. for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
  14057. know the dynamic type.
  14058. * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
  14059. field. Initialize it in constructor.
  14060. (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
  14061. block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
  14062. Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
  14063. reloc.
  14064. * output.cc (Output_reloc::get_address): Change return type to
  14065. Elf_Addr.
  14066. * output.h (class Output_reloc): Update get_address declaration.
  14067. * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
  14068. for section addresses.
  14069. 2008-05-09 Ian Lance Taylor <iant@google.com>
  14070. PR 6493
  14071. * gold.cc (gold_nomem): Use return value of write.
  14072. 2008-05-08 Ian Lance Taylor <iant@google.com>
  14073. * symtab.c (Symbol::init_base_output_data): Add version
  14074. parameter. Change all callers.
  14075. (Symbol::init_base_output_segment): Likewise.
  14076. (Symbol::init_base_constant): Likewise.
  14077. (Symbol::init_base_undefined): Likewise.
  14078. (Sized_symbol::init_output_data): Likewise.
  14079. (Sized_symbol::init_output_segment): Likewise.
  14080. (Sized_symbol::init_constant): Likewise.
  14081. (Sized_symbol::init_undefined): Likewise.
  14082. (Symbol_table::do_define_in_output_data): If the new symbol has a
  14083. version, mark it as the default.
  14084. (Symbol_table::do_define_in_output_segment): Likewise.
  14085. (Symbol_table::do_define_as_constant): Likewise.
  14086. * symtab.h (class Symbol): Update declarations.
  14087. (class Sized_symbol): Likewise.
  14088. * resolve.cc (Symbol::override_version): New function.
  14089. (Symbol::override_base): Call override_version.
  14090. (Symbol::override_base_with_special): Likewise.
  14091. * testsuite/ver_script_8.script: New file.
  14092. * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
  14093. (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
  14094. (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
  14095. (ver_test_8_1.so, ver_test_8_2.so): New targets.
  14096. 2008-05-06 Ian Lance Taylor <iant@google.com>
  14097. PR 6049
  14098. * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
  14099. functions.
  14100. (class General_options): Remove existing --undefined, and add
  14101. --no-undefined instead. Add new --undefined as synonym for -u.
  14102. * archive.cc (Archive::add_symbols): Check whether symbol was
  14103. named with -u.
  14104. * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
  14105. * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
  14106. all uses. Add IS_UNDEFINED. Update declarations to split
  14107. different versions of init_base. Declare init_base_undefined.
  14108. (Symbol::is_defined): Handle IS_UNDEFINED.
  14109. (Symbol::is_undefined): Likewise.
  14110. (Symbol::is_weak_undefined): Call is_undefined.
  14111. (Symbol::is_absolute): Handle IS_CONSTANT.
  14112. (class Sized_symbol): Update declarations to split different
  14113. versions of init. Declare init_undefined.
  14114. (class Symbol_table): Declare new functions.
  14115. * symtab.cc (Symbol::init_base_object): Rename from init_base.
  14116. Change all callers.
  14117. (Symbol::init_base_output_data): Likewise.
  14118. (Symbol::init_base_output_segment): Likewise.
  14119. (Symbol::init_base_constant): Likewise.
  14120. (Symbol::init_base_undefined): New function.
  14121. (Sized_symbol::init_object): Rename from init. Change all
  14122. callers.
  14123. (Sized_symbol::init_output_data): Likewise.
  14124. (Sized_symbol::init_output_segment): Likewise.
  14125. (Sized_symbol::init_constant): Likewise.
  14126. (Sized_symbol::init_undefined): New function.
  14127. (Symbol_table::add_undefined_symbols_from_command_line): New
  14128. function.
  14129. (Symbol_table::do_add_undefined_symbols_from_command_line): New
  14130. function.
  14131. (Symbol::final_value_is_known): Handle IS_UNDEFINED.
  14132. (Symbol::output_section): Likewise.
  14133. (Symbol::set_output_section): Likewise.
  14134. (Symbol_table::sized_finalize_symbol): Likewise.
  14135. (Symbol_table::sized_write_globals): Likewise.
  14136. * resolve.cc (Symbol_table::should_override): Likewise.
  14137. (Symbol::override_base_with_special): Likewise.
  14138. * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
  14139. symbol, change it to have default visibility.
  14140. * testsuite/protected_1.cc: New file.
  14141. * testsuite/protected_2.cc: New file.
  14142. * testsuite/protected_3.cc: New file.
  14143. * testsuite/protected_main_1.cc: New file.
  14144. * testsuite/protected_main_2.cc: New file.
  14145. * testsuite/protected_main_3.cc: New file.
  14146. * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
  14147. (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
  14148. (protected_1_LDFLAGS, protected_1_LDADD): Define.
  14149. (protected_1.so): New target.
  14150. (protected_1_pic.o, protected_2_pic.o): New targets.
  14151. (protected_3_pic.o): New target.
  14152. (check_PROGRAMS): Add protected_2.
  14153. (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
  14154. (protected_2_LDFLAGS, protected_2_LDADD): Define.
  14155. * testsuite/Makefile.in: Rebuild.
  14156. * options.h (DEFINE_var): Add set_user_set_##varname__.
  14157. (DEFINE_bool_alias): New macro.
  14158. (class General_options): Define -Bstatic using DEFINE_bool_alias
  14159. rather than DEFINE_special. Add --undefined as an alias for -z
  14160. defs.
  14161. * options.cc (General_options::parse_Bstatic): Remove.
  14162. * options.h (class General_options): Add --fatal-warnings.
  14163. * main.cc (main): Implement --fatal-warnings.
  14164. * errors.h (Errors::warning_count): New function.
  14165. * options.h (class General_options): Add -Bsymbolic-functions.
  14166. * symtab.h (Symbol::is_preemptible): Check for
  14167. -Bsymbolic-functions.
  14168. 2008-05-05 Ian Lance Taylor <iant@google.com>
  14169. * options.h (DEFINE_bool): For DASH_Z, create the negative option
  14170. as noVARNAME rather than no-VARNAME.
  14171. (class General_options): Add option -z combreloc.
  14172. * output.h (class Output_reloc) [SHT_REL]: Declare compare and
  14173. get_address.
  14174. (Output_reloc::sort_before) [SHT_REL]: New function.
  14175. (Output_reloc::sort_before) [SHT_RELA]: New function.
  14176. (class Output_data_reloc_base): Add sort_relocs_ field. Define
  14177. Sort_relocs_comparison.
  14178. (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
  14179. parameter. Change all callers.
  14180. (Output_data_reloc::Output_data_reloc) [both versions]: Add
  14181. sort_relocs parameter. Change all callers.
  14182. * output.cc (Output_reloc::get_address): New function, broken out
  14183. of write_rel.
  14184. (Output_reloc::write_rel): Call it.
  14185. (Output_reloc::compare): New function.
  14186. (Output_data_reloc_base::do_write): Optionally sort relocs.
  14187. * configure.ac: If targ_extra_obj is set, link it in.
  14188. * configure.tgt: Initialize all variables.
  14189. (x86_64*): Set targ_extra_obj and targ_extra_size.
  14190. * configure: Rebuild.
  14191. * object.cc (Sized_relobj::include_section_group): Adjust section
  14192. indexes read from group data. Build vector to pass to
  14193. layout_group.
  14194. * layout.cc (Layout::layout_group): Add flags and shndxes
  14195. parameters. Remove contents parameter. Change caller. Update
  14196. explicit instantiations.
  14197. * layout.h (class Layout): Update layout_group declaration.
  14198. * output.cc (Output_data_group::Output_data_group): Add flags and
  14199. input_shndxes parameters. Remove contents parameter. Change
  14200. caller.
  14201. (Output_data_group::do_write): Change input_sections_ to
  14202. input_shndxes_.
  14203. * output.h (class Output_data_group): Update constructor
  14204. declaration. Rename input_sections_ to input_shndxes_.
  14205. * testsuite/many_sections_test.cc: Add template.
  14206. 2008-04-30 Cary Coutant <ccoutant@google.com>
  14207. * target-reloc.h (relocate_section): Fix dead-pointer bug.
  14208. * layout.cc (Layout::include_section): Refactored check for debug
  14209. info section.
  14210. (Layout::add_comdat): Add new parameters. Change type
  14211. of signature parameter. Add object and shndx to signatures table.
  14212. (Layout::find_kept_object): New function.
  14213. * layout.h: Include <cstring>.
  14214. (Layout::is_debug_info_section): New function.
  14215. (Layout::add_comdat): Add new parameters.
  14216. (Layout::find_kept_object): New function.
  14217. (Layout::Kept_section): New struct.
  14218. (Layout::Signatures): Change type of map range.
  14219. * object.cc (Relobj::output_section_address): New function.
  14220. (Sized_relobj::include_section_group): Add new parameters. Change
  14221. calls to Layout::add_comdat. Change to build table of kept comdat
  14222. groups and table mapping discarded sections to kept sections.
  14223. (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
  14224. (Sized_relobj::do_layout): Change calls to include_section_group and
  14225. include_linkonce_section.
  14226. (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
  14227. value to zero when section is discarded.
  14228. (Sized_relobj::map_to_kept_section): New function.
  14229. * object.h (Relobj::output_section_address): New function.
  14230. (Relobj::Comdat_group): New type.
  14231. (Relobj::find_comdat_group): New function.
  14232. (Relobj::Comdat_group_table): New type.
  14233. (Relobj::Kept_comdat_section): New type.
  14234. (Relobj::Kept_comdat_section_table): New type.
  14235. (Relobj::add_comdat_group): New function.
  14236. (Relobj::set_kept_comdat_section): New function.
  14237. (Relobj::get_kept_comdat_section): New function.
  14238. (Relobj::comdat_groups_): New field.
  14239. (Relobj::kept_comdat_sections_): New field.
  14240. (Symbol_value::input_value): Update comment.
  14241. (Sized_relobj::map_to_kept_section) New function.
  14242. (Sized_relobj::include_linkonce_section): Add new parameter.
  14243. * target-reloc.h (Comdat_behavior): New type.
  14244. (get_comdat_behavior): New function.
  14245. (relocate_section): Add code to map a discarded section to the
  14246. corresponding kept section when applying a relocation.
  14247. 2008-04-30 Craig Silverstein <csilvers@google.com>
  14248. * dwarf_reader.cc (next_generation_count): New static var.
  14249. (Addr2line_cache_entry): New struct.
  14250. (addr2line_cache): New static var.
  14251. (Dwarf_line_info::one_addr2line): Added caching.
  14252. (Dwarf_line_info::clear_addr2line_cache): New function.
  14253. * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
  14254. cache-size parameter.
  14255. (Dwarf_line_info::one_addr2line_cache): New function.
  14256. * symtab.cc (Symbol_table::detect_odr_violations): Pass
  14257. new cache-size argument to one_addr2line(), and clear cache.
  14258. 2008-04-28 Cary Coutant <ccoutant@google.com>
  14259. * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
  14260. R_386_PC8 relocations.
  14261. 2008-04-23 Ian Lance Taylor <iant@google.com>
  14262. * object.cc (Sized_relobj::include_section_group): Check for
  14263. invalid section group.
  14264. * object.cc (make_elf_object): Correct test for 64-bit ELF file
  14265. header size.
  14266. * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
  14267. than read for file header.
  14268. * archive.cc (Archive::include_member): Likewise.
  14269. 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
  14270. * aclocal.m4: Regenerate.
  14271. * configure: Regenerate.
  14272. 2008-04-19 Ian Lance Taylor <iant@google.com>
  14273. * version.cc (version_string): Bump to 1.6.
  14274. * testsuite/Makefile.am (many_sections_r_test): New target.
  14275. (many_sections_r_test_SOURCES): Remove.
  14276. (many_sections_r_test_DEPENDENCIES): Remove.
  14277. (many_sections_r_test_LDFLAGS): Remove.
  14278. (many_sections_r_test_LDADD): Remove.
  14279. * object.cc (Sized_relobj::do_add_symbols): Always pass
  14280. local_symbol_count_ to add_from_relobj.
  14281. * testsuite/Makefile.am (many_sections_check.h): Only check one in
  14282. every thousand variables.
  14283. * testsuite/Makefile.in: Rebuild.
  14284. * object.cc (Xindex::initialize_symtab_xindex): New function.
  14285. (Xindex::read_symtab_xindex): New function.
  14286. (Xindex::sym_xindex_to_shndx): New function.
  14287. (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
  14288. available.
  14289. (Sized_relobj::do_initialize_xindex): New function.
  14290. (Sized_relobj::do_read_symbols): Adjust section links.
  14291. (Sized_relobj::symbol_section_and_value): Add is_ordinary
  14292. parameter. Change all callers.
  14293. (Sized_relobj::include_section_group): Adjust section links and
  14294. symbol section indexes.
  14295. (Sized_relobj::do_layout): Adjust section links.
  14296. (Sized_relobj::do_count_local_symbols): Adjust section links and
  14297. symbol section indexes.
  14298. (Sized_relobj::do_finalize_local_symbols): Distinguish between
  14299. ordinary and special symbols.
  14300. (Sized_relobj::write_local_symbols): Add symtab_xindex and
  14301. dynsym_xindex parameters. Change all callers. Adjust section
  14302. links. Use SHN_XINDEX when needed.
  14303. (Sized_relobj::get_symbol_location_info): Adjust section links.
  14304. Don't get fooled by special symbols.
  14305. * object.h (class Xindex): Define.
  14306. (class Object): Add xindex_ parameter. Declare virtual functoin
  14307. do_initialize_xindex.
  14308. (Object::adjust_sym_shndx): New function.
  14309. (Object::set_xindex): New protected function.
  14310. (class Symbol_value): Add is_ordinary_shndx_ field.
  14311. (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
  14312. (Symbol_value::value): Assert ordinary section.
  14313. (Symbol_value::initialize_input_to_output_map): Likewise.
  14314. (Symbol_value::set_input_shndx): Add is_ordinary parameter.
  14315. Change all callers.
  14316. (Symbol_value::input_shndx): Add is_ordinary parameter. Change
  14317. all callers.
  14318. (class Sized_relobj): Update declarations.
  14319. (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
  14320. parameter. Change all callers.
  14321. (Sized_relobj::adjust_shndx): New function.
  14322. * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
  14323. field.
  14324. (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
  14325. parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
  14326. for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
  14327. (Sized_dynobj::read_dynsym_section): Adjust section links.
  14328. (Sized_dynobj::read_dynamic): Likewise.
  14329. (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
  14330. section links.
  14331. (Sized_dynobj::do_initialize_xindex): New function.
  14332. * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
  14333. do_initialize_xindex.
  14334. (Sized_dynobj::adjust_shndx): New function.
  14335. * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
  14336. dynsym_xindex_ fields.
  14337. (Layout::finalize): Add a call to set_section_indexes before
  14338. creating the symtab sections.
  14339. (Layout::set_section_indexes): Don't do anything if the section
  14340. already has a section index.
  14341. (Layout::create_symtab_sections): Add shnum parameter. Change
  14342. caller. Create .symtab_shndx section if needed.
  14343. (Layout::create_shdrs): Add shstrtab_section parameter. Change
  14344. caller.
  14345. (Layout::allocated_output_section_count): New function.
  14346. (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
  14347. needed.
  14348. * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
  14349. fields. Update declarations.
  14350. (Layout::symtab_xindex): New function.
  14351. (Layout::dynsym_xindex): New function.
  14352. (class Write_symbols_task): Add layout_ field.
  14353. (Write_symbols_task::Write_symbols_task): Add layout parameter.
  14354. Change caller.
  14355. * output.cc (Output_section_headers::Output_section_headers): Add
  14356. shstrtab_section parameter. Change all callers.
  14357. (Output_section_headers::do_sized_write): Store overflow values
  14358. for section count and section string table section index in
  14359. section header zero.
  14360. (Output_file_header::do_sized_write): Check for overflow of
  14361. section count and section string table section index.
  14362. (Output_symtab_xindex::do_write): New function.
  14363. (Output_symtab_xindex::endian_do_write): New function.
  14364. * output.h (class Output_section_headers): Add shstrtab_section_.
  14365. Update declarations.
  14366. (class Output_symtab_xindex): Define.
  14367. (Output_section::has_out_shndx): New function.
  14368. * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
  14369. field.
  14370. (Symbol::init_base): Add st_shndx and is_ordinary parameters.
  14371. Change all callers.
  14372. (Sized_symbol::init): Likewise.
  14373. (Symbol::output_section): Check for ordinary symbol.
  14374. (Symbol_table::add_from_object): Remove orig_sym parameter. Add
  14375. st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
  14376. callers.
  14377. (Symbol_table::add_from_relobj): Add symndx_offset parameter.
  14378. Change all callers. Simplify handling of symbols from sections
  14379. not included in the link.
  14380. (Symbol_table::add_from_dynobj): Handle ordinary symbol
  14381. distinction.
  14382. (Weak_alias_sorter::operator()): Assert that symbols are
  14383. ordinary.
  14384. (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
  14385. distinction.
  14386. (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
  14387. parameters. Change all callers.
  14388. (Symbol_table::sized_write_globals): Likewise. Handle ordinary
  14389. symbol distinction. Use SHN_XINDEX when needed.
  14390. (Symbol_table::write_section_symbol): Add symtab_xindex
  14391. parameter. Change all callers.
  14392. (Symbol_table::sized_write_section_symbol): Likewise. Use
  14393. SHN_XINDEX when needed.
  14394. * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
  14395. declarations.
  14396. (Symbol::shndx): Add is_ordinary parameter. Change all callers.
  14397. (Symbol::is_defined): Check is_ordinary.
  14398. (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
  14399. (Symbol::is_absolute, Symbol::is_common): Likewise.
  14400. (class Sized_symbol): Update declarations.
  14401. (class Symbol_table): Update declarations.
  14402. * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
  14403. parameters. Change all callers.
  14404. (Sized_symbol::override): Likewise.
  14405. (Symbol_table::override): Likewise.
  14406. (symbol_to_bits): Add is_ordinary parameter. Change all callers.
  14407. (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
  14408. is_ordinary, and orig_st_shndx parameters. Change all callers.
  14409. * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
  14410. to be in an ordinary section.
  14411. * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
  14412. object and is_ordinary parameters. Change all callers.
  14413. (Sized_dwarf_line_info::read_relocs): Add object parameter.
  14414. Change all callers. Don't add undefined or non-ordinary symbols
  14415. to reloc_map_.
  14416. (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
  14417. Change all callers.
  14418. * dwarf_reader.h (class Sized_dwarf_line_info): Update
  14419. declarations.
  14420. * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
  14421. * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
  14422. (Sized_relobj::relocate_sections): Likewise.
  14423. * target-reloc.h (scan_relocs): Adjust section symbol index.
  14424. (scan_relocatable_relocs): Likewise.
  14425. * i386.cc (Scan::local): Check for ordinary symbols.
  14426. * sparc.cc (Scan::local): Likewise.
  14427. * x86_64.cc (Scan::local): Likewise.
  14428. * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
  14429. to symbol_section_and_value.
  14430. * testsuite/many_sections_test.cc: New file.
  14431. * testsuite/Makefile.am (BUILT_SOURCES): Define.
  14432. (check_PROGRAMS): Add many_sections_test.
  14433. (many_sections_test_SOURCES): Define.
  14434. (many_sections_test_DEPENDENCIES): Define.
  14435. (many_sections_test_LDFLAGS): Define.
  14436. (BUILT_SOURCES): Add many_sections_define.h.
  14437. (many_sections_define.h): New target.
  14438. (BUILT_SOURCES): Add many_sections_check.h.
  14439. (many_sections_check.h): New target.
  14440. (check_PROGRAMS): Add many_sections_r_test.
  14441. (many_sections_r_test_SOURCES): Define.
  14442. (many_sections_r_test_DEPENDENCIES): Define.
  14443. (many_sections_r_test_LDFLAGS): Define.
  14444. (many_sections_r_test_LDADD): Define.
  14445. (many_sections_r_test.o): New target.
  14446. * testsuite/Makefile.in: Rebuild.
  14447. 2008-04-17 Cary Coutant <ccoutant@google.com>
  14448. * errors.cc (Errors::info): New function.
  14449. (gold_info): New function.
  14450. * errors.h (Errors::info): New function.
  14451. * gold.h (gold_info): New function.
  14452. * object.cc (Input_objects::add_object): Print trace output.
  14453. * options.cc (options::parse_set): New function.
  14454. (General_options::parse_wrap): Deleted.
  14455. (General_options::General_options): Deleted initializer.
  14456. * options.h (options::String_set): New typedef.
  14457. (options::parse_set): New function.
  14458. (DEFINE_set): New macro.
  14459. (General_options::wrap): Changed to use DEFINE_set. Changed
  14460. callers of any_wrap_symbols and is_wrap_symbol.
  14461. (General_options::trace, General_options::trace_symbol):
  14462. New options.
  14463. (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
  14464. (General_options::wrap_symbols_): Deleted.
  14465. * symtab.cc (Symbol_table::add_from_object): Print trace output.
  14466. 2008-04-17 David S. Miller <davem@davemloft.net>
  14467. * options.cc (General_options::parse_V): New function.
  14468. * options.h: Add entries for -V and -Qy.
  14469. 2008-04-17 Ian Lance Taylor <iant@google.com>
  14470. * common.cc (Symbol_table::allocate_commons): Remove options
  14471. parameter. Change caller.
  14472. (Symbol_table::do_allocate_commons): Remove options parameter.
  14473. Change caller. Just call do_allocate_commons_list twice.
  14474. (Symbol_table::do_allocate_commons_list): New function, broken out
  14475. of do_allocate_commons.
  14476. * common.h (class Allocate_commons_task): Remove options_ field.
  14477. Update constructor.
  14478. * symtab.cc (Symbol_table::Symbol_table): Initialize
  14479. tls_commons_.
  14480. (Symbol_table::add_from_object): Put TLS common symbols on
  14481. tls_commons_ list.
  14482. (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
  14483. which are IN_OUTPUT_DATA.
  14484. * symtab.h (class Symbol_table): Add tls_commons_ field. Update
  14485. allocate_commons and do_allocate_commons declarations. Declare
  14486. do_allocate_commons_list.
  14487. * gold.cc (queue_middle_tasks): Update creation of
  14488. Allocate_commons_task to not pass options.
  14489. * testsuite/Makefile.am (INCLUDES): Add -I.. .
  14490. (TLS_TEST_C_FLAGS): New variable.
  14491. (tls_test_c_pic.o): New target.
  14492. (tls_test_shared.so): Link in tls_test_c_pic.o.
  14493. (tls_test_c_pic_ie.o): New target.
  14494. (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
  14495. (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
  14496. (tls_test_c.o): New target.
  14497. (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
  14498. (tls_pic_test_LDADD): Likewise.
  14499. (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
  14500. (tls_shared_gd_to_ie_test_LDADD): Likewise.
  14501. (tls_test_c_gnu2.o): New target.
  14502. (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
  14503. tls_test_c_gnu2.o.
  14504. (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
  14505. (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
  14506. (tls_test_shared_nonpic.so): Link in tls_test_c.o.
  14507. * testsuite/tls_test.cc: Include "config.h".
  14508. (t_last): Call t11_last.
  14509. * testsuite/tls_test.h (t11, t11_last): Declare.
  14510. * testsuite/tls_test_c.c: New file.
  14511. * testsuite/tls_test_main.cc (thread_routine): Call t11.
  14512. * configure.ac: Check for OpenMP support.
  14513. * configure, config.in, Makefile.in: Rebuild.
  14514. * testsuite/Makefile.in: Rebuild.
  14515. 2008-04-16 Cary Coutant <ccoutant@google.com>
  14516. * i386.cc (Target_i386::define_tls_base_symbol): New function.
  14517. (Target_i386::tls_base_symbol_defined_): New field.
  14518. (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
  14519. (Target_i386::Scan::global): Likewise.
  14520. * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
  14521. * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
  14522. (Target_x86_64::tls_base_symbol_defined_): New field.
  14523. (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
  14524. (Target_x86_64::Scan::global): Likewise.
  14525. 2008-04-16 Cary Coutant <ccoutant@google.com>
  14526. * symtab.h (Symbol::is_strong_undefined): Removed unused function.
  14527. (Symbol::needs_plt_entry): Allow weak undefined symbols.
  14528. (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
  14529. building shared libraries.
  14530. * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
  14531. (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
  14532. (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
  14533. * testsuite/Makefile.in: Rebuild.
  14534. * testsuite/weak_undef.h: New file.
  14535. * testsuite/weak_undef_file1.cc: Add extra test cases.
  14536. * testsuite/weak_undef_file2.cc: Likewise.
  14537. * testsuite/weak_undef_test.cc: Likewise.
  14538. 2008-04-16 David S. Miller <davem@davemloft.net>
  14539. * sparc.cc (Target_sparc::Scan): Change from struct to class.
  14540. Add issued_non_pic_error_ field. Declare check_non_pic.
  14541. (Target_sparc::Scan::check_non_pic): New function.
  14542. (Target_sparc::Scan::local): Call check_non_pic as appropriate.
  14543. (Target_sparc::Scan::global): Likewise.
  14544. * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
  14545. * configure: Rebuild.
  14546. * options.h (DEFINE_enable): New macro.
  14547. (new_dtags): New enable option.
  14548. (initfirst, interpose, loadfltr, nodefaultlib,
  14549. nodelete, nodlopen, nodump): New -z options.
  14550. * layout.cc (Layout:finish_dynamic_section): If new
  14551. dtags enabled, emit DT_RUNPATH. Also, emit a
  14552. DT_FLAGS_1 containing any specified -z flags.
  14553. 2008-04-16 Ian Lance Taylor <iant@google.com>
  14554. * copy-relocs.cc: New file.
  14555. * copy-relocs.h: New file.
  14556. * reloc.cc: Remove Copy_relocs code.
  14557. * reloc.h: Likewise.
  14558. * reloc-types.h (struct Reloc_types) [both versions]: Add
  14559. get_reloc_addend_noerror.
  14560. * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
  14561. variants of add_global which take an addend which must be zero.
  14562. * i386.cc: Include "copy-relocs.h".
  14563. (class Target_i386): Change type of copy_relocs_ to variable,
  14564. update initializer.
  14565. (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
  14566. Change all callers.
  14567. (Target_i386::do_finalize_sections): Change handling of
  14568. copy_relocs_.
  14569. * sparc.cc: Include "copy-relocs.h".
  14570. (class Target_sparc): Change type of copy_relocs_ to variable,
  14571. update initializer.
  14572. (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
  14573. Change all callers.
  14574. (Target_sparc::do_finalize_sections): Change handling of
  14575. copy_relocs_.
  14576. * x86_64.cc: Include "copy-relocs.h".
  14577. (class Target_x86_64): Change type of copy_relocs_ to variable,
  14578. update initializer.
  14579. (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
  14580. class. Change all callers.
  14581. (Target_x86_64::do_finalize_sections): Change handling of
  14582. copy_relocs_.
  14583. * Makefile.am (CCFILES): Add copy-relocs.cc.
  14584. (HFILES): Add copy-relocs.h.
  14585. * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
  14586. * testsuite/script_test_4.sh: Permit leading zeroes.
  14587. 2008-04-15 Ian Lance Taylor <iant@google.com>
  14588. * script-sections.cc (Script_sections::create_segments): Use
  14589. header_size_adjustment even when there is enough room for the
  14590. headers.
  14591. * testsuite/script_test_4.sh: New file.
  14592. * testsuite/script_test_4.t: New file.
  14593. * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
  14594. (check_DATA): Add script_test_4.stdout.
  14595. (MOSTLYCLEANFILES): Likewise.
  14596. (script_test_4): New target.
  14597. (script_test_4.stdout): New target.
  14598. * testsuite/Makefile.in: Rebuild.
  14599. * sparc.cc: Add definitions for Output_data_plt_sparc class
  14600. constants.
  14601. 2008-04-14 David S. Miller <davem@davemloft.net>
  14602. * sparc.cc: New file.
  14603. * Makefile.am (TARGETSOURCES): Add sparc.cc
  14604. (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
  14605. * configure.tgt: Document targ_extra_size and
  14606. targ_extra_big_endian. Add entries for sparc-* and
  14607. sparc64-*.
  14608. * configure.ac: Handle targ_extra_size and
  14609. targ_extra_big_endian.
  14610. * Makefile.in: Rebuild.
  14611. * configure: Likewise.
  14612. * po/POTFILES.in: Likewise.
  14613. * po/gold.pot: Likewise.
  14614. 2008-04-14 Ian Lance Taylor <iant@google.com>
  14615. * layout.cc (Layout::Layout): Initialize sections_are_attached_.
  14616. (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
  14617. in the name/type/flags to section mapping. Don't call
  14618. allocate_output_section.
  14619. (Layout::choose_output_section): Change parameter from adjust_name
  14620. to is_input_section. Don't permit input sections after sections
  14621. are attached to segments. Don't call allocate_output_section.
  14622. (Layout::layout_eh_frame): Call update_flags_for_input_section,
  14623. not write_enable_output_section.
  14624. (Layout::make_output_section): Don't push to
  14625. unattached_section_list_ nor call attach_to_segment. Call
  14626. attach_section_to_segment if sections are attached.
  14627. (Layout::attach_sections_to_segments): New function.
  14628. (Layout::attach_section_to_segment): New function.
  14629. (Layout::attach_allocated_section_to_segment): Rename from
  14630. attach_to_segment. Remove flags parameter.
  14631. (Layout::allocate_output_section): Remove function.
  14632. (Layout::write_enable_output_section): Remove function.
  14633. * layout.h (class Layout): Update for above changes. Add new
  14634. field sections_are_attached_.
  14635. * output.h (Output_section::update_flags_for_input_section): New
  14636. function.
  14637. * output.cc (Output_section::add_input_section): Call
  14638. update_flags_for_input_section.
  14639. * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
  14640. 2008-04-11 Cary Coutant <ccoutant@google.com>
  14641. * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
  14642. thought unnecessary.
  14643. * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
  14644. 2008-04-11 Ian Lance Taylor <iant@google.com>
  14645. * output.h (class Output_section_data): Remove inline definition
  14646. of set_addralign.
  14647. * output.cc (Output_section_data::set_addralign): New function.
  14648. 2008-04-11 Cary Coutant <ccoutant@google.com>
  14649. Add support for TLS descriptors for i386 and x86_64.
  14650. * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
  14651. (Target_i386::Relocate::tls_desc_gd_to_le): New function.
  14652. (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
  14653. GOT_TYPE_TLS_DESC.
  14654. (Target_i386::got_mod_index_entry): Remove unnecessary code.
  14655. (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
  14656. R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
  14657. relocations.
  14658. (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
  14659. Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
  14660. Fix problem with initial-exec relocations.
  14661. (Target_i386::Relocate::relocate_tls): Likewise.
  14662. (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
  14663. relaxation.
  14664. * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
  14665. support for section-plus-offset dynamic table entries.
  14666. * output.h (Output_data_dynamic::add_section_plus_offset): New function.
  14667. (Output_data_dynamic::Dynamic_entry): Add support for
  14668. section-plus-offset dynamic table entries.
  14669. (Output_data_dynamic::Classification): Likewise.
  14670. (Output_data_dynamic::classification_): Renamed offset_.
  14671. * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
  14672. (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
  14673. (Target_x86_64::make_plt_section): New function.
  14674. (Target_x86_64::reserve_tlsdesc_entries): New function.
  14675. (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
  14676. (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
  14677. (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
  14678. (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
  14679. (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
  14680. (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
  14681. (Output_data_plt_x86_64::set_final_data_size): Move out of line;
  14682. add extra PLT entry for TLS descriptors.
  14683. (Output_data_plt_x86_64::got_): New field.
  14684. (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
  14685. (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
  14686. fields.
  14687. (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
  14688. descriptors.
  14689. (Target_x86_64::make_plt_entry): Factor out make_plt_section.
  14690. (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
  14691. (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
  14692. R_386_TLS_DESC_CALL relocations.
  14693. (Target_x86_64::Scan::global): Likewise.
  14694. (Target_x86_64::do_finalize_sections): Add dynamic table entries
  14695. for TLS descriptors.
  14696. (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
  14697. Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
  14698. (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
  14699. GD-to-IE relaxation.
  14700. * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
  14701. and TLS_DESCRIPTORS.
  14702. * Makefile.in: Rebuild.
  14703. * configure: Rebuild.
  14704. * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
  14705. (tls_test_shared2.so): New target.
  14706. (tls_shared_gd_to_ie_test_SOURCES): New variable.
  14707. (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
  14708. (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
  14709. (tls_shared_gd_to_ie_test_LDADD): New variable.
  14710. (tls_shared_gnu2_gd_to_ie_test): New target.
  14711. (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
  14712. New targets.
  14713. (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
  14714. (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
  14715. (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
  14716. (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
  14717. (tls_shared_gnu2_test): New target.
  14718. (tls_test_gnu2_shared.so): New target.
  14719. (tls_shared_gnu2_test_SOURCES): New variable.
  14720. (tls_shared_gnu2_test_DEPENDENCIES): New variable.
  14721. (tls_shared_gnu2_test_LDFLAGS): New variable.
  14722. (tls_shared_gnu2_test_LDADD): New variable.
  14723. * testsuite/Makefile.in: Rebuild.
  14724. * testsuite/Makefile.
  14725. 2008-04-11 Ian Lance Taylor <iant@google.com>
  14726. * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
  14727. justsyms.t.
  14728. * testsuite/Makefile.in: Rebuild.
  14729. * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
  14730. long.
  14731. * testsuite/script_test_2.cc (main): Adjust test.
  14732. 2008-04-11 David S. Miller <davem@davemloft.net>
  14733. Ian Lance Taylor <iant@google.com>
  14734. * options.h (General_options): Add entries for '-Y' and
  14735. '-relax'.
  14736. * options.cc (General_options:finalize): If -Y was used, add those
  14737. entries to the library path instead of the default "/lib" and
  14738. "/usr/lib".
  14739. 2008-04-11 David S. Miller <davem@davemloft.net>
  14740. * testsuite/justsyms.t: Start at 0x100.
  14741. * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
  14742. * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
  14743. long.
  14744. * testsuite/script_test_2.cc: Adjust string and section length
  14745. checks.
  14746. 2008-04-09 Ian Lance Taylor <iant@google.com>
  14747. PR gold/5996
  14748. * script-sections.cc (Sections_element::allocate_to_segment): Add
  14749. orphan parameter.
  14750. (Output_section_definition::allocate_to_segment): Likewise.
  14751. (Orphan_output_section::allocate_to_segment): Likewise.
  14752. (Script_sections::attach_sections_using_phdrs_clause): Don't
  14753. propagate non-PT_LOAD segments to orphan sections.
  14754. * testsuite/Makefile.am (script_test_3.stdout): Generate using
  14755. readelf rather than objdump.
  14756. * testsuite/script_test_3.sh: Adjust accordingly. Test that
  14757. .interp section and PT_INTERP segment are the same size.
  14758. * testsuite/Makefile.in: Rebuild.
  14759. * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
  14760. aliases for symbols defined in the same object.
  14761. * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
  14762. (weak_alias_test_SOURCES): New variable.
  14763. (weak_alias_test_DEPENDENCIES): New variable.
  14764. (weak_alias_test_LDFLAGS): New variable.
  14765. (weak_alias_test_LDADD): New variable.
  14766. (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
  14767. (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
  14768. (weak_alias_test_3.o): New target.
  14769. (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
  14770. * testsuite/weak_alias_test_main.cc: New file.
  14771. * testsuite/weak_alias_test_1.cc: New file.
  14772. * testsuite/weak_alias_test_2.cc: New file.
  14773. * testsuite/weak_alias_test_3.cc: New file.
  14774. 2008-04-08 Ian Lance Taylor <iant@google.com>
  14775. * options.h (class General_options): Add --noinhibit-exec option.
  14776. * main.cc (main): Check --noinhibit-exec.
  14777. * options.h (class General_options): Define --wrap as a special
  14778. option. Add wrap_symbols_ field.
  14779. (General_options::any_wrap_symbols): New function.
  14780. (General_options::is_wrap_symbol): New function.
  14781. * options.cc (General_options::parse_wrap): New function.
  14782. (General_options::General_options): Initialize wrap_symbols_.
  14783. * symtab.cc (Symbol_table::wrap_symbol): New function.
  14784. (Symbol_table::add_from_object): Handle --wrap.
  14785. * symtab.h (class Symbol_table): Declare wrap_symbol.
  14786. * target.h (Target::wrap_char): New function.
  14787. (Target::Target_info): Add wrap_char field.
  14788. * i386.cc (Target_i386::i386_info): Initialize wrap_char.
  14789. * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
  14790. * testsuite/testfile.cc (Target_test::test_target_info):
  14791. Likewise.
  14792. * errors.cc (Errors::undefined_symbol): Mention symbol version if
  14793. there is one.
  14794. * layout.h (class Layout): Add added_eh_frame_data_ field.
  14795. * layout.cc (Layout::Layout): Initialize new field.
  14796. (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
  14797. output section until we find a section we merged successfully.
  14798. * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
  14799. that the size be non-zero.
  14800. * merge.cc (Object_merge_map::get_output_offset): Remove inline
  14801. qualifier.
  14802. 2008-04-08 Craig Silverstein <csilvers@google.com>
  14803. * configure.ac: Export new conditional variable HAVE_ZLIB.
  14804. * testsuite/Makefile.am (flagstest_o_specialfile): Condition
  14805. on HAVE_ZLIB.
  14806. (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
  14807. * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
  14808. 2008-04-07 Ian Lance Taylor <iant@google.com>
  14809. * version.cc (version_string): Set to "1.5".
  14810. * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
  14811. Add issued_non_pic_error_ field. Declare check_non_pic.
  14812. (Target_x86_64::Scan::check_non_pic): New function.
  14813. (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
  14814. (Target_x86_64::Scan::global): Likewise.
  14815. * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
  14816. addend parameter. Change caller. Handle merge sections.
  14817. (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
  14818. Address to Addend. Don't add in the result of
  14819. local_section_offset, pass down the addend and use the returned
  14820. value.
  14821. * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
  14822. Update declarations of local_section_offset and symbol_value.
  14823. * testsuite/two_file_test_1.cc (t18): New function.
  14824. * testsuite/two_file_test_2.cc (f18): New function.
  14825. * testsuite/two_file_test_main.cc (main): Call t18.
  14826. * testsuite/two_file_test.h (t18, f18): Declare.
  14827. * configure.ac: Don't test for objdump, c++filt, or readelf.
  14828. * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
  14829. conditionals.
  14830. (TEST_READELF): New variable.
  14831. (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
  14832. (check_PROGRAMS): Add two_file_strip_test.
  14833. (two_file_strip_test): New target.
  14834. (check_PROGRAMS): Add two_file_same_shared_strip_test.
  14835. (two_file_same_shared_strip_test_SOURCES): New variable.
  14836. (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
  14837. (two_file_same_shared_strip_test_LDFLAGS): New variable.
  14838. (two_file_same_shared_strip_test_LDADD): New variable.
  14839. (two_file_shared_strip.so): New target.
  14840. (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
  14841. (ver_test_5.syms, ver_test_7.syms): Likewise.
  14842. (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
  14843. (strip_test_3.stdout): Use TEST_OBJDUMP.
  14844. * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
  14845. 2008-04-04 Cary Coutant <ccoutant@google.com>
  14846. * symtab.h (Symbol::is_weak_undefined): New function.
  14847. (Symbol::is_strong_undefined): New function.
  14848. (Symbol::is_absolute): New function.
  14849. (Symbol::needs_plt_entry): Exclude weak undefined symbols.
  14850. (Symbol::needs_dynamic_reloc): Exclude weak undefined and
  14851. absolute symbols.
  14852. * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
  14853. (weak_undef_test): New target.
  14854. * testsuite/Makefile.in: Rebuild.
  14855. * testsuite/weak_undef_file1.cc: New file.
  14856. * testsuite/weak_undef_file2.cc: New file.
  14857. * testsuite/weak_undef_test.cc: New file.
  14858. 2008-04-03 Craig Silverstein <csilvers@google.com>
  14859. * compressed_output.h (class Output_compressed_section): Use
  14860. unsigned buffer.
  14861. * compressed_output.cc (zlib_compress): Use unsigned buffers,
  14862. add zlib header.
  14863. (zlib_compressed_suffix): Removed.
  14864. (Output_compressed_section::set_final_data_size): Use unsigned
  14865. buffers.
  14866. * testsuite/Makefile.am (flagstest_compress_debug_sections):
  14867. Fix linker invocation.
  14868. (flagstest_o_specialfile_and_compress_debug_sections):
  14869. Likewise.
  14870. * testsuite/Makefile.in: Regenerated.
  14871. 2008-04-02 David S. Miller <davem@davemloft.net>
  14872. * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
  14873. Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
  14874. 2008-04-02 Craig Silverstein <csilvers@google.com>
  14875. * TODO: New file.
  14876. 2008-04-02 Ian Lance Taylor <iant@google.com>
  14877. * fileread.cc (File_read::find_view): Add byteshift and vshifted
  14878. parameters. Update for new key type to views_. Change all
  14879. callers.
  14880. (File_read::read): Adjust for byteshift in returned view.
  14881. (File_read::add_view): New function, broken out of
  14882. find_and_make_view.
  14883. (File_read::make_view): New function, broken out of
  14884. find_and_make_view.
  14885. (File_read::find_or_make_view): Add offset and aligned
  14886. parameters. Rewrite accordingly. Change all callers.
  14887. (File_read::get_view): Add offset and aligned parameters. Adjust
  14888. for byteshift in return value.
  14889. (File_read::get_lasting_view): Likewise.
  14890. * fileread.h (class File_read): Update declarations.
  14891. (class File_read::View): Add byteshift_ field. Add byteshift to
  14892. constructor. Add byteshift method.
  14893. * archive.h (Archive::clear_uncached_views): New function.
  14894. (Archive::get_view): Add aligned parameter. Change all callers.
  14895. * object.h (Object::get_view): Add aligned parameter. Change all
  14896. callers.
  14897. (Object::get_lasting_view): Likewise.
  14898. * fileread.cc (File_read::release): Don't call clear_views if
  14899. there are multiple objects.
  14900. * fileread.h (File_read::clear_uncached_views): New function.
  14901. * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
  14902. on the archive.
  14903. 2008-03-31 Cary Coutant <ccoutant@google.com>
  14904. Add thin archive support.
  14905. * archive.cc (Archive::armagt): New const.
  14906. (Archive::setup): Remove task parameter and calls to unlock.
  14907. (Archive::unlock_nested_archives): New function.
  14908. (Archive::read_header): Add nested_off parameter. Change
  14909. all callers.
  14910. (Archive::interpret_header): Likewise.
  14911. (Archive::include_all_members): Change to handle thin
  14912. archives.
  14913. (Archive::include_member): Likewise.
  14914. * archive.h (Archive::Archive): Add new parameters and
  14915. initializers.
  14916. (Archive::armagt): New const.
  14917. (Archive::setup): Remove task parameter.
  14918. (Archive::unlock_nested_archives): New function.
  14919. (Archive::read_header): Add nested_off parameter.
  14920. (Archive::interpret_header): Likewise.
  14921. (Archive::Nested_archive_table): New typedef.
  14922. (Archive::is_thin_archive_): New field.
  14923. (Archive::nested_archives_): New field.
  14924. (Archive::options_): New field.
  14925. (Archive::dirpath_): New field.
  14926. (Archive::task_): New field.
  14927. * readsyms.cc (Read_symbols::do_read_symbols): Add check
  14928. for thin archives. Pass additional parameters to
  14929. Archive::Archive. Unlock the archive file after calling
  14930. Archive::setup.
  14931. 2008-03-29 Ian Lance Taylor <iant@google.com>
  14932. * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
  14933. version symbol to be local.
  14934. * testsuite/ver_test_4.sh: New file.
  14935. * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
  14936. (check_DATA): Add ver_test_4.syms.
  14937. (ver_test_4.syms): New target.
  14938. * testsuite/Makefile.in: Rebuild.
  14939. * output.cc
  14940. (Output_section::Input_section_sort_entry::has_priority): New
  14941. function.
  14942. (Output_section::Input_section_sort_entry::match_file_name): New
  14943. function.
  14944. (Output_section::Input_section_sort_entry::match_section_name):
  14945. Remove.
  14946. (Output_section::Input_section_sort_entry::match_section_name_prefix):
  14947. Remove.
  14948. (Output_section::Input_section_sort_entry::match_section_file):
  14949. Remove.
  14950. (Output_section::Input_section_sort_compare::operator()): Rewrite
  14951. using new Input_section_sort_entry functions. Sort crtbegin and
  14952. crtend first. Sort sections with no priority before sections with
  14953. a priority.
  14954. * testsuite/initpri1.c (d3): Check j != 4.
  14955. (cd5): New constructor/destructor function.
  14956. (main): Check j != 2.
  14957. * symtab.cc (Symbol_table::add_from_object): If we don't use the
  14958. new symbol when resolving, don't call set_is_default.
  14959. * testsuite/ver_test_7.cc: New file.
  14960. * testsuite/ver_test_7.sh: New file.
  14961. * testsuite/Makefile.am (ver_test_7.so): New target.
  14962. (ver_test_7.o): New target.
  14963. (check_SCRIPTS): Add ver_test_7.sh.
  14964. (check_DATA): Add ver_test_7.syms.
  14965. (ver_test_7.syms): New target.
  14966. 2008-03-28 Ian Lance Taylor <iant@google.com>
  14967. * layout.cc (Layout::layout): If we see an input section with a
  14968. name that needs sorting, set the must_sort flag for the output
  14969. section.
  14970. (Layout::make_output_section): If the name of the output section
  14971. indicates that it might require sorting, set the may_sort flag.
  14972. * output.h (Output_section::may_sort_attached_input_sections): New
  14973. function.
  14974. (Output_section::set_may_sort_attached_input_sections): New
  14975. function.
  14976. (Output_section::must_sort_attached_input_sections): New
  14977. function.
  14978. (Output_section::set_must_sort_attached_input_sections): New
  14979. function.
  14980. (class Output_section): Declare Input_section_sort_entry. Define
  14981. Input_section_sort_compare. Declare
  14982. sort_attached_input_sections. Add new fields:
  14983. may_sort_attached_input_sections_,
  14984. must_sort_attached_input_sections_,
  14985. attached_input_sections_are_sorted_.
  14986. * output.cc (Output_section::Output_section): Initialize new
  14987. fields.
  14988. (Output_section::add_input_section): Add an entry to
  14989. input_sections_ if may_sort or must_sort are true.
  14990. (Output_section::set_final_data_size): Call
  14991. sort_attached_input_sections if necessary.
  14992. (Output_section::Input_section_sort_entry): Define new class.
  14993. (Output_section::Input_section_sort_compare::operator()): New
  14994. function.
  14995. (Output_section::sort_attached_input_sections): New function.
  14996. * configure.ac: Check whether the compiler supports constructor
  14997. priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
  14998. * testsuite/initpri1.c: New file.
  14999. * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
  15000. CONSTRUCTOR_PRIORITY.
  15001. (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
  15002. (initpri1_LDFLAGS): New variable.
  15003. * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
  15004. 2008-03-27 Ian Lance Taylor <iant@google.com>
  15005. * common.cc (Sort_commons::operator): Correct sorting algorithm.
  15006. * testsuite/common_test_1.c: New file.
  15007. * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
  15008. (common_test_1_SOURCES): New variable.
  15009. (common_test_1_DEPENDENCIES): New variable.
  15010. (common_test_1_LDFLAGS): New variable.
  15011. * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
  15012. and commons_ correctly when NAME/VERSION does not override
  15013. NAME/NULL.
  15014. * testsuite/ver_test_6.c: New file.
  15015. * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
  15016. (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
  15017. (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
  15018. 2008-03-26 Ian Lance Taylor <iant@google.com>
  15019. * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
  15020. of an undefined symbol from a version script.
  15021. * testsuite/Makefile.am (ver_test_5.so): New target.
  15022. (ver_test_5.o): New target.
  15023. (check_SCRIPTS): Add ver_test_5.sh.
  15024. (check_DATA): Add ver_test_5.syms.
  15025. (ver_test_5.syms): New target.
  15026. * testsuite/ver_test_5.cc: New file.
  15027. * testsuite/ver_test_5.script: New file.
  15028. * testsuite/ver_test_5.sh: New file.
  15029. * Makefile.in, testsuite/Makefile.in: Rebuild.
  15030. PR gold/5986
  15031. Fix problems building gold with gcc 4.3.0.
  15032. * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
  15033. (gold_error_at_location, gold_warning_at_location): Use it.
  15034. * configure.ac: Check whether we can compile and use a template
  15035. function with a printf attribute.
  15036. * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
  15037. when jumping over bytes.
  15038. * object.cc: Instantiate Object::read_section_data.
  15039. * debug.h: Include <cstring>
  15040. * dwarf_reader.cc: Include <algorithm>
  15041. * main.cc: Include <cstring>.
  15042. * options.cc: Include <cstring>.
  15043. * output.cc: Include <cstring>.
  15044. * script.cc: Include <cstring>.
  15045. * script.h: Include <string>.
  15046. * symtab.cc: Include <cstring> and <algorithm>.
  15047. * target-select.cc: Include <cstring>.
  15048. * version.cc: Include <string>.
  15049. * testsuite/testmain.cc: Include <cstdlib>.
  15050. * configure, config.in: Rebuild.
  15051. 2008-03-25 Ian Lance Taylor <iant@google.com>
  15052. * options.cc: Include "../bfd/bfdver.h".
  15053. (options::help): Print bug reporting address.
  15054. * version.cc (print_version): Adjust output for current value of
  15055. BFD_VERSION_STRING.
  15056. * NEWS: New file.
  15057. * options.cc (options::help): Print list of supported targets.
  15058. * target-select.h: Include <vector>.
  15059. (class Target_selector): Make machine_, size_, and is_big_endian_
  15060. fields const. Add bfd_name_ and instantiated_target_ fields.
  15061. (Target_selector::Target_selector): Add bfd_name parameter.
  15062. (Target_selector::recognize): Make non-virtual, call
  15063. do_recognize.
  15064. (Target_selector::recognize_by_name): Make non-virtual, call
  15065. do_recognize_by_name.
  15066. (Target_selector::supported_names): New function.
  15067. (Target_selector::bfd_name): New function.
  15068. (Target_selector::do_instantiate_target): New pure virtual
  15069. function.
  15070. (Target_selector::do_recognize): New virtual function.
  15071. (Target_selector::do_recognize_by_name): New virtual function.
  15072. (Target_selector::instantiate_target): New private function.
  15073. (supported_target_names): Declare.
  15074. * target-select.cc (Target_selector::Target_selector): Update for
  15075. new parameter and fields.
  15076. (select_target_by_name): Check that the name matches before
  15077. calling recognize_by_name.
  15078. (supported_target_names): New function.
  15079. * i386.cc (class Target_selector_i386): Update Target_selector
  15080. constructor call. Remove recognize and recognize_by_name. Add
  15081. do_instantiate_target.
  15082. * x86_64.cc (class Target_selector_x86_64): Likewise.
  15083. * testsuite/testfile.cc (class Target_selector_test): Update for
  15084. changes to Target_selector.
  15085. * README: Rewrite, with some notes on unsupported features.
  15086. 2008-03-24 Cary Coutant <ccoutant@google.com>
  15087. * i386.cc (Target_i386::Got_type): New enum declaration.
  15088. (Target_i386::Scan::local): Updated callers of Output_data_got
  15089. member functions.
  15090. (Target_i386::Scan::global): Likewise.
  15091. (Target_i386::Relocate::relocate): Likewise.
  15092. (Target_i386::Relocate::relocate_tls): Likewise.
  15093. * object.h (Got_offset_list): New class.
  15094. (Sized_relobj::local_has_got_offset): Added got_type parameter.
  15095. (Sized_relobj::local_got_offset): Likewise.
  15096. (Sized_relobj::set_local_got_offset): Likewise.
  15097. (Sized_relobj::local_has_tls_got_offset): Removed.
  15098. (Sized_relobj::local_tls_got_offset): Removed.
  15099. (Sized_relobj::set_local_tls_got_offset): Removed.
  15100. (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
  15101. * output.cc (Output_data_got::add_global): Added got_type parameter.
  15102. (Output_data_got::add_global_with_rel): Likewise.
  15103. (Output_data_got::add_global_with_rela): Likewise.
  15104. (Output_data_got::add_global_pair_with_rel): New function.
  15105. (Output_data_got::add_global_pair_with_rela): New function.
  15106. (Output_data_got::add_local): Added got_type parameter.
  15107. (Output_data_got::add_local_with_rel): Likewise.
  15108. (Output_data_got::add_local_with_rela): Likewise.
  15109. (Output_data_got::add_local_pair_with_rel): New function.
  15110. (Output_data_got::add_local_pair_with_rela): New function.
  15111. (Output_data_got::add_global_tls): Removed.
  15112. (Output_data_got::add_global_tls_with_rel): Removed.
  15113. (Output_data_got::add_global_tls_with_rela): Removed.
  15114. (Output_data_got::add_local_tls): Removed.
  15115. (Output_data_got::add_local_tls_with_rel): Removed.
  15116. (Output_data_got::add_local_tls_with_rela): Removed.
  15117. * output.h (Output_data_got::add_global): Added got_type parameter.
  15118. (Output_data_got::add_global_with_rel): Likewise.
  15119. (Output_data_got::add_global_with_rela): Likewise.
  15120. (Output_data_got::add_global_pair_with_rel): New function.
  15121. (Output_data_got::add_global_pair_with_rela): New function.
  15122. (Output_data_got::add_local): Added got_type parameter.
  15123. (Output_data_got::add_local_with_rel): Likewise.
  15124. (Output_data_got::add_local_with_rela): Likewise.
  15125. (Output_data_got::add_local_pair_with_rel): New function.
  15126. (Output_data_got::add_local_pair_with_rela): New function.
  15127. (Output_data_got::add_global_tls): Removed.
  15128. (Output_data_got::add_global_tls_with_rel): Removed.
  15129. (Output_data_got::add_global_tls_with_rela): Removed.
  15130. (Output_data_got::add_local_tls): Removed.
  15131. (Output_data_got::add_local_tls_with_rel): Removed.
  15132. (Output_data_got::add_local_tls_with_rela): Removed.
  15133. * resolve.cc (Symbol::override_base_with_special): Removed
  15134. reference to has_got_offset_ field.
  15135. * symtab.cc (Symbol::init_fields): Replaced initialization
  15136. of got_offset_ with got_offsets_. Removed initialization
  15137. of has_got_offset_
  15138. * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
  15139. (Symbol::got_offset): Likewise.
  15140. (Symbol::set_got_offset): Likewise.
  15141. (Symbol::has_tls_got_offset): Removed.
  15142. (Symbol::tls_got_offset): Removed.
  15143. (Symbol::set_tls_got_offset): Removed.
  15144. (Symbol::got_offset_): Removed.
  15145. (Symbol::tls_mod_got_offset_): Removed.
  15146. (Symbol::tls_pair_got_offset_): Removed.
  15147. (Symbol::got_offsets_): New field.
  15148. (Symbol::has_got_offset): Removed.
  15149. (Symbol::has_tls_mod_got_offset): Removed.
  15150. (Symbol::has_tls_pair_got_offset): Removed.
  15151. * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
  15152. (Target_x86_64::Scan::local): Updated callers of Output_data_got
  15153. member functions.
  15154. (Target_x86_64::Scan::global): Likewise.
  15155. (Target_x86_64::Relocate::relocate): Likewise.
  15156. (Target_x86_64::Relocate::relocate_tls): Likewise.
  15157. 2008-03-25 Ben Elliston <bje@au.ibm.com>
  15158. * yyscript.y: Fix spelling error in comment.
  15159. 2008-03-24 Ian Lance Taylor <iant@google.com>
  15160. * options.h (class General_options): Define build_id option.
  15161. * layout.h (class Layout): Declare write_build_id, create_note,
  15162. create_build_id. Add build_id_note_ member.
  15163. * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
  15164. "libiberty.h", "md5.h", "sha1.h".
  15165. (Layout::Layout): Initialize eh_frame_data_,
  15166. eh_frame_hdr_section_, and build_id_note_.
  15167. (Layout::finalize): Call create_build_id.
  15168. (Layout::create_note): New function, broken out of
  15169. Layout::create_gold_note.
  15170. (Layout::create_gold_note): Call create_note.
  15171. (Layout::create_build_id): New function.
  15172. (Layout::write_build_id): New function.
  15173. (Close_task_runner::run): Call write_build_id.
  15174. * x86_64.cc: Correct license to GPLv3.
  15175. 2008-03-23 Ian Lance Taylor <iant@google.com>
  15176. * options.cc: Include "demangle.h".
  15177. (parse_optional_string): New function.
  15178. (parse_long_option): Handle takes_optional_argument.
  15179. (parse_short_option): Update dash_z initializer. Handle
  15180. takes_optional_argument.
  15181. (General_options::General_options): Initialize do_demangle_.
  15182. (General_options::finalize): Set do_demangle_. Handle demangling
  15183. style.
  15184. * options.h (parse_optional_string): Declare.
  15185. (struct One_option): Add optional_arg field. Update constructor.
  15186. Update call constructor calls. Add takes_optional_argument
  15187. function.
  15188. (DEFINE_var): Add optional_arg__ parameter. Change all callers.
  15189. (DEFINE_optional_string): Define.
  15190. (General_options::demangle): Change from DEFINE_bool to
  15191. DEFINE_optional_string.
  15192. (General_options::no_demangle): New function.
  15193. (General_options::do_demangle): New function.
  15194. (General_options::set_do_demangle): New function.
  15195. (General_options::execstack_status_): Move definition to end of
  15196. class definition.
  15197. (General_options::static_): Likewise.
  15198. (General_options::do_demangle_): New field.
  15199. * object.cc (big_endian>::get_symbol_location_info): Call
  15200. Options::do_demangle, not Options::demangle.
  15201. * symtab.cc (demangle): Likewise.
  15202. 2008-03-22 Ian Lance Taylor <iant@google.com>
  15203. * gold.h: Include <cstddef> and <sys/types.h>
  15204. * options.h: Include <cstring>.
  15205. 2008-03-21 Ian Lance Taylor <iant@google.com>
  15206. * Added source code to GNU binutils.
  15207. Copyright (C) 2008-2015 Free Software Foundation, Inc.
  15208. Copying and distribution of this file, with or without modification,
  15209. are permitted in any medium without royalty provided the copyright
  15210. notice and this notice are preserved.
  15211. Local Variables:
  15212. mode: change-log
  15213. left-margin: 8
  15214. fill-column: 74
  15215. version-control: never
  15216. End: