summaryrefslogtreecommitdiffstats
path: root/libelf/ChangeLog
blob: bc9ea9544fa5d1fa691d13757fda8385fd6996b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
2017-05-04  Ulf Hermann  <ulf.hermann@qt.io>

	* nlist.c: Open files in O_BINARY.

2017-05-04  Ulf Hermann  <ulf.hermann@qt.io>

	* elf_update.c: Don't try to posix_fallocate on systems where it isn't
	available. Don't fchmod the output file if there is no fchmod.

2017-02-28  Ulf Hermann  <ulf.hermann@qt.io>

	* Makefile.am: Use the predefined common library names rather than
	hardcoding to libelf.so and friends.

2017-04-27  Ulf Hermann  <ulf.hermann@qt.io>

	* elf_getarsym.c: Don't replace rawmemchr.
	* elf_strptr.c: Don't replace memrchr.

2017-04-21  Ulf Hermann  <ulf.hermann@qt.io>

	* Makefile.am: Link libelf agaist libgnu.a if requested.

2018-06-19  Mark Wielaard  <mark@klomp.org>

	* libelfP.h (__libelf_type_align): Remove !ALLOW_UNALIGNED guard.
	* elf_getdata.c (__libelf_type_aligns): Likewise.
	(convert_data): Remove ALLOW_UNALIGNED check.
	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Likewise.

2018-06-21  Mark Wielaard  <mark@klomp.org>

	* elf.h: Update from glibc.

2018-04-19  Andreas Schwab  <schwab@suse.de>

	* elf.h: Update from glibc.

2018-02-16  Mark Wielaard  <mark@klomp.org>

	* elf.h: Update from glibc.

2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>

	* elf32_updatenull.c (updatenull_wrlock): Use FALLTHROUGH macro
	instead of comment.
	* elf_begin.c (read_unmmaped_file): Likewise.
	(elf_begin): Likewise.
	* elf_cntl.c (elf_cntl): Likewise.

2017-10-04  Mark Wielaard  <mark@klomp.org>

	* elf_begin.c (file_read_elf): Skip sanity checking e_shoff if scncnt
	is zero, we won't use it then.

2017-10-04  Mark Wielaard  <mark@klomp.org>

	* libelfP.h: Add ELF_E_INVALID_ELF to error values enum.
	* elf_error.c (ELF_E_INVALID_ELF_IDX): New define. Use it as value
	for ELF_E_INVALID_ELF in msgidx.
	* elf_getshdrstrndx.c (elf_getshdrstrndx): Distinquish between pread
	failing and not having enough data.
	* elf_begin.c (get_shnum): Likewise. Explicitly set libelf errno on
	too large value.
	(file_read_elf): Make sure to always set libelf errno when returning
	NULL. Distinquish between i/o file and elf data errors.

2017-08-18  Ulf Hermann  <ulf.hermann@qt.io>

	* gelf_xlate.c: Use attribute_packed.

2017-04-27  Ulf Hermann  <ulf.hermann@qt.io>

	* libelfP.h: Use attribute_hidden.

2017-04-27  Ulf Hermann  <ulf.hermann@qt.io>

	* Makefile.am: Use fpic_CFLAGS and dso_LDFLAGS.

2017-08-15  Mark Wielaard  <mark@klomp.org>

	* elf.h: Update from glibc. Add new powerpc note descriptors.

2017-07-19  Gustavo Romero <gromero@linux.vnet.ibm.com>

	* elf.h: Add known type in notes segment descriptor for HTM SPRs.

2017-02-17  Ulf hermann  <ulf.hermann@qt.io>

	* Makefile.am: Add libelf_so_DEPS, which include libeu.a,
	libelf_so_LIBS.
	(libelf_so_LDLIBS): Add $(libelf_so_DEPS).
	(libelf.so$(EXEEXT): Use $(libelf_so_LIBS), require libelf.map
	from the right directory.

2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>

	* libelfP.h: Don't include config.h.

2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>

	* elf_begin.c: Use F_GETFD rather than F_GETFL.

2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>

	* libelf.h: Define macros for various function attributes and use
	them.

2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>

	* elf_update.c: Set ELF_F_MMAPPED flag if we mmap from elf_update.

2017-04-19  Mark Wielaard  <mark@klomp.org>

	* elf_getarsym.c (elf_getarsym): Initialize n to zero.

2017-03-27  Mark Wielaard  <mark@klomp.org>

	* elf32_updatefile.c (updatemmap): Always update last_positition.
	(updatefile): Likewise.

2017-03-24  Mark Wielaard  <mark@klomp.org>

	* elf_compress.c (__libelf_decompress): Check insane compression
	ratios before trying to allocate output buffer.

2016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
	    Mark Wielaard  <mjw@redhat.com>

	* gelf.h (gelf_newehdr): Change return type to void *.
	(gelf_newphdr): Likewise.
	* gelf_newehdr.c (gelf_newehdr): Likewise.
	* gelf_newphdr.c (gelf_newphdr): Likewise.

2016-10-21  Mark Wielaard  <mjw@redhat.com>

	* elf_getdata.c (__libelf_set_rawdata_wrlock): Sanity check
	offset and size before trying to malloc and read data.

2016-10-26  Mark Wielaard  <mjw@redhat.com>

	* elf_begin.c (read_file): Always set maxsize when parent == NULL.

2016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>

	* elf_getarsym.c (elf_getarsym): Open code rawmemchr when not
	available.
	* elf_strptr.c: Include stdbool.h.
	(validate_str): New function.
	(elf_strptr): Use validate_str instead of memrchr.

2016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>

	* elf32_updatefile.c: Remove sys/param.h include.
	* elf32_updatenull.c: Likewise. Add system.h include.
	* elf_begin.c: Remove sys/param.h.
	* elf_compress: Likewise. Add system.h include.
	(MAX): Remove definition.

2016-08-07  Mark Wielaard  <mjw@redhat.com>

	* elf_compress.c (__libelf_reset_rawdata): Check scn->flags and
	free rawdata_base when malloced. Set ELF_F_MALLOCED for scn->flags.
	* elf_end.c (elf_end): Check scn->flags and free rawdata_base if
	malloced.
	* libelfP.h (struct Elf_Scn): Document flags ELF_F_MALLOCED usage.

2016-07-06  Mark Wielaard  <mjw@redhat.com>

	* elf-knowledge.h (SH_FLAGS_COMBINE): Removed.
	(SH_FLAGS_IMPORTANT): Likewise.

2016-07-06  Mark Wielaard  <mjw@redhat.com>

	* elf32_updatenull.c (updatenull_wrlock): Ignore e_type when
	updating phdrs.
	* elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): Only do sanity
	checking if phdrs haven't been read in yet.

2016-06-24  John Ogness  <john.ogness@linutronix.de>

	* elf32_updatenull.c (updatenull_wrlock): Find first section.
	* elf_nextscn.c (elf_nextscn): When scn is NULL start from 0th
	section.

2016-06-28  Richard Henderson  <rth@redhat.com>

	* elf.h: Update from glibc.  Add lots of new EM_* definitions.

2016-04-14  Mark Wielaard  <mjw@redhat.com>

	* elf_compress.c (__libelf_compress): Free out_buf if deflateInit
	fails.

2016-02-13  Mark Wielaard  <mjw@redhat.com>

	* elf32_updatefile.c (updatemmap): Free scns when out of memory.

2016-01-28  Mark Wielaard  <mjw@redhat.com>

	* elf.h: Update from glibc. Add new i386 and x86_64 relocations.

2016-02-12  Mark Wielaard  <mjw@redhat.com>

	* elf.h: Update from glibc. Add NT_ARM_SYSTEM_CALL.

