Using first-principles calculations, the elastic constants, the thermodynamic properties, and the structural phase transition between the B1 (rocksalt) and the B2 (cesium chloride) phases of NaCl are investigated by means of the pseudopotential plane-waves method. The calculations are performed within the generalized gradient approximation to density functional theory with the Perdew-Burke-Ernzerhof exchange-correlation functional. On the basis of the third-order Birch-Murnaghan equation of states, the transition pressure Pt between the B1 phase and the B2 phase of NaCl is determined. The calculated values are generally speaking in good agreement with experiments and with similar theoretical calculations. From the theoretical calculations, the shear modulus, Young's modulus, rigidity modulus, and Poisson's ratio of NaCl are derived. According to the quasi-harmonic Debye model, we estimated the Debye temperature of NaCl from the average sound velocity. Moreover, the pressure derivatives of elastic constants, partial differentialC11/partial differentialP, partial differentialC12/partial differentialP, partial differentialC44/partial differentialP, partial differentialS11/partial differential P, partial differentialS12/partial differentialP, and partial differentialS44/partial differentialP, for NaCl crystal are investigated for the first time. This is a quantitative theoretical prediction of the elastic and thermodynamic properties of NaCl, and it still awaits experimental confirmation.