2016-02-04  Mark Wielaard  <mjw@redhat.com>

	* elf_getdata.c (__libelf_set_rawdata_wrlock): Don't adjust align
	for SHT_NOBITS sections.

2016-01-22  Chih-Hung Hsieh <chh@google.com>

	* elf_compress.c (__libelf_compress): Move nested function
	'do_deflate_cleanup' to file scope to compile with clang.
	* elf_strptr.c (elf_strptr): Move nested function 'get_zdata'
	to file scope to compile with clang.

2016-01-13  Mark Wielaard  <mjw@redhat.com>

	* libelf.h: Check SHF_COMPRESSED is defined. If not define it and the
	associated ELF compression types/defines.

2015-11-26  Mark Wielaard  <mjw@redhat.com>

	* elf_compress.c (__libelf_decompress_elf): New function, extracted
	from...
	(elf_compress): here. Check zdata_base use __libelf_decompress_elf.
	* elf_strptr.c (elf_strptr): If SHF_COMPRESSED check, uncompress and
	use zdata.
	* libelfP.h (struct Elf_Scn): Add zdata_size and zdata_align.
	(__libelf_decompress_elf): New internal function definition.

2015-10-21  Mark Wielaard  <mjw@redhat.com>

	* Makefile.am (libelf_a_SOURCES): Add elf_compress.c and
	elf_compress_gnu.c.
	* elf_compress.c: New file.
	* elf_compress_gnu.c: Likewise.
	* elf_begin.c (file_read_elf): Make a writable copy of the shdrs
	for ELF_C_READ_MMAP.
	* elf_end.c (elf_end): Free zdata_base.
	* elf_error.c: Add ELF_E_ALREADY_COMPRESSED,
	ELF_E_UNKNOWN_COMPRESSION_TYPE, ELF_E_COMPRESS_ERROR and
	ELF_E_DECOMPRESS_ERROR.
	* elf_data.c (__libelf_data_type): New internal function extracted
	from convert_data.
	(convert_data): Handle SHF_COMPRESSED.
	* elf32_updatenull.c (updatenull_wrlock): Check sh_entsize against
	uncompressed section data size if SHF_COMPRESSED.
	* elf32_getshdr.c (load_shdr_wrlock): Adjust assert to account for
	ELF_C_READ_MMAP.
	* libelf.h: Define elf_compress and elf_compress_gnu.
	* libelf.map (ELFUTILS_1.7): Add elf_compress and elf_compress_gnu.
	* libelfP.h: Add ELF_E_ALREADY_COMPRESSED,
	ELF_E_UNKNOWN_COMPRESSION_TYPE, ELF_E_COMPRESS_ERROR and
	ELF_E_DECOMPRESS_ERROR. Define __libelf_data_type.
	(__libelf_compress): New internal function definition.
	(__libelf_decompress): Likewise.
	(__libelf_reset_rawdata): Likewise.
	(__libelf_data_type): Likewise.
	(struct Elf_Scn): Add zdata_base.

2015-11-19  Mark Wielaard  <mjw@redhat.com>

	* Makefile.am (libelf_a_SOURCES): Add elf32_getchdr.c,
	elf64_getchdr.c and gelf_getchdr.c.
	(noinst_HEADERS): Add chdr_xlate.h.
	* abstract.h: Define Chdr32 and Chdr64.
	* chdr_xlate.h: New file.
	* elf32_getchdr.c: New file.
	* elf64_getchdr.c: New file.
	* elf_error.c: Add ELF_E_NOT_COMPRESSED, ELF_E_INVALID_SECTION_TYPE
	and ELF_E_INVALID_SECTION_FLAGS.
	* elf_getdata.c (__libelf_set_rawdata_wrlock): Set d_type to
	ELF_T_CHDR for SHF_COMPRESSED sections.
	* exttypes.h: Add Chdr32 and Chdr64.
	* gelf.h (GElf_Chdr): New typedef.
	(gelf_getchdr): New function definition.
	* gelf_fsize.c (__libelf_type_sizes): Add ELF_T_CHDR.
	* gelf_getchdr.c: New file.
	* gelf_xlate.c (__elf_xfctstom): Add ELF_T_CHDR cvt_chdr.
	* gelf_xlate.h: Add Chdr.
	* libelf.h (Elf_Type): Add ELF_T_CHDR.
	(elf32_getchdr): New function definition.
	(elf64_getchdr): Likewise.
	* libelf.map (ELFUTILS_1.7): New sections add elf32_getchdr,
	elf64_getchdr and gelf_getchdr.
	* libelfP.h: Add ELF_E_NOT_COMPRESSED, ELF_E_INVALID_SECTION_TYPE
	and ELF_E_INVALID_SECTION_FLAGS.

2015-10-16  Mark Wielaard  <mjw@redhat.com>

	* Makefile.am (libelf_so_LDLIBS): Add -lz.

2015-10-14  Mark Wielaard  <mjw@redhat.com>

	* elf.h: Update from glibc. Add section compression constants and
	structures.

2015-10-20  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* elf_begin.c (get_shnum): Elf64_Shdr.sh_size is an Elf64_Xword.
	Fix the size argument to pread_retry.

2015-10-13  Chih-Hung Hsieh  <chh@google.com>

	* elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Move nested
	function 'fill_mmap' to file scope.
	* elf_begin.c (elf_begin): Move nested function 'lock_dup_elf'
	to file scope.

2015-10-09  Josh Stone  <jistone@redhat.com>

	* libelf.h: Replace loff_t with int64_t throughout.

2015-10-05  Mark Wielaard  <mjw@redhat.com>

	* elf_update.c (write_file): Only use posix_fallocate when using
	mmap. Only report failure when errno is ENOSPC.

2015-10-09  Josh Stone  <jistone@redhat.com>

	* libelfP.h (struct Elf): Replace off64_t with off_t.
	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Likewise.

2015-10-05  Chih-Hung Hsieh <chh@google.com>

	* elf_getarsym.c (elf_getarsym): Do not use
	union of variable length arrays.

2015-10-05  Josh Stone  <jistone@redhat.com>

	* Makefile.am (libelf.so): Add AM_V_CCLD and AM_V_at silencers.

2015-09-24  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid
	relocation overflows in some platforms.

2015-09-29  Mark Wielaard  <mjw@redhat.com>

	* elf32_updatenull.c (default_ehdr): Set e_version when EV_NONE.
	(updatenull_wrlock): Always set e_shentsize.

2015-09-23  Mark Wielaard  <mjw@redhat.com>

	* elf32_getehdr.c (getehdr_wrlock): Mark as internal_function.
	* elf32_getshdr.c (getshdr_rdlock): Likewise.
	(getshdr_wrlock): Likewise.
	* elf_error.c (__libelf_seterrno): Likewise.
	* elf_getphdrnum.c (__elf_getphdrnum_rdlock): Likewise.
	(__elf_getphdrnum_chk_rdlock): Likewise.
	* elf_getshdrnum.c (__elf_getphdrnum_rdlock): Likewise.
	(__elf_getphdrnum_chk_rdlock): Likewise.
	* elf_getshdrnum.c (__elf_getshdrnum_rdlock): Likewise.
	* elf_readall.c (__libelf_readall): Likewise.
	* gelf_getehdr.c (__gelf_getehdr_rdlock): Likewise.

2015-09-22  Mark Wielaard  <mjw@redhat.com>

	* *.c: Remove old-style function definitions.

2015-06-22  Mark Wielaard  <mjw@redhat.com>

	* dl-hash.h: Update from glibc.

2015-06-18  Mark Wielaard  <mjw@redhat.com>

	* elf32_updatefile.c (updatefile): Always free shdr_data and scns
	when allocated on failure paths.

2015-06-18  Mark Wielaard  <mjw@redhat.com>

	* nlist.c (nlist): Check symscn shdr exists before use.

2015-06-16  Mark Wielaard  <mjw@redhat.com>

	* elf_update.c (write_file): Always also use ftruncate before
	posix_fallocate to make sure file has the right size.

2015-06-04  Mark Wielaard  <mjw@redhat.com>

	* elf_getdata.c (__libelf_type_aligns): Add entries for ELF_T_EHDR,
	ELF_T_OFF, ELF_T_PHDR, ELF_T_SHDR, ELF_T_SWORD, ELF_T_XWORD,
	ELF_T_SXWORD, ELF_T_GNUHASH, ELF_T_AUXV.
	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Check alignment
	of rawdata against requested type.

2015-06-02  Mark Wielaard  <mjw@redhat.com>

	* elf_getdata.c (convert_data): Make sure source data is properly
	aligned for type before calling actual conversion function.

2015-06-04  Mark Wielaard  <mjw@redhat.com>

	* elf_begin.c (get_shnum): Check alignment of Shdr, not Ehdr before
	direct access.

2015-06-02  Mark Wielaard  <mjw@redhat.com>

	* elf_begin.c (file_read_elf): Split checks for ehdr and shdr
	alignment, drop phdr alignment check.

2015-05-31  Mark Wielaard  <mjw@redhat.com>

	* elf32_getshdr.c (load_shdr_wrlock): Allocate shdrs with malloc,
	not alloca and free after conversion when a copy needs to be made.

2015-05-31  Mark Wielaard  <mjw@redhat.com>

	* elf32_getphdr.c (getphdr_wrlock): Allocate phdrs with malloc, not
	alloca and free after conversion when a copy needs to be made.

2015-05-31  Mark Wielaard  <mjw@redhat.com>

	* elf_getarsym.c (elf_getarsym): Allocate temporary file_date with
	malloc, not alloca also in !ALLOW_UNALIGNED case.

2015-05-30  Mark Wielaard  <mjw@redhat.com>

	* gelf_xlate.c (elf_cvt_Byte): Only call memmove with non-zero size.

2015-05-30  Mark Wielaard  <mjw@redhat.com>

	* elf32_updatefile.c (updatemmap): Only call mempcpy and update
	last_position when d_size is non-zero.

2015-05-17  Mark Wielaard  <mjw@redhat.com>

	* elf32_updatefile.c (updatefile): Allocate shdr_data and scns
	with malloc, not alloca. Free after writing section headers.

2015-05-16  Mark Wielaard  <mjw@redhat.com>

	* elf32_updatefile.c (updatemmap): Allocate temporary shdr storage
	with malloc, not alloca. Free after writing section header.

2015-05-16  Mark Wielaard  <mjw@redhat.com>

	* elf_getarsym.c (elf_getarsym): Allocate temporary file_date with
	malloc, not alloca. Call free after out.

2015-05-14  Mark Wielaard  <mjw@redhat.com>

	* elf_update.c (write_file): Use posix_fallocate instead of
	ftruncate to extend file if necessary.

2015-05-13  Mark Wielaard  <mjw@redhat.com>

	* elf32_updatenull.c (default_ehdr): If e_phnum is zero then set
	e_phoff also to zero.

2015-05-12  Mark Wielaard  <mjw@redhat.com>

	* elf32_updatenull.c (updatenull_wrlock): Check that sh_addralign
	is a powerof2.
	* elf_getdata.c (__libelf_set_rawdata_wrlock): Clamp large d_aligns
	to the elf image offset.

2015-05-12  Mark Wielaard  <mjw@redhat.com>

	* elf32_newphdr.c (newphdr): Call __libelf_seterrno with
	ELF_E_INVALID_INDEX before failing. Check whether section zero shdr
	actually exists if we need to put extended phnum in section zero.

2015-05-08  Mark Wielaard  <mjw@redhat.com>

	* nlist.c (nlist): Call gelf_fsize with EV_CURRENT.

2015-01-03  Mark Wielaard  <mjw@redhat.com>

	* version_xlate.h (elf_cvt_Verdef): Use memmove to copy src to dest.
	(elf_cvt_Verneed): Likewise.

2015-03-28  Mark Wielaard  <mjw@redhat.com>

	* elf.h: Update from glibc.

2015-03-23  Mark Wielaard  <mjw@redhat.com>

	* elf32_updatenull.c (updatenull_wrlock): Don't extend size with
	SHT_NOBITS sh_offset.

2015-02-18  Mark Wielaard  <mjw@redhat.com>

	* libelfP.h (__libelf_set_data_list_rdlock): Make internal_function.

2015-02-07  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* elf32_updatenull.c (__elfw2(LIBELFBITS,updatenull_wrlock)): Consider
	sh_addralign 0 as 1.

2015-01-22  Mark Wielaard  <mjw@redhat.com>

	* elf_strptr (elf_strptr): Make sure returned string is NUL
	terminated.

2015-01-21  Mark Wielaard  <mjw@redhat.com>

	* elf_strptr.c (elf_strptr): Check data_list_rear == NULL instead
	of rawdata_base != NULL before using rawdata directly.

2015-01-20  Mark Wielaard  <mjw@redhat.com>

	* libelfP.h (__elf_strptr_internal): New function declaration.
	* elf_getdata.c (__libelf_set_data_list_rdlock): New internal
	function extracted from...
	(__elf_getdata_rdlock): ... here.
	* elf_newdata.c (elf_newdata): Check scn->rawdata_base and update
	datalist if necessary.

2015-01-20  Mark Wielaard  <mjw@redhat.com>

	* elf_strptr.c (elf_strptr): Call __elf[32|64]_getshdr_rdlock if
	necessary.

2014-12-30  Mark Wielaard  <mjw@redhat.com>

	* elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): New function.
	(elf_getphdrnum): Call __elf_getphdrnum_chk_rdlock.
	* gelf_getphdr (gelf_getphdr): Call __elf_getphdrnum_chk_rdlock
	and always check ndx against phnum.
	* libelfP.h (__elf_getphdrnum_chk_rdlock): New internal function.

2014-12-25  Mark Wielaard  <mjw@redhat.com>

	* elf_begin.c (__libelf_next_arhdr_wrlock): ar_size cannot be
	negative. Include start_offset in maxsize.

2014-12-28  Alexander Cherepanov  <cherepan@mccme.ru>

	* elf_begin.c (read_long_names): Don't miss '/' right after
	another '/'. Fixes a dir traversal vuln in ar extraction.

2014-12-18  Ulrich Drepper  <drepper@gmail.com>

	* Makefile.am: Suppress output of textrel_check command.

2014-12-16  Mark Wielaard  <mjw@redhat.com>

	* elf_begin.c (read_long_names): Make sure long_names len fits
	in mapped ELF file.

2014-12-15  Mark Wielaard  <mjw@redhat.com>

	* elf_getarsym.c (elf_getarsym): Check index_size doesn't overflow.

2014-12-15  Mark Wielaard  <mjw@redhat.com>

	* elf_begin.c (read_long_names): Clear any garbage left in the
	name table.

2014-12-11  Mark Wielaard  <mjw@redhat.com>

	* elf_begin.c (file_read_elf): Correct ELF64 section offset check.

2014-12-11  Mark Wielaard  <mjw@redhat.com>

	* elf_begin.c (read_long_names): Check for offset overflow.
	(__libelf_next_arhdr_wrlock): Likewise. Sanity check the ar_size.
	Don't allow it to go beyond end of file.

2014-12-09  Mark Wielaard  <mjw@redhat.com>

	* elf_getarsym.c (elf_getarsym): Make sure n * w doesn't overflow.

2014-11-27  Mark Wielaard  <mjw@redhat.com>

	* Makefile.am (libelf.so): Use textrel_check.

2014-11-23  Mark Wielaard  <mjw@redhat.com>

	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Change signed
	overflow check to unsigned.

2014-11-23  Mark Wielaard  <mjw@redhat.com>

	* note_xlate.h (elf_cvt_note): Copy over any leftover data if
	src != dest. The data is probably part of truncated name/desc.

2014-11-22  Mark Wielaard  <mjw@redhat.com>

	* elf_getphdrnum.c (elf_getphdrnum): Sanity check the
	__elf_getphdrnum_rdlock result.

2014-11-18  Mark Wielaard  <mjw@redhat.com>

	* version_xlate.h (elf_cvt_Verdef): Check for overflow.
	(elf_cvt_Verneed): Likewise.

2014-11-17  Mark Wielaard  <mjw@redhat.com>

	* elf-knowledge.h (SECTION_STRIP_P): Check name is not NULL.

2014-11-16  Mark Wielaard  <mjw@redhat.com>

	* elf_getshdrstrndx.c: Check there are section headers before
	handling SHN_XINDEX.

2014-11-16  Mark Wielaard  <mjw@redhat.com>

	* elf32_getphdr.c (getphdr_wrlock): Check e_phoff isn't zero.
	Check for too many pheaders.
	* elf_getphdrnum.c (__elf_getphdrnum_rdlock): Check section zero
	actually exists before handling PN_XNUM.

2014-11-16  Mark Wielaard  <mjw@redhat.com>

	* gelf_getnote.c (gelf_getnote): Check padding overflow.

2014-11-16  Mark Wielaard  <mjw@redhat.com>

	* elf_getdata.c (__libelf_set_rawdata_wrlock): Declare offset, size
	and align as Elf64_Off and Elf64_Xword not size_t.

2014-11-14  Mark Wielaard  <mjw@redhat.com>

	* gelf_getnote.c (gelf_getnote): Check offset overflow.

2014-11-13  Mark Wielaard  <mjw@redhat.com>

	* elf_getdata.c (__libelf_set_rawdata_wrlock): Fix unsigned overflow
	check.

2014-11-08  Mark Wielaard  <mjw@redhat.com>

	* elf_begin.c (__libelf_next_arhdr_wrlock): Use mempcpy not __mempcpy.

2014-11-07  Mark Wielaard  <mjw@redhat.com>

	* elf_begin.c (file_read_elf): Correct sh_size check.
	* elf_getdata.c (__libelf_set_rawdata_wrlock): Check for unsigned
	overflow.

2014-09-10  Petr Machata  <pmachata@redhat.com>

	* elf_begin (read_unmmaped_file): Call __libelf_seterrno if the
	file is unreadable.

2014-07-07  Mark Wielaard  <mjw@redhat.com>

	* elf.h: Update from glibc.

2014-04-13  Mark Wielaard  <mjw@redhat.com>

	* Makefile.am: Remove !MUDFLAP conditions.
	* elf_begin.c (read_file): Don't clear use_mmap when _MUDFLAP is
	defined.
	* elf_update.c (write_file): Remove _MUDFLAP condition.

2014-01-17  Jakub Jelinek  <jakub@redhat.com>
	    Roland McGrath  <roland@redhat.com>

	* libelfP.h (INVALID_NDX): Define.
	* gelf_getdyn.c (gelf_getdyn): Use it.  Remove ndx < 0 test if any.
	* gelf_getlib.c (gelf_getlib): Likewise.
	* gelf_getmove.c (gelf_getmove): Likewise.
	* gelf_getrel.c (gelf_getrel): Likewise.
	* gelf_getrela.c (gelf_getrela): Likewise.
	* gelf_getsym.c (gelf_getsym): Likewise.
	* gelf_getsyminfo.c (gelf_getsyminfo): Likewise.
	* gelf_getsymshndx.c (gelf_getsymshndx): Likewise.
	* gelf_getversym.c (gelf_getversym): Likewise.
	* gelf_update_dyn.c (gelf_update_dyn): Likewise.
	* gelf_update_lib.c (gelf_update_lib): Likewise.
	* gelf_update_move.c (gelf_update_move): Likewise.
	* gelf_update_rel.c (gelf_update_rel): Likewise.
	* gelf_update_rela.c (gelf_update_rela): Likewise.
	* gelf_update_sym.c (gelf_update_sym): Likewise.
	* gelf_update_syminfo.c (gelf_update_syminfo): Likewise.
	* gelf_update_symshndx.c (gelf_update_symshndx): Likewise.
	* gelf_update_versym.c (gelf_update_versym): Likewise.

2014-01-17  Jakub Jelinek  <jakub@redhat.com>

	* elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header
	table fits into object's bounds.
	* elf_getshdrstrndx.c (elf_getshstrndx): Add elf->start_offset to
	elf->map_address.  Check if first section header fits into object's
	bounds.
	* elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)):
	Check if section header table fits into object's bounds.
	* elf_begin.c (get_shnum): Ensure section headers fits into
	object's bounds.
	(file_read_elf): Make sure scncnt is small enough to allocate both
	ElfXX_Shdr and Elf_Scn array.  Make sure section and program header
	tables fit into object's bounds.  Avoid memory leak on failure.
	* elf_newscn.c (elf_newscn): Check for overflow.
	* elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise.
	(__elfw2(LIBELFBITS,updatefile)): Likewise.
	* elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise.
	* elf_getarsym.c (elf_getarsym): Likewise.

2013-11-08  Mark Wielaard  <mjw@redhat.com>

	* elf32_updatefile.c (elfXX_updatemmap): Only memcpy ehdr when not
	already directly mmapped.

2013-11-05  Mark Wielaard  <mjw@redhat.com>

	* elf32_updatefile.c (elfXX_updatefile): Copy all section headers
	if elf->flags dirty.

2013-11-01  Michael Forney  <mforney@mforney.org>

	* Makefile.am: Use READELF.

2013-10-01  Petr Machata  <pmachata@redhat.com>

	* elf.h: Update from glibc.

2013-06-17  Petr Machata  <pmachata@redhat.com>

	* elf.h: Update from glibc.

2013-08-28  Namhyung Kim  <namhyung@gmail.com>

	* gelf.h (gelf_fsize): Fix typo in comment.

2013-08-28  Mark Wielaard  <mjw@redhat.com>

	* gelf_getauxv.c (gelf_getauxv): Add missing whitespace.

2013-08-27  Mark Wielaard  <mjw@redhat.com>

	* gelf_getauxv.c (gelf_getauxv): Remove unnecessary casts to char *.

2013-08-25  Kurt Roeckx  <kurt@roeckx.be>

	* gelf_getauxv.c (gelf_getauxv): Use memcpy instead of pointer
	dereference to avoid alignment problems.

2013-01-07  Roland McGrath  <roland@hack.frob.com>

	* elf_getarsym.c (elf_getarsym): Copy FILE_DATA into stack space if it
	would be unaligned and !ALLOW_UNALIGNED.

	* elf_getarsym.c (read_number_entries): Use memcpy instead of pointer
	dereference so as not to assume the field is naturally aligned.

2012-09-17  Petr Machata  <pmachata@redhat.com>

	* elf.h: Update from glibc.

2012-08-16  Roland McGrath  <roland@hack.frob.com>

	* elf.h: Update from glibc.

2012-08-14  Mark Wielaard  <mjw@redhat.com>

	* elf32_checksum.c (ebl_debugscn_p): Removed unused define and
	confusing outdated comment.

2012-08-01  Petr Machata  <pmachata@redhat.com>

	* elf_getarsym (read_number_entries): New function.
	(elf_getarsym): Handle 64-bit symbol table, stored in special
	entry named "/SYM64/".
	* elf_begin.c (__libelf_next_arhdr_wrlock): Don't reject archive
	because it contains 64-bit symbol table.

2012-07-19  Mark Wielaard  <mjw@redhat.com>

	* elf32_getshdr.c (load_shdr_wrlock): Add elf->flags & ELF_F_MALLOCED
	to asserts.

2012-07-17  Petr Machata  <pmachata@redhat.com>

	* elf32_xlatetom.c (elfw2(LIBELFBITS, xlatetom)): Do not check for
	integer number of records in case of ELF_T_NHDR.

2012-04-02  Mark Wielaard  <mjw@redhat.com>

	* elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET unless
	there are no nonempty sections at that offset.

2012-03-21  Roland McGrath  <roland@hack.frob.com>

	* elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check.

2011-02-26  Mark Wielaard  <mjw@redhat.com>

	* elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.

2011-01-05  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Fix off64_t overflow
	when MAXIMUM_SIZE == ~0.

2010-08-18  Roland McGrath  <roland@redhat.com>

	* gelf_fsize.c (__libelf_type_sizes): Add entries for ELF_T_LIB
	and ELF_T_GNUHASH.
	Reported by Mark Hatle <mark.hatle@windriver.com>.

	* exttypes.h: Add cases for ElfNN_Lib.
	Reported by Mark Hatle <mark.hatle@windriver.com>.

2010-06-14  Ulrich Drepper  <drepper@redhat.com>

	* gelf_update_shdr.c: Implicitly set ELF_F_DIRTY bit.
	* gelf_update_phdr.c: Likewise.
	* gelf_update_ehdr.c: Likewise.

2010-04-14  Roland McGrath  <roland@redhat.com>

	* elf32_getphdr.c: Check for e_phoff/size outside the file bounds.
	* elf_begin.c (file_read_elf): Don't set .phdr here.

2010-04-13  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2010-04-06  Roland McGrath  <roland@redhat.com>

	* elf_error.c (ELF_E_FD_MISMATCH_IDX): Avoid nonobvious abbreviation
	in error message.

2010-04-01  Petr Machata  <pmachata@redhat.com>

	* elf_getdata.c (__elf_getdata_rdlock): Initialize data.s for data
	that do not need a conversion.

2010-03-11  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2010-03-04  Ulrich Drepper  <drepper@redhat.com>

	* elf.h: Update from glibc.

2010-02-17  Roland McGrath  <roland@redhat.com>

	* elf_begin.c (file_read_elf): Leave section rawdata_base and
	data_base pointers null when [sh_offset,sh_size) points outside
	the mapped file.

2010-02-15  Roland McGrath  <roland@redhat.com>

	* Makefile.am: Use config/eu.am for common stuff.

2010-01-07  Roland McGrath  <roland@redhat.com>

	* elf32_getphdr.c: Use __elf_getphdrnum_rdlock.
	* gelf_getphdr.c: Likewise.
	* gelf_update_phdr.c: Likewise.
	* elf32_updatefile.c (__elf32_updatemmap, __elf32_updatefile): Likewise.
	* elf32_updatenull.c (__elf32_updatenull_wrlock): Likewise.
	* elf32_newphdr.c: Clear section 0's sh_info when resetting e_phnum.
	If COUNT is too large, use store PN_XNUM instead and set sh_info.
	* elf_begin.c (file_read_elf): Always allocate space we can use later
	for section 0 if doing RDWR.

	* elf_getphdrnum.c: New file.
	* Makefile.am (libelf_a_SOURCES): Add it.
	* libelf.h: Declare elf_getphdrnum.
	* libelfP.h: Declare __elf_getphdrnum_rdlock.
	* libelf.map (ELFUTILS_1.6): New set, add elf_getphdrnum.

	* elf.h: Update from glibc.

2009-10-23  Lubomir Rintel  <lkundrak@v3.sk>

	* elf32_updatefile.c (fill_mmap): When starting past shdr_end, start
	filling from section start, not shdr_end.

2009-11-10  Roland McGrath  <roland@redhat.com>

	* elf_readall.c (__libelf_readall): Fetch file size if not yet known.

2009-11-06  Mark Wielaard  <mjw@redhat.com>

	* elf_next.c (elf_next): Mark the archive header as unusable when
	there is no next ar element.

2009-08-12  Mark Wielaard  <mjw@redhat.com>

	* Makefile.am (libelf.so): Use -Wl,-z,defs not -defs.

2009-07-26  Ulrich Drepper  <drepper@redhat.com>

	* elf.h: Update from glibc.

2009-07-21  Ulrich Drepper  <drepper@redhat.com>

	* elf32_updatefile.c (__elfXX_updatemmap): Fix handling of gaps between
	sections.  Patch by Lubomir Rintel <lkundrak@v3.sk>.

2009-07-08  Roland McGrath  <roland@redhat.com>

	* libelfP.h (struct Elf): Remove unused ar.has_index field.
	Reorder various members for optimal packing.

2009-07-08  Ulrich Drepper  <drepper@redhat.com>

	* elf.h: Update from glibc.

2009-06-13  Ulrich Drepper  <drepper@redhat.com>

	* Makefile.am (libelf_a_SOURCES): Replace elf_getshnum.c and
	elf_getshstrndx.c with elf_getshdrnum.c and elf_getshdrstrndx.c.
	* elf_getshnum.c: Renamed to...
	* elf_getshdrnum.c: ...this.  Rename function and add old name as
	alias.  Likewise for internal functions with derived names.
	* elf_getshstrndx.c: Renamed to...
	* elf_getshdrstrndx.c: ...this.  Rename function and add old name as
	alias.  Likewise for internal functions with derived names.
	* libelf.h: Add prototypes for new names.  Make old names as
	deprecated.
	* libelfP.h: Rename internal function prototypes.
	* libelf.map: Export for names.
	* elf32_checksum.c: Don't use deprecated functions.
	* elf32_getshdr.c: Likewise.

2009-06-01  Ulrich Drepper  <drepper@redhat.com>

	* elf.h: Update from glibc.

2009-04-14  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2009-04-01  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2009-02-10  Ulrich Drepper  <drepper@redhat.com>

	* elf32_updatefile.c (updatefile): For the zeroth section we still
	have to copy the section header.

2009-02-01  Ulrich Drepper  <drepper@redhat.com>

	* elf_strptr.c: Add comment re possible problem.

2009-01-26  Ulrich Drepper  <drepper@redhat.com>

	* elf32_updatenull.c (updatenull_wrlock): Fix comment of
	ELF_F_LAYOUT behaviour re section header table.

2009-01-22  Ulrich Drepper  <drepper@redhat.com>

	* elf32_updatefile.c (__elfXX_updatemmap): Fill the gap between
	sections even if only the section at the start of the gap has been
	changed.
	(__elfXX_updatefile): Likewise.

2009-01-21  Ulrich Drepper  <drepper@redhat.com>

	* elf32_updatefile.c (__elfXX_updatemmap): Skip most of the loop to
	handle sections for NOBITS sections.
	(elfXX_updatefile): Likewise.

	* elf32_updatefile.c (__elfXX_updatemmap): When skipping non-NOBITS
	sections we haven't loaded, update last_position based on scn_start,
	not based on old value.  Don't run the loop for the dummy section 0.
	(elfXX_updatefile): Don't run the loop for the dummy section 0.

2009-01-10  Ulrich Drepper  <drepper@redhat.com>

	* libelfP.h (_): We only have one translation domain, elfutils.

	* Makefile.am: Use USE_LOCKS instead of USE_TLS.
	* elf_error.c: Always use __thread.  Remove all !USE_TLS code.

2009-01-04  Roland McGrath  <roland@redhat.com>

	* note_xlate.h (elf_cvt_note): Don't examine a size too small to
	container a note header.

2008-12-11  Roland McGrath  <roland@redhat.com>

	* elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Handle
	placement offset going backwards, for out-of-order or overlapping
	(bogus) sh_offset layouts.  It's a dumb use, but should not crash.
	(__elfw2(LIBELFBITS,updatefile)): Likewise.
	Fixes RHBZ#476136.

	* libelf.h (Elf_Data): Whitespace fix.

2008-12-10  Roland McGrath  <roland@redhat.com>

	* elf_getarhdr.c (elf_getarhdr): Fix missing rename in last change.

2008-10-22  Petr Machata  <pmachata@redhat.com>

	* elf_rawfile.c (elf_rawfile): Lock around elf-> references.

2008-10-21  Petr Machata  <pmachata@redhat.com>

	* libelfP.h: Rename getehdr_rdlock to getehdr_wrlock.
	* elf32_getehdr.c (getehdr_rdlock): Move the code to new function
	getehdr_impl and make it a wrapper.  Rename to getehdr_wrlock.
	(getehdr_impl): Guard elf->class init with wrlock.
	(getehdr): Also make it a wrapper of getehdr_impl.
	* elf32_updatenull.c (updatenull_wrlock): Call getehdr_wrlock.

2008-10-20  Petr Machata  <pmachata@redhat.com>

	* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Lock around the
	code that reads mutable elf state.  Relock to write lock to chain
	the new chunk on the elf rawchunks list.

2008-10-20  Petr Machata  <pmachata@redhat.com>

	* elf32_checksum.c (checksum): Place a lock around the code that
	processes data.  Make it wrlock if the code needs to xlate the
	data before processing.

2008-10-16  Petr Machata  <pmachata@redhat.com>

	* elf_begin.c
	(__libelf_next_arhdr): Rename to __libelf_next_arhdr_wrlock.
	(dup_elf): Adjust the call.
	(elf_begin): New local function lock_dup_elf.  Relocks the elf if
	necessary before calling dup.  Call this instead of dup_elf.
	* elf_getarhdr.c
	(elf_getarhdr): Lock before calling __libelf_next_arhdr_wrlock.
	* elf_next.c (elf_next): Likewise.
	* elf_rand.c (elf_rand): Likewise.

2008-10-14  Petr Machata  <pmachata@redhat.com>

	* elf_getdata.c (__elf_getdata_rdlock): Lock before converting.

2008-11-26  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2008-10-06  Roland McGrath  <roland@redhat.com>

	* elf_getarhdr.c (elf_getarhdr): Return NULL when passed NULL.

2008-08-27  Roland McGrath  <roland@redhat.com>

	* elf_begin.c (get_shnum): Avoid misaligned reads for matching endian.

	* libelfP.h [!ALLOW_UNALIGNED] (__libelf_type_align): Fix CLASS index.

2008-08-25  Roland McGrath  <roland@redhat.com>

	* Makefile.am (libelf_so_LDLIBS): New variable.
	(libelf.so): Use it in the link.

2008-08-21  Petr Machata  <pmachata@redhat.com>

	* elf_getdata.c, libelfP.h
	(__elf_getdata_internal): Rename to __elf_getdata_rdlock.
	(__libelf_set_rawdata_wrlock): New function.
	(__libelf_set_rawdata): Make it a wrapper that calls *_wrlock.
	* elf32_updatenull.c, libelfP.h
	(__elfNN_updatenull): Rename to __elfNN_updatenull_wrlock.

2008-08-21  Petr Machata  <pmachata@redhat.com>

	* elf32_getphdr.c, libelfP.h
	(__elfNN_getphdr_internal): Drop.  Move __elfNN_getphdr_internal
	code to __elfNN_getphdr_wrlock.
	(__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): New functions.
	(__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): Make these
	wrappers of getphdr_impl.

2008-08-21  Petr Machata  <pmachata@redhat.com>

	* elf32_getehdr.c, libelfP.h
	(__elfNN_getehdr_internal): Rename to __elfNN_getehdr_rdlock.
	* gelf_getehdr, libelfP.h:
	(__gelf_getehdr_internal): Rename to __gelf_getehdr_rdlock.

2008-08-21  Petr Machata  <pmachata@redhat.com>

	* elf32_getshdr.c
	(__elfNN_getshdr_internal): Drop.
	(load_shdr_wrlock, scn_valid): New functions, contain bits of
	behaviour from __elfNN_getshdr_internal.
	(__elfNN_getshdr_rdlock, __elfNN_getshdr_wrlock): Replacements for
	dropped _internal functions above.
	* elf_getshnum.c
	(__elf_getshnum_internal): Rename to __elf_getshnum_rdlock.

2008-08-04  Petr Machata  <pmachata@redhat.com>

	* libelfP.h (RWLOCK_RDLOCK, RWLOCK_WRLOCK, RWLOCK_UNLOCK): New macros.

2008-07-28  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2008-03-31  Roland McGrath  <roland@redhat.com>

	* elf32_offscn.c: Make sure shdrs have been read in.

2008-02-19  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2008-02-08  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2008-01-31  Ulrich Drepper  <drepper@redhat.com>

	* elf_strptr.c (elf_strptr): Don't fail if the ELF file is currently
	under construction and no raw data can be read from disk.

2008-01-30  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2008-01-26  Roland McGrath  <roland@redhat.com>

	* elf_begin.c (__libelf_next_arhdr): Rewrite conversions using a macro.
	Fixes various pastos in wrong type in sizeof, wrong string parsed.

2008-01-20  Roland McGrath  <roland@redhat.com>

	* elf_getaroff.c: Calculate from start_offset, instead of using
	parent's state.ar.offset field.

2008-01-08  Roland McGrath  <roland@redhat.com>

	* Makefile.am (euinclude): Variable removed.
	(pkginclude_HEADERS): Set this instead of euinclude_HEADERS.

2008-01-03  Roland McGrath  <roland@redhat.com>

	* common.h: Add __attribute__ ((unused)) to static functions.

2007-12-20  Ulrich Drepper  <drepper@redhat.com>

	* Makefile.am (libelf_a_SOURCES): Add elf_scnshndx.
	* libelfP.h (struct Elf_Scn): Add shndx_index field.
	Declare __elf_scnshndx_internal.
	* elf32_getshdr.c: Record location of extended section header.
	* elf_begin.c (file_read_elf): Likewise.
	* elf_scnshndx.c: New file.
	* libelf.h: Declare elf_scnshndx.
	* libelf.map: Add elf_scnshndx to version ELFUTILS_1.4.

2007-11-12  Roland McGrath  <roland@redhat.com>

	* libelf.h: Replace off64_t with loff_t throughout.
	Only that type name is unconditionally defined by <sys/types.h>

2007-11-03  Roland McGrath  <roland@redhat.com>

	* libelf.h (Elf_Data): Comment fix.

2007-10-18  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2007-10-07  Roland McGrath  <roland@redhat.com>

	* elf_begin.c (__libelf_next_arhdr): Fix fencepost error and wrong
	member access in terminating name with no trailing /.  Trim trailing
	spaces when there is no /.

2007-10-04  Roland McGrath  <roland@redhat.com>

	* elf_end.c (elf_end): Don't free ELF->state.ar.ar_sym when it's -1l.

2007-10-03  Roland McGrath  <roland@redhat.com>

	* libelf.h (Elf_Data): Use off64_t for d_off.
	(Elf_Arhdr): Use off64_t for ar_size.
	(elf_update, elf_getbase, elf_getaroff): Return off64_t.

	* gelf_rawchunk.c: File removed.
	* gelf_freechunk.c: File removed.
	* Makefile.am (libelf_a_SOURCES): Remove them.
	* libelf.map (ELFUTILS_1.0): Remove exports.
	* gelf.h: Remove decls.

	* elf_getdata_rawchunk.c: New file.
	* Makefile.am (libelf_a_SOURCES): Add it.
	* libelf.map (ELFUTILS_1.3): Add elf_getdata_rawchunk.
	* libelf.h: Declare it.
	* libelfP.h (Elf_Data_Chunk): New type.
	(struct Elf.elf): New member `rawchunks'.
	* elf_end.c (elf_end): Free recorded rawchunk buffers.

2007-08-24  Roland McGrath  <roland@redhat.com>

	* gelf_getnote.c: New file.
	* Makefile.am (libelf_a_SOURCES): Add it.
	* gelf.h: Declare gelf_getnote.
	* libelf.map (ELFUTILS_1.3): Add gelf_getnote.

	* libelfP.h (NOTE_ALIGN): New macro.
	* note_xlate.h: New file.
	* Makefile.am (noinst_HEADERS): Add it.
	* gelf_xlate.c: Include it.
	(__elf_xfctstom): Use elf_cvt_note.
	* elf_getdata.c (shtype_map, __libelf_type_align): Handle SHT_NOTE.
	(__libelf_set_rawdata): Likewise.

2007-08-19  Roland McGrath  <roland@redhat.com>

	* gelf_update_auxv.c: New file.
	* gelf_getauxv.c: New file.
	* Makefile.am (libelf_a_SOURCES): Add them.
	* gelf.h: Declare gelf_getauxv, gelf_update_auxv.
	* libelf.map (ELFUTILS_1.3): New set, inherits fom ELFUTILS_1.2.
	Export gelf_getauxv, gelf_update_auxv.

	* libelf.h (Elf_Type): Add ELF_T_AUXV.
	* abstract.h: Add auxv_t entries.
	* exttypes.h: Likewise.
	* gelf_xlate.h: Likewise.
	* gelf_xlate.c (__elf_xfctstom): Add ELF_T_AUXV entries.
	* gelf_fsize.c (__libelf_type_sizes): Likewise.

2007-08-12  Roland McGrath  <roland@redhat.com>

	* elf32_updatefile.c (compare_sections): Sort secondarily on sh_size,
	and only tertiarily on index.

2007-07-09  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2007-04-22  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2007-03-18  Roland McGrath  <roland@redhat.com>

	* elf_begin.c (get_shnum): Fix test for e_shoff being out of bounds.
	Return zero when the section headers do not fit within MAXSIZE.

2007-03-09  Roland McGrath  <roland@redhat.com>

	* libelfP.h (LIBELF_EV_IDX): New macro.
	(__libelf_type_align): New macro.
	[! ALLOW_UNALIGNED]: Declare __libc_type_aligns array.
	* elf_getdata.c (shtype_map): Convert to just Elf_Type[][].
	(convert_data, __libelf_set_rawdata): Use that, __libelf_type_align,
	and __libelf_type_sizes, in place of old table.
	(__libc_type_aligns): New const variable.

2007-02-04  Ulrich Drepper  <drepper@redhat.com>

	* Makefile (libelf.so): Build with -z relro.

	* elf_begin.c (read_file): When using ELF_C_READ_MMAP use MAP_PRIVATE.

2007-01-30  Ulrich Drepper  <drepper@redhat.com>

	* nlist.c: Close file descriptor before returning.

2007-01-20  Roland McGrath  <roland@redhat.com>

	* gnuhash_xlate.h (elf_cvt_gnuhash): Fix fence-post error so we
	convert the final word.

	* elf32_getshdr.c: Don't byteswap shdr fields when EI_DATA matches
	MY_ELFDATA on !ALLOW_UNALIGNED machines.

2007-01-18  Roland McGrath  <roland@redhat.com>

	* gelf_rawchunk.c (gelf_rawchunk): Clear RESULT pointer after freeing
	it on read error.

2006-10-13  Roland McGrath  <roland@redhat.com>

	* elf32_updatenull.c: Look for and accept phdr also for ET_CORE.
	* elf_error.c (msgstr): Change ELF_E_INVALID_PHDR string.

2006-08-29  Roland McGrath  <roland@redhat.com>

	* elf32_getphdr.c: Don't byteswap phdr fields when EI_DATA matches
	MY_ELFDATA on !ALLOW_UNALIGNED machines.
	Reported by Christian Aichinger <Greek0@gmx.net>.

	* Makefile.am (CLEANFILES): Add libelf.so.$(VERSION).

2006-08-08  Ulrich Drepper  <drepper@redhat.com>

	* elf.h (DT_VALNUM): Update.
	(DT_ADDRNUM): Likewise.

2006-07-12  Ulrich Drepper  <drepper@redhat.com>

	* elf32_updatefile.c: Adjust for internal_function_def removal.
	* elf32_updatenull.c: Likewise.
	* elf_begin.c: Likewise.
	* elf_getdata.c: Likewise.

2006-07-11  Ulrich Drepper  <drepper@redhat.com>

	* libelf.h: Define ELF_T_GNUHASH.
	* elf_getdata.c (TYPEIDX): Handle SHT_GNU_HASH.
	(shtype_map): Add SHT_GNU_HASH entries.
	* gelf_xlate.c (__elf_xfctstom): Add ELF_T_GNUHASH entries.
	* gnuhash_xlate.h: New file.
	* Makefile.am (noinst_HEADERS): Add gnuhash_xlate.h.

2006-07-06  Ulrich Drepper  <drepper@redhat.com>

	* elf_gnu_hash.c: New file.
	* libelf.h: Declare elf_gnu_hash.
	* Makefile.am (libelf_a_SOURCES): Add elf_gnu_hash.
	* libelf.map: Add elf_gnu_map for version ELFUTILS_1.2.

2006-06-15  Roland McGrath  <roland@redhat.com>

	* libelf.h (elf_getarsym): Fix comment typo.
	Rename second parameter to be more explanatory.
	(elf_getident, elf_rawhide): Likewise.

2006-05-28  Ulrich Drepper  <drepper@redhat.com>

	* elf32_updatefile.c (updatemmap): Preserve section content if
	copying would overwrite them.
	Fix msync paramters.

2006-04-04  Roland McGrath  <roland@redhat.com>

	* elf32_updatefile.c (updatemmap): Handle other-endian case.

2006-04-04  Ulrich Drepper  <drepper@redhat.com>

	* elf32_updatefile.c (updatemmap): Cleanups.  Remove shdr_dest
	variable.  Before writing sections, make a copy of the section
	header data if necessary.  Don't write section header while
	writing the section constent, it might overwrite some sections.
	Restore the pointer afterwards.
	* elf32_updatenull.c (updatenull): If the offset of a section in a
	file changed make sure we read the section so that it'll be written
	out.

	* elf_update.c: Remove debug message.

2005-12-07  Roland McGrath  <roland@redhat.com>

	* gelf_xlate.c [! ALLOW_UNALIGNED] (union unaligned): New type.
	(FETCH, STORE): New macros.
	(INLINE3): Use those to do alignment-friendly conversion.

	* elf32_getshdr.c: Include map_address and start_offset in alignment
	calculations.
	* elf32_getphdr.c: Likewise.

2005-11-19  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2005-11-17  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2005-11-10  Roland McGrath  <roland@redhat.com>

	* elf.h: Update from glibc.

2005-09-09  Roland McGrath  <roland@redhat.com>

	* elf_update.c (write_file): Stat the file and fchmod it after update
	if its mode had S_ISUID or S_ISGID bits set.

2005-08-28  Ulrich Drepper  <drepper@redhat.com>

	* elf32_getphdr.c: Include <system.h>.  Use pread_retry instead of
	pread.  And branch prediction where useful.
	* elf_begin.c: Likewise.
	* elf_getdata.c: Likewise.
	* elf_getshstrndx.c: Likewise.
	* elf_readall.c: Likewise.
	* gelf_rawchunk.c: Likewise.
	* elf32_updatefile.c: Include <system.h>.  Use pread_retry instead of
	pread.  And branch prediction where useful.
	* elf_getarsym.c: Don't define pread_retry here.

	* Makefile.am: Use $(LINK) not $(CC) when creating DSO.
	(%.os): Use COMPILE.os.
	(COMPILE.os): Filter out gconv options.

2005-08-27  Ulrich Drepper  <drepper@redhat.com>

	* elf_begin.c (file_read_elf): Avoid reading ELF header from file
	again.  Instead accept additional parameter which points to it if we
	don't use mmap.
	(get_shnum): Use passed in e_ident value as source of ELF header.

2005-08-15  Ulrich Drepper  <drepper@redhat.com>

	* elf_begin.c (__libelf_next_arhdr): Use TEMP_FAILURE_RETRY.

	* Makefile (libelf_a_SOURCES): Add elf_getaroff.c.
	* libelf.map: Export elf_getaroff.
	* libelf.h: Declare elf_getaroff.
	* elf_getaroff.c: New file.

2005-08-13  Ulrich Drepper  <drepper@redhat.com>

	* elf_begin.c (get_shnum): Optimize memory handling.  Always read from
	mapped file if available.  Fix access to 64-bit sh_size.  Recognize
	overflow.
	(file_read_elf): Likewise.

2005-08-12  Roland McGrath  <roland@redhat.com>

	* elf32_offscn.c: Do not match empty sections at OFFSET unless
	there are no nonempty sections at that offset.

2005-08-07  Ulrich Drepper  <drepper@redhat.com>

	* elf.h: Update from glibc.

2005-08-06  Ulrich Drepper  <drepper@redhat.com>

	* Makefile.am (AM_CFLAGS): Add -fpic when BUILD_STATIC.

2005-08-03  Ulrich Drepper  <drepper@redhat.com>

	* libelf.map: Move elf32_offscn, elf64_offscn, and gelf_offscn in
	new version ELFUTILS_1.1.1.

2005-08-02  Ulrich Drepper  <drepper@redhat.com>

	* elf_error.c: Add handling of ELF_E_INVALID_OFFSET.
	* elf32_offscn.c: New file.
	* elf64_offscn.c: New file.
	* gelf_offscn.c: New file.
	* Makefile.am (libelf_a_SOURCES): Add elf32_offscn.c, elf64_offscn.c,
	and gelf_offscn.c.
	* libelf.sym: Export new symbols.

2005-07-23  Ulrich Drepper  <drepper@redhat.com>

	* elf-knowledge.h (SECTION_STRIP_P): Don't handle removal of debug
	sections here anymore.
	* elf32_checksum.c: Adjust for change in SECTION_STRIP_P interface.

	* elf_update.c (elf_update): Get write lock, not read lock.

	* elf32_updatenull.c (updatenull): Get section headers if necessary
	and possible.

2005-07-22  Ulrich Drepper  <drepper@redhat.com>

	* elf32_updatenull.c (updatenull): If program header hasn't been loaded
	yet, try to do it now.
	Don't unnecessarily update overflow of section count in zeroth section
	sh_size field.
	If section content hasn't been read yet, do it before looking for the
	block size.  If no section data present, infer size of section header.

2005-05-11  Ulrich Drepper  <drepper@redhat.com>

	* elf.h: Update again.

2005-05-09  Ulrich Drepper  <drepper@redhat.com>

	* elf.h: Update from glibc.

2005-05-08  Roland McGrath  <roland@redhat.com>

	* elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
	* elf_update.c (write_file) [_MUDFLAP]: Likewise.

2005-03-29  Ulrich Drepper  <drepper@redhat.com>

	* elf32_checksum.c: Use INTUSE and INTDEF to avoid PLTs.
	* elf_end.c: Likewise.
	* elf_getdata.c: Likewise.
	* gelf_getehdr.c: Likewise.
	* nlist.c: Likewise.
	* libelfP.h: Add declarations of internal functions.

2005-02-15  Ulrich Drepper  <drepper@redhat.com>

	* common.h (CONVERT): Make sure all values are unsigned.
	(CONVERT_TO): Likewise.

	* Makefile.am (AM_CFLAGS): Add -Wformat=2.
	Fix rule to build libelf.so.

2005-02-06  Ulrich Drepper  <drepper@redhat.com>

	* Makefile.am: Cleanup AM_CFLAGS handling.  Add -Wunused -Wextra.
	Remove lint handling.
	* elf32_getphdr.c: Minor cleanups.
	* elf32_getshdr.c: Likewise.
	* elf32_updatefile.c: Likewise.
	* elf32_updatenull.c: Likewise.
	* elf_begin.c: Likewise.
	* elf_error.c: Likewise.
	* elf_getarsym.c: Likewise.
	* elf_getdata.c: Likewise.
	* elf_update.c: Likewise.
	* gelf_xlate.c: Likewise.

2005-02-05  Ulrich Drepper  <drepper@redhat.com>

	* Makefile.am: Check for text relocations in constructed DSO.

	* Makefile.am [MUDFLAP] (AM_CFLAGS): Add -Werror -fpic -fmudflap.

2005-02-04  Ulrich Drepper  <drepper@redhat.com>

	* gelf_getehdr.c (gelf_getehdr): Slight optimization.

	* elf32_checksum.c (checksum): Do not look at NOBITS sections.

	* gelf.h: Add gelf_checksum prototype.

2004-09-25  Ulrich Drepper  <drepper@redhat.com>

	* elf32_checksum.c: Make compile with gcc 4.0.
	* elf32_updatefile.c: Likewise.
	* elf32_updatenull.c: Likewise.
	* elf_begin.c: Likewise.
	* elf_error.c: Likewise.
	* elf_getdata.c: Likewise.
	* elf_getident.c: Likewise.

2004-04-01  Ulrich Drepper  <drepper@redhat.com>

	* elf.h: Update from glibc.

2004-01-23  Ulrich Drepper  <drepper@redhat.com>

	* elf_update.c: Fix locking.
	* elf_clone.c: Likewise.

	* libelf.h: Define ELF_T_LIB.
	* gelf_getlib.c: New file.
	* gelf_update_lib.c: New file.
	* gelf.h: Declare the new functions.  Define GElf_Lib.
	* abstract.h: Define Lib, Lib32, Lib64.
	* gelf_xlate.c (__elf_xfctstom): Add ELF_T_LIB entry.
	* gelf_xlate.h: Add entry for ElfXX_Lib.
	* elf_getdata.c: Recognize SHT_GNU_LIBLIST as a known section type.
	* libelf.map: Add new symbols to ELFUTILS_1.1.
	* Makefile.am (libelf_a_SOURCES): Add gelf_getlib.c and
	gelf_update_lib.c.

2004-01-17  Ulrich Drepper  <drepper@redhat.com>

	* Makefile.am: Support building with mudflap.

	* gelf_xlate.c (INLINE3): Avoid using cast as lvalue.
	* dl-hash.h (_dl_elf_hash): Likewise.

2004-01-05  Ulrich Drepper  <drepper@redhat.com>

	* elf-knowledge.h: New file.  From libelf subdir.
	* Makefile.am (euincludedir): Define.
	(euinclude_HEADERS): Add elf-knowledge.h.

2003-09-24  Ulrich Drepper  <drepper@redhat.com>

	* elf.h: Define some PT_IA_64_HP_* constants.

2003-09-23  Jakub Jelinek  <jakub@redhat.com>

	* libelfP.h (struct Elf): Move state.elf64.sizestr_offset after
	state.elf64.scnincr to match state.elf{,32}.

2003-08-12  Ulrich Drepper  <drepper@redhat.com>

	* elf32_updatefile.c (__updatemmap): When writing back file where
	some sections have not been read in, count their sizes based on
	the section header.

2003-08-11  Ulrich Drepper  <drepper@redhat.com>

	* Moved to CVS archive